Created
March 29, 2016 08:06
Revisions
-
leafo created this gist
Mar 29, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/bin/sh function menu { dmenu -i -l 20 -fn 'Terminus-16' $@ } function refreshawesome { echo 'require("leaf.status").refresh()' | awesome-client } current=$(hamster current) # choose an action if [ "No activity" = "$current" ]; then action="start" else action=$(echo -e -n "start\nstop $current" | menu -p Action) fi [ -z "$action" ] && exit 1 case "$action" in start) activity=$(hamster activities | menu -p Start) [ -z "$activity" ] && exit 1 hamster start "$activity" notify-send "Started $activity" refreshawesome ;; stop*) hamster stop notify-send "Stopped $current" refreshawesome ;; esac