Add todo dmenu wrapper script

This commit is contained in:
Tyler Perkins 2021-10-22 11:22:23 -04:00
parent a18dff8441
commit d38565f6ae
2 changed files with 30 additions and 1 deletions

View File

@ -10,9 +10,13 @@ INSTALL_DIR="$${HOME}/.local/bin"
#INSTALL_DIR="/usr/bin"
install :
cp t* $(INSTALL_DIR)/
cp tpeek tpop tpush $(INSTALL_DIR)/
install_dmenu :
cp todo $(INSTALL_DIR)/
uninstall :
rm $(INSTALL_DIR)/tpeek
rm $(INSTALL_DIR)/tpop
rm $(INSTALL_DIR)/tpush
rm -f $(INSTALL_DIR)/todo

25
todo Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
td_push(){
tpush $1
}
td_pop(){
notify-send "stackToDo" "Poped $(tpop)"
}
td_peek(){
notify-send "stackToDo" "Top of Stack: $(tpeek)"
}
#prompt user
result=$(printf "push\npop\npeek" | dmenu -p "todo >")
cmd=${result%% *}
case $cmd in
"push") td_push "$(echo $result | cut -d ' ' -f 2-)";;
"pop") td_pop ;;
"peek") td_peek ;;
*) notify-send "stackToDo" "Invalid command" ;;
esac