Sophie Hirn 2 years ago
parent
commit
79b71c04fc
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      prim/.bashrc.d/92-todo.sh

+ 11
- 5
prim/.bashrc.d/92-todo.sh View File

@@ -7,12 +7,18 @@ alias todo="$ex"

if [ -n "$ex" ] && [ -e "$HOME/.config/todo" ] && [ -z "$BASHRC_NOFANCIES" ]; then
if [ -e "$HOME/user.png" ] && which tiv >/dev/null 2>&1; then
h="$(($(tput lines) - 20))"
w="$(($(tput cols) - 1))"
w2="$((w / 2))"
test "$w2" -ge 80 || w2=80
w1="$((w - w2))"
h="$(tiv -w "$w1" "$HOME/user.png" | wc -l)"
paste --delimiters=' ' <(tiv -w "$w1" "$HOME/user.png") <(TODO_WIDTH="$w2" "$ex" overview | head -n "$h")
wi="$((h * 2))"
wt="$((w - wi))"
if [ "$wt" -lt 80 ]; then
wt=80
wi="$((w - wt))"
fi
paste \
<(tiv -w "$wi" "$HOME/user.png") \
<(TODO_WIDTH="$wt" "$ex" overview) \
| column --separator $'\t' --output-separator=' ' --table
echo
else
"$ex" overview

Loading…
Cancel
Save