ソースを参照

~/.config/dwm,~/.bin: Collect working time stats as csv

Lu Stadler 7 年 前
コミット
ef2e4f3050
共有2 個のファイルを変更した15 個の追加1 個の削除を含む
  1. 12 0
      .bin/collect-working-time.sh
  2. 3 1
      .config/dwm/status.sh

+ 12 - 0
.bin/collect-working-time.sh

@ -0,0 +1,12 @@
1
#!/bin/sh
2
3
set -u
4
5
working_time=$1
6
csv_file=$2
7
8
today=$(date --iso-8601=date)
9
10
touch $csv_file
11
sed -n '$p' $csv_file | grep $today &> /dev/null || echo >> $csv_file
12
sed -i "\$s/.*/$today,$working_time/" $csv_file

+ 3 - 1
.config/dwm/status.sh

@ -2,7 +2,9 @@
2 2
3 3
status=""
4 4
5
status="$(working-time)  "
5
working_time="$(working-time)"
6
collect-working-time.sh $working_time $HOME/.working-times.csv
7
status="$working_time  "
6 8
7 9
# network
8 10
#status="📡 $(nmcli --terse --fields STATE -c no g status)"