diff options
author | makefu <github@syntax-fehler.de> | 2017-09-29 21:28:23 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2017-09-29 21:28:23 +0200 |
commit | c352397385d5e7cbf2095ead0aa4a74be116da34 (patch) | |
tree | 72a730cb2b451b5700a8eaf9420b4bd46f513ba9 /tv/5pkgs/simple/q/default.nix | |
parent | 9d9e9bc3d8087974370e3d62bc05d2332b2efab2 (diff) | |
parent | 37951eed3dd7806f73c40c47ec9cd047ad76c15d (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'tv/5pkgs/simple/q/default.nix')
-rw-r--r-- | tv/5pkgs/simple/q/default.nix | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tv/5pkgs/simple/q/default.nix b/tv/5pkgs/simple/q/default.nix index 2e7aa5cf2..655c75e1b 100644 --- a/tv/5pkgs/simple/q/default.nix +++ b/tv/5pkgs/simple/q/default.nix @@ -262,7 +262,7 @@ let ''; q-todo = '' - TODO_file=$HOME/TODO + TODO_file=$PWD/TODO if test -e "$TODO_file"; then ${pkgs.coreutils}/bin/cat "$TODO_file" \ | ${pkgs.gawk}/bin/gawk -v now=$(${pkgs.coreutils}/bin/date +%s) ' @@ -294,13 +294,7 @@ in pkgs.writeBashBin "q" '' set -eu export PATH=/var/empty - (${q-todo}) || : - if [ "$PWD" != "$HOME" ]; then - (HOME=$PWD; ${q-todo}) || : - fi - echo ${q-cal} - echo ${q-isodate} ${q-sgtdate} (${q-gitdir}) & @@ -311,4 +305,14 @@ pkgs.writeBashBin "q" '' (${q-online}) & (${q-thermal_zone}) & wait + if test "$PWD" != "$HOME" && test -e "$HOME/TODO"; then + TODO_home_entries=$(cd; (${q-todo}) | ${pkgs.coreutils}/bin/wc -l) + if test "$TODO_home_entries" = 1; then + TODO_format='There is %d entry in ~/TODO' + else + TODO_format='There are %d entries in ~/TODO' + fi + printf "\x1b[38;5;238m$TODO_format\x1b[m\n" "$TODO_home_entries" + fi + (${q-todo}) || : '' |