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.

23 lines
568 B

  1. #!/bin/sh
  2. if [ ! -f $XDG_RUNTIME_DIR/timer ] || [ -z $(cat $XDG_RUNTIME_DIR/timer) ]; then
  3. duration="$(printf "" | dmenu -p "Please enter duration:")"
  4. [ -z "$duration" ] && exit 1
  5. timestamp="$(date -d "$duration" '+%s')"
  6. [ -z "$timestamp" ] && notify-send -a "Timer utility" "Time format not recognized" && exit 1
  7. printf "$timestamp" > $XDG_RUNTIME_DIR/timer
  8. else
  9. operation=$(printf "Cancel" | dmenu -p "Please select action:")
  10. case $operation in
  11. Cancel)
  12. echo "" > $XDG_RUNTIME_DIR/timer
  13. ;;
  14. esac
  15. fi
  16. kill -64 $(pidof dwmblocks)