Add todo and til functions

Add helper functions to write text input into a `TODO.txt` or `TIL.txt`
file respectively.

Extracting this to a function means I'm not able to overwrite the
contents of a file by typing `echo "foo" > TODO.txt` or similar
accidentally and overwriting the entire file instead of appending to it.
This commit is contained in:
Oliver Davies 2024-05-12 09:25:21 +02:00
parent 5c8c53d1cf
commit 7b9e5c6cfc

View file

@ -82,6 +82,24 @@
fi
}
til() {
if [[ ''${#} < 1 ]]; then
echo "No text was provided."
return
fi
echo ''${1} >> TIL.txt
}
todo() {
if [[ ''${#} < 1 ]]; then
echo "No text was provided."
return
fi
echo ''${1} >> TODO.txt
}
ttyper() {
command ${pkgs.ttyper}/bin/ttyper --language english1000 --words 50 "''${@}"
}