todo-txt: init

inky
Elnu 2 years ago
parent 18f3d245bb
commit 1c1b5256b9

@ -18,6 +18,7 @@ in
../modules/rofi
../modules/startpage
../modules/terminal
../modules/todo-txt
];
home.file."./.background-image".source = theme.wallpaper;

@ -0,0 +1,31 @@
{ pkgs, ... }:
{
home = {
packages = with pkgs; [
todo-txt-cli
#todofi-sh
];
file = let
todoDir = ".todo";
actionsDir = "${todoDir}/actions";
in {
".config/todo/config".text = ''
export TODO_DIR=~/${todoDir}
export TODO_ACTIONS_DIR=~/${actionsDir}
'';
"${actionsDir}/pri" = {
source = ./pri.sh;
executable = true;
};
"${actionsDir}/p" = {
source = ./p.sh;
executable = true;
};
};
};
programs = {
bash.shellAliases.t = "todo.sh";
neovim.plugins = with pkgs.vimPlugins; [ todo-txt-vim ];
};
}

@ -0,0 +1 @@
todo.sh pri $2 $3

@ -0,0 +1,12 @@
ITEMS=$2
PRIORITY=$3
if [[ $ITEMS =~ ^([0-9]+)-([0-9]+)$ ]]; then
START=${BASH_REMATCH[1]}
END=${BASH_REMATCH[2]}
for i in $(seq $START $END); do
todo.sh command pri $i $PRIORITY || break
done
else
todo.sh command pri $ITEMS $PRIORITY
fi
Loading…
Cancel
Save