dotfiles

configurations and scripts
git clone https://riazj.com/git/dotfiles
Log | Files | Refs | README | LICENSE

todo (329B)


      1 #!/bin/sh
      2 
      3 TODO="$HOME/todo"
      4 height="$(wc -l "$TODO")"
      5 height="${height% *}"
      6 
      7 while sel="$(dmenu -i -l "$height" < "$TODO")"; do
      8   if grep -Fqx "$sel" "$TODO"; then
      9     grep -vFx "$sel" "$TODO" > "$TODO.tmp"
     10     mv "$TODO.tmp" "$TODO"
     11     height=$((height-1))
     12   else
     13     echo "$sel" >> "$TODO"
     14     height=$((height+1))
     15   fi
     16 done