27 lines
638 B
Nix
27 lines
638 B
Nix
with import <nixpkgs> {};
|
|
|
|
pkgs.writeShellScriptBin "plans" ''
|
|
#!/bin/sh
|
|
if [ "$1" = "help" ] ; then
|
|
echo "plans (tudbut)"
|
|
echo
|
|
echo "- add <str> -- add to end of list"
|
|
echo "- done -- remove from start of list"
|
|
echo "- edit -- edit manually using helix"
|
|
echo
|
|
echo "file used is ~/sync/plans.txt"
|
|
exit
|
|
fi
|
|
if [ "$1" = "add" ] ; then
|
|
echo "- $2" >> ~/sync/plans.txt
|
|
fi
|
|
if [ "$1" = "done" ] ; then
|
|
tail -n"$(($(wc -l < ~/sync/plans.txt) - 1))" ~/sync/plans.txt > ~/plans.txt.tmp
|
|
mv ~/plans.txt.tmp ~/sync/plans.txt
|
|
fi
|
|
if [ "$1" = "edit" ] ; then
|
|
hx ~/sync/plans.txt
|
|
fi
|
|
cat ~/sync/plans.txt
|
|
''
|
|
|