💾 Archived View for laniakea.rodoste.de › journal › 2023-02-21-todo-app.gmi captured on 2023-09-08 at 16:01:54. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-05-24)
-=-=-=-=-=-=-
2023-02-21
Instead of why mentioning my todo app every other time, why not just show it?
On the off-chance that you're a terminal user like me, you do use z-shell and you're in the market for a micro-sized task manager: here you go:
----
#!/usr/bin/env zsh autoload colors colors # ensure files exist, load lists FILE_DIR=~/.todos; FILE_TODO=$FILE_DIR"/todos.txt"; FILE_DONE=$FILE_DIR"/done.txt" if [[ ! -d $FILE_DIR ]]; then echo "directory '$FILE_DIR' not found"; exit 1; fi touch $FILE_TODO $FILE_DONE TODOS=$(<$FILE_TODO); DONES=$(<$FILE_DONE) # prepare glyphs. if you want to use plain ASCII, I recommend o, x, ^, v GE=$reset_color G=($fg[red]" "$GE $fg[green]" "$GE $fg_bold[yellow]""$GE $fg[cyan]""$GE) # functions move_tasks() { for i in $s; do echo $1 | awk 'NR=='$i' {print;exit}' >> $2; sed -i $i'd' $3; done } # run commands if [[ $# -ne 0 ]]; then COMMAND=$1 shift IFS=