Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
545 B

  1. #!/bin/sh
  2. function menu {
  3. dmenu -i -l 20 $@
  4. }
  5. function refresh {
  6. echo "refresh"
  7. }
  8. current=$(hamster current)
  9. # choose an action
  10. if [ "No activity" = "$current" ]; then
  11. action="start"
  12. else
  13. action=$(echo -e -n "start\nstop $current" | menu -p Action)
  14. fi
  15. [ -z "$action" ] && exit 1
  16. case "$action" in
  17. start)
  18. activity=$(hamster activities | menu -p Start)
  19. [ -z "$activity" ] && exit 1
  20. hamster start $activity
  21. notify-send "Started $activity"
  22. refresh
  23. ;;
  24. stop*)
  25. hamster stop
  26. notify-send "Stopped $current"
  27. refresh
  28. ;;
  29. esac