wtf: add taskweek with upcoming events

This commit is contained in:
Ingolf Wagner 2020-01-07 15:44:59 +13:00
parent 7b319051db
commit c7ee7d395a
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -3,6 +3,14 @@ let
unstable = import <nixpkgs-unstable> { }; unstable = import <nixpkgs-unstable> { };
taskNextWeek = pkgs.writers.writeDash "taskweek" ''
${pkgs.taskwarrior}/bin/task \
export \
status:pending and \( due.before:6days \) \
| ${pkgs.jq}/bin/jq '[.[] | { Day: .due, ID: .id, Description: .description | sub("\n.*";"")} ] | sort_by(.Day)' \
| ${pkgs.miller}/bin/mlr --ijson --opprint put '$Day = strftime(strptime($Day,"%Y%m%dT%H%M%SZ")'$(date +%z)'00,"%a")'
'';
activeTasks = pkgs.writers.writeBash "active-tasks" '' activeTasks = pkgs.writers.writeBash "active-tasks" ''
${pkgs.taskwarrior}/bin/task export +checklist status:pending +READY | \ ${pkgs.taskwarrior}/bin/task export +checklist status:pending +READY | \
${pkgs.jq}/bin/jq \ ${pkgs.jq}/bin/jq \
@ -120,7 +128,7 @@ let
}; };
grid = { grid = {
columns = [ 33 40 36 0 ]; columns = [ 33 12 28 36 0 ];
rows = [ 9 3 7 6 0 ]; rows = [ 9 3 7 6 0 ];
}; };
@ -141,6 +149,7 @@ let
top = resourceusage { top = resourceusage {
top = 0; top = 0;
left = 1; left = 1;
width = 2;
}; };
power = power { power = power {
@ -155,11 +164,12 @@ let
title = "rates"; title = "rates";
rates.NZD = [ "EUR" ]; rates.NZD = [ "EUR" ];
rates.EUR = [ "NZD" ]; rates.EUR = [ "NZD" ];
refreshInterval = 3600;
}; };
weather = prettyweather { weather = prettyweather {
top = 0; top = 0;
left = 2; left = 3;
}; };
calendar = cmdRunner { calendar = cmdRunner {
@ -169,7 +179,7 @@ let
top = 1; top = 1;
left = 1; left = 1;
height = 2; height = 2;
width = 2; width = 3;
refreshInterval = 3600; refreshInterval = 3600;
}; };
@ -179,14 +189,14 @@ let
top = 3; top = 3;
left = 1; left = 1;
height = 1; height = 1;
width = 2; width = 3;
}; };
active-users = cmdRunner { active-users = cmdRunner {
title = "users"; title = "users";
cmd = activeUsers; cmd = activeUsers;
top = 0; top = 0;
left = 3; left = 4;
height = 4; height = 4;
width = 1; width = 1;
refreshInterval = 30; refreshInterval = 30;
@ -196,9 +206,19 @@ let
title = "active tasks"; title = "active tasks";
cmd = activeTasks; cmd = activeTasks;
top = 4; top = 4;
left = 2;
height = 1;
width = 3;
refreshInterval = 60;
};
next-week-tasks = cmdRunner {
title = "upcoming";
cmd = taskNextWeek;
top = 4;
left = 0; left = 0;
height = 1; height = 1;
width = 4; width = 2;
refreshInterval = 60; refreshInterval = 60;
}; };
}; };