From d38565f6aecc181ce4fec2720c4196fe12bae4c9 Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Fri, 22 Oct 2021 11:22:23 -0400 Subject: [PATCH] Add todo dmenu wrapper script --- Makefile | 6 +++++- todo | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 todo diff --git a/Makefile b/Makefile index 893c0cf..c0c4d15 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/todo b/todo new file mode 100755 index 0000000..6f18d8b --- /dev/null +++ b/todo @@ -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