plans: add editing

This commit is contained in:
Daniella / Tove 2024-10-30 01:19:01 +01:00
parent 3f2131f296
commit 179881b9dc
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -3,11 +3,14 @@ with import <nixpkgs> {};
pkgs.writeShellScriptBin "plans" ''
#!/bin/sh
if [ "$1" = "add" ] ; then
echo "$2" >> ~/sync/plans.txt
echo "- $2" >> ~/sync/plans.txt
fi
if [ "$1" = "done" ] ; then
tail -n"$(($(wc -l < ~/sync/plans.txt) - 1))" ~/sync/plans.txt
fi
if [ "$1" = "edit" ] ; then
hx ~/sync/plans.txt
fi
cat ~/sync/plans.txt
''