small changes to termux shortcuts

This commit is contained in:
stupidcomputer 2024-10-21 22:30:06 -05:00
parent 9e8baced38
commit e5cf3a102d
2 changed files with 12 additions and 14 deletions

View File

@ -1,5 +1,3 @@
set -x
register_habits=$(ls ~/pdbs/ | register_habits=$(ls ~/pdbs/ |
grep '\.habit$' | grep '\.habit$' |
fzy) fzy)

View File

@ -9,23 +9,23 @@ today=$(date "+%m/%d/%Y")
# $1 -- habit filename # $1 -- habit filename
show_past_habit () { show_past_habit () {
printf "%55s =========\n" "$1" printf "%25s =========\n" "$1"
donein5days=$(grep -c "$day5" ~/pdbs/$1.habit ) donein5days=$(grep -c "$day5" "$HOME/pdbs/$1")
donein4days=$(grep -c "$day4" ~/pdbs/$1.habit ) donein4days=$(grep -c "$day4" "$HOME/pdbs/$1")
donein3days=$(grep -c "$day3" ~/pdbs/$1.habit ) donein3days=$(grep -c "$day3" "$HOME/pdbs/$1")
donein2days=$(grep -c "$day2" ~/pdbs/$1.habit ) donein2days=$(grep -c "$day2" "$HOME/pdbs/$1")
donein1days=$(grep -c "$day1" ~/pdbs/$1.habit ) donein1days=$(grep -c "$day1" "$HOME/pdbs/$1")
donetoday=$(grep -c "$today" ~/pdbs/$1.habit) donetoday=$(grep -c "$today" "$HOME/pdbs/$1")
printf "%10s %10s %10s %10s %10s %10s\n%10s %10s %10s %10s %10s (today)%3s\n\n" \ printf "%.5s %.5s %.5s %.5s %.5s %.5s\n%5s %5s %5s %5s %5s %5s\n\n" \
"$day5" "$day4" "$day3" "$day2" "$day1" "$today" \ "$day5" "$day4" "$day3" "$day2" "$day1" "$today" \
"$donein5days" "$donein4days" "$donein3days" \ "$donein5days" "$donein4days" "$donein3days" \
"$donein2days" "$donein1days" "$donetoday" "$donein2days" "$donein1days" "$donetoday"
} }
habits=$(ls ~/pdbs | grep '\.habit$' | sed 's/\.habit$//g') habits=$(ls ~/pdbs | grep '\.habit$')
IFS=' for i in $habits; do
'
for i in "$habits"; do
show_past_habit "$i" show_past_habit "$i"
done done
read