feat(user/malte): improve notetaking script
This commit is contained in:
parent
d47679ec28
commit
2f67e8d8d5
|
@ -15,7 +15,17 @@ year="$(date +%Y)"
|
|||
|
||||
# Just start helix if no arguments are given
|
||||
if [ -z "${1+x}" ]; then
|
||||
hx "$XDG_DATA_HOME/life.md/$year.md" +99999
|
||||
# Switch directory
|
||||
pushd "$XDG_DATA_HOME/life.md" || exit 1
|
||||
# Open Helix with the current year
|
||||
hx "$year.md" +99999
|
||||
# Commit changes if any exist
|
||||
if ! git diff --quiet "$year.md"; then
|
||||
git add "$year.md"
|
||||
git commit -m "Auto Commit $(date +"%F %R")"
|
||||
fi
|
||||
# Exit
|
||||
popd || exit 2
|
||||
exit
|
||||
fi
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
pkgs.marksman
|
||||
pkgs.ripgrep
|
||||
pkgs.ncurses
|
||||
pkgs.git
|
||||
];
|
||||
text = builtins.readFile ../../scripts/note.sh;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue