Create scripts to add to and edit daily todo files
All checks were successful
/ check (push) Successful in 1m21s

This commit is contained in:
Oliver Davies 2025-05-14 22:46:00 +01:00
parent 3a8388b09f
commit 24fc8e6845
7 changed files with 66 additions and 0 deletions

View file

@ -12,6 +12,8 @@ in
displayselect = callPackage ./displayselect { };
notes = callPackage ./notes { };
passmenu-otp = callPackage ./passmenu-otp.nix { };
todos-add = callPackage ./todos/todos-add.nix { };
todos-edit = callPackage ./todos/todos-edit.nix { };
tmux-sessionizer = callPackage ./tmux-sessionizer { };
upload-to-files = callPackage ./upload-to-files.nix { };

13
pkgs/todos/todos-add.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
pkgs.writeShellApplication {
name = "todos-add";
text = ''
TODOS_DIRECTORY="''${TODOS_DIRECTORY:-"$XDG_DOCUMENTS_DIR/todos"}"
export TODOS_DIRECTORY
echo "$*" >> "$TODOS_DIRECTORY/$(date +%Y-%m-%d).txt"
'';
}

12
pkgs/todos/todos-edit.nix Normal file
View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
pkgs.writeShellApplication {
name = "todos-edit";
text = ''
TODOS_DIRECTORY="''${TODOS_DIRECTORY:-"$XDG_DOCUMENTS_DIR/todos"}"
export TODOS_DIRECTORY
"$EDITOR" "$TODOS_DIRECTORY/$(date +%Y-%m-%d).txt";
'';
}