summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/simple/q
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-09-20 12:15:54 +0200
committerlassulus <lassulus@lassul.us>2017-09-20 12:15:54 +0200
commit2d9c74b4f3fa760c4be9c754abf94e24c27eb70c (patch)
tree4140680e93cb9e09b772a4212b460974c962eaf7 /tv/5pkgs/simple/q
parentdcde03342c040ca00f2b80ca4d1c3bb68844b105 (diff)
parent6fed88c5611f71726c82af93d0df0ac4112e9814 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'tv/5pkgs/simple/q')
-rw-r--r--tv/5pkgs/simple/q/default.nix18
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}) || :
''