all repos — dotfiles @ 4cb58154e8c232c1b180ca666cb0b77adf55ee62

linux dotfiles

bin/scripts/note

#!/bin/sh

remind_path=$HOME/.config/note
dmenu_cmd="dmenu -l 20 -h 23"

if [ $# -eq 0 ]; then
    output=$(cat $remind_path | $dmenu_cmd)
    [ $? -ne 0 ] && exit;
fi

case $output in
    +) echo -n "" | dmenu -nb "#000" -sb "#FFF"\
        -sf "#000" -h 23 -p note >> $remind_path;;
    *) ans=$(echo -e "no\nyes" | dmenu -h 23 -p "Delete?")
       if [ $ans = "yes" ]; then
           sed -i "/$output/d" $remind_path
       else
           exit 0
       fi;;
esac