diff --git a/home/programs/default.nix b/home/programs/default.nix index 000eb0e..9b3bf35 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -23,6 +23,7 @@ ./skanlite.nix ./spotify.nix ./swww + ./taskwarrior ./thunderbird.nix ./vlc.nix ./vscode.nix diff --git a/home/programs/taskwarrior/catppuccin.theme b/home/programs/taskwarrior/catppuccin.theme new file mode 100644 index 0000000..b122fc1 --- /dev/null +++ b/home/programs/taskwarrior/catppuccin.theme @@ -0,0 +1,76 @@ +# Theme colors for catppuccin + +# General decoration +color.label=magenta +color.label.sort=magenta +color.alternate= +color.header=cyan +color.footnote=yellow +color.warning=bold red +color.error=white on red +color.debug=blue + +# Task state +color.completed=black +color.deleted=red +color.active=green +color.recurring=blue +color.scheduled=white on green +color.until=yellow +color.blocked=black on white +color.blocking=black on bright white + +# Project +color.project.none=red + +# Priority +color.uda.priority.H=bold white +color.uda.priority.M=white +color.uda.priority.L= + +# Tags +color.tag.next=bold yellow +color.tag.none= +color.tagged= + +# Due +color.due=red +color.due.today=red +color.overdue=bold red + +# UDA +#color.uda.X= + +# Report: burndown +color.burndown.done=on green +color.burndown.pending=on magenta +color.burndown.started=on blue + +# Report: history +color.history.add=black on blue +color.history.delete=black on red +color.history.done=black on green + +# Report: summary +color.summary.background= +color.summary.bar=black on green + +# Command: calendar +color.calendar.due=red +color.calendar.due.today=underline bold red +color.calendar.holiday=black on bright yellow +color.calendar.overdue=bold white on bright red +color.calendar.scheduled=green +color.calendar.today=black on cyan +color.calendar.weekend=black +color.calendar.weeknumber=bold blue + +# Command: sync +color.sync.added=green +color.sync.changed=yellow +color.sync.rejected=red + +# Command: undo +color.undo.after=green +color.undo.before=red + diff --git a/home/programs/taskwarrior/default.nix b/home/programs/taskwarrior/default.nix new file mode 100644 index 0000000..8afb8ea --- /dev/null +++ b/home/programs/taskwarrior/default.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ + timewarrior + tasksh + taskopen + # syncall + taskwarrior-tui + ]; + + programs.taskwarrior = { + enable = true; + colorTheme = ./catppuccin.theme; + package = pkgs.taskwarrior3; + }; + + home.file.".local/share/task/hooks/on-modify.timewarrior" = { + executable = true; + source = "${pkgs.timewarrior}/share/doc/timew/ext/on-modify.timewarrior"; + }; + + # TODO: This need the python package timew-report, pyfzf and plumbum + # home.file.".config/timewarrior/extensions/twfzf.py" = { + # source = builtins.fetchurl { + # url = "https://raw.githubusercontent.com/oivvio/timew-fzf/refs/heads/main/twfzf.py"; + # sha256 = "0hrxz8bkvw3i6r4li829f60wzvgj8fqzv706gvlj66lad5fa5gdb"; + # }; + # executable = true; + # }; +} diff --git a/home/programs/taskwarrior/hooks/on-add.sh b/home/programs/taskwarrior/hooks/on-add.sh new file mode 100755 index 0000000..95c5e36 --- /dev/null +++ b/home/programs/taskwarrior/hooks/on-add.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +read -r json +project=$(echo "$json" | jq -r '.project // empty') +[[ -n "$project" ]] && parent=$(echo "$project" | cut -d. -f1 || echo "$project") || parent="" +echo "$json" | jq -c --arg p "$parent" '.parentName = $p'