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:
parent
5c8c53d1cf
commit
7b9e5c6cfc
|
@ -82,6 +82,24 @@
|
||||||
fi
|
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() {
|
ttyper() {
|
||||||
command ${pkgs.ttyper}/bin/ttyper --language english1000 --words 50 "''${@}"
|
command ${pkgs.ttyper}/bin/ttyper --language english1000 --words 50 "''${@}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue