Compare commits
3 Commits
7b5954997e
...
67881fcad5
Author | SHA1 | Date | |
---|---|---|---|
67881fcad5 | |||
58a6ddd306 | |||
4bc1865a2e |
@ -46,6 +46,7 @@
|
||||
ffmpeg
|
||||
mdadm
|
||||
git-annex
|
||||
tigervnc
|
||||
|
||||
(pkgs.callPackage ../../builds/archutils.nix {})
|
||||
];
|
||||
|
11
boxes/phone/out-of-tree/shortcuts/make-habit.sh
Executable file
11
boxes/phone/out-of-tree/shortcuts/make-habit.sh
Executable file
@ -0,0 +1,11 @@
|
||||
set -x
|
||||
|
||||
register_habits=$(ls ~/pdbs/ |
|
||||
grep '\.habit$' |
|
||||
fzy)
|
||||
|
||||
if [ -z "$register_habits" ]; then
|
||||
echo "you didn't choose one!"
|
||||
else
|
||||
date "+%m/%d/%Y" >> ~/pdbs/$register_habits
|
||||
fi
|
31
boxes/phone/out-of-tree/shortcuts/view-habits.sh
Executable file
31
boxes/phone/out-of-tree/shortcuts/view-habits.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
day5=$(date --date="5 days ago" "+%m/%d/%Y")
|
||||
day4=$(date --date="4 days ago" "+%m/%d/%Y")
|
||||
day3=$(date --date="3 days ago" "+%m/%d/%Y")
|
||||
day2=$(date --date="2 days ago" "+%m/%d/%Y")
|
||||
day1=$(date --date="1 days ago" "+%m/%d/%Y")
|
||||
today=$(date "+%m/%d/%Y")
|
||||
|
||||
# $1 -- habit filename
|
||||
show_past_habit () {
|
||||
printf "%55s =========\n" "$1"
|
||||
donein5days=$(grep -c "$day5" ~/pdbs/$1.habit )
|
||||
donein4days=$(grep -c "$day4" ~/pdbs/$1.habit )
|
||||
donein3days=$(grep -c "$day3" ~/pdbs/$1.habit )
|
||||
donein2days=$(grep -c "$day2" ~/pdbs/$1.habit )
|
||||
donein1days=$(grep -c "$day1" ~/pdbs/$1.habit )
|
||||
donetoday=$(grep -c "$today" ~/pdbs/$1.habit)
|
||||
|
||||
printf "%10s %10s %10s %10s %10s %10s\n%10s %10s %10s %10s %10s (today)%3s\n\n" \
|
||||
"$day5" "$day4" "$day3" "$day2" "$day1" "$today" \
|
||||
"$donein5days" "$donein4days" "$donein3days" \
|
||||
"$donein2days" "$donein1days" "$donetoday"
|
||||
}
|
||||
|
||||
habits=$(ls ~/pdbs | grep '\.habit$' | sed 's/\.habit$//g')
|
||||
IFS='
|
||||
'
|
||||
for i in "$habits"; do
|
||||
show_past_habit "$i"
|
||||
done
|
Loading…
Reference in New Issue
Block a user