Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # author: 3ED
- # verion: 20100110
- # filename: xset_dpms_with_cmd
- # example usage: xset_dpms_with_cmd standby gnome-screensaver-command -l
- if [ -z "$1" ]; then
- echo "Usage: $0 <mode> [cmd] [cmd-args]"
- echo
- echo "Posible modes : standby, suspend, off, on"
- echo "Example cmd : gnome-scrensaver-command -l"
- exit 0
- else
- xset_dpms_MODE="$1"
- fi
- if [ ! -z "$2" ]; then
- if xset_dpms_RUN="`which "$2" 2> /dev/null`"; then
- shift 2
- $xset_dpms_RUN "$@" &
- else
- echo "Command: $2 not found"
- exit 1
- fi
- fi
- sleep 0.25
- xset dpms force $xset_dpms_MODE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement