osd-sleep 515 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. case "$1" in
  3. -h | --help)
  4. echo 'Usage: osd-sleep [TIME]
  5. Set sleep TIME and display it in OSD.
  6. Without arguments, show the current sleep time.
  7. TIME can have one of the following forms:
  8. "18": set time to 18 minutes;
  9. "+3": add 3 minutes to the current sleep time;
  10. "-5": subtract 5 minutes from the current sleep time.'
  11. exit 0 ;;
  12. *)
  13. if [[ -z "$1" ]]; then
  14. gdpipe "(osd-sleep)"
  15. else
  16. gdpipe "(osd-sleep \"$1\")"
  17. fi
  18. ;;
  19. esac