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.

30 lines
510 B

  1. #!/bin/sh
  2. icon=
  3. now=$(date '+%s')
  4. if [ ! -f "$XDG_RUNTIME_DIR/timer" ]; then
  5. end=0
  6. else
  7. content=$(cat "$XDG_RUNTIME_DIR/timer")
  8. if [ -z "$content" ]; then
  9. end=0
  10. else
  11. end="$content"
  12. fi
  13. fi
  14. if [ $end != 0 ]; then
  15. if [ $now -ge $end ]; then
  16. canberra-gtk-play -i alarm-clock-elapsed -V 10
  17. echo "" > "$XDG_RUNTIME_DIR/timer"
  18. else
  19. diff=$(expr $end - $now)
  20. str=$(date -ud @$diff '+%H:%M:%S' | sed 's/^00://g')
  21. echo "^c#a48ead^$icon ^d^ $str"
  22. fi
  23. else
  24. echo "^c#a48ead^$icon ^d^ NONE"
  25. fi