Compare commits
3 commits
aa0175bc30
...
b009381983
Author | SHA1 | Date | |
---|---|---|---|
b009381983 | |||
f46fc2f042 | |||
ad2a47d42b |
2 changed files with 10 additions and 4 deletions
|
@ -92,7 +92,7 @@ pkgs.writeShellScriptBin "nixos-edit" ''
|
||||||
|
|
||||||
cd /etc/nixos
|
cd /etc/nixos
|
||||||
if [ "$1" = "pull" ] ; then
|
if [ "$1" = "pull" ] ; then
|
||||||
git pull
|
git pull --rebase
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "edit" ] || [ "$1" = "" ] || [ "$1" = "test" ] ; then
|
if [ "$1" = "edit" ] || [ "$1" = "" ] || [ "$1" = "test" ] ; then
|
||||||
sudo hx .
|
sudo hx .
|
||||||
|
|
|
@ -6,8 +6,9 @@ pkgs.writeShellScriptBin "plans" ''
|
||||||
echo "plans (tudbut)"
|
echo "plans (tudbut)"
|
||||||
echo
|
echo
|
||||||
echo "- add <str> -- add to end of list"
|
echo "- add <str> -- add to end of list"
|
||||||
echo "- done -- remove from start of list"
|
echo "- done [n] -- remove from list"
|
||||||
echo "- edit -- edit manually using helix"
|
echo "- edit -- edit manually using helix"
|
||||||
|
echo "default prints list"
|
||||||
echo
|
echo
|
||||||
echo "file used is ~/sync/plans.txt"
|
echo "file used is ~/sync/plans.txt"
|
||||||
exit
|
exit
|
||||||
|
@ -16,12 +17,17 @@ pkgs.writeShellScriptBin "plans" ''
|
||||||
echo "- $2" >> ~/sync/plans.txt
|
echo "- $2" >> ~/sync/plans.txt
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "done" ] ; then
|
if [ "$1" = "done" ] ; then
|
||||||
|
if [ "$2" != "" ] ; then
|
||||||
|
head -n $(($2 - 1)) ~/sync/plans.txt > ~/plans.txt.tmp
|
||||||
|
tail -n"$(($(wc -l < ~/sync/plans.txt) - $2))" ~/sync/plans.txt >> ~/plans.txt.tmp
|
||||||
|
else
|
||||||
tail -n"$(($(wc -l < ~/sync/plans.txt) - 1))" ~/sync/plans.txt > ~/plans.txt.tmp
|
tail -n"$(($(wc -l < ~/sync/plans.txt) - 1))" ~/sync/plans.txt > ~/plans.txt.tmp
|
||||||
|
fi
|
||||||
mv ~/plans.txt.tmp ~/sync/plans.txt
|
mv ~/plans.txt.tmp ~/sync/plans.txt
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "edit" ] ; then
|
if [ "$1" = "edit" ] ; then
|
||||||
hx ~/sync/plans.txt
|
hx ~/sync/plans.txt
|
||||||
fi
|
fi
|
||||||
cat ~/sync/plans.txt
|
cat -n ~/sync/plans.txt
|
||||||
''
|
''
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue