]> git.wh0rd.org - home.git/blobdiff - .bin/redshift-check
flac2mp3: handle cli options
[home.git] / .bin / redshift-check
index 4cf84a39a874c5233e12481f13c698f6ef76d0da..9481c09d8a4fe0fbb059f173df666d9cd85c56c1 100755 (executable)
@@ -5,7 +5,7 @@ usage() {
        Usage: ${0##*/} [options]
 
        Options:
-         --reset    reset display to no redshift
+         -x, --reset    reset display to no redshift
        EOF
 
        if [[ $# -eq 0 ]] ; then
@@ -16,13 +16,17 @@ usage() {
        fi
 }
 
+rs() {
+       exec redshift -m randr "$@"
+}
+
 main() {
-       cd
+       cd /
        export DISPLAY=:0
 
        while [[ $# -gt 0 ]] ; do
                case $1 in
-               --reset) exec redshift -x ;;
+               -x|--reset) rs -x ;;
                -h|--help) usage ;;
                *) usage "Unknown option: $1" ;;
                esac
@@ -50,9 +54,9 @@ main() {
 
        t=${temps[${h}]}
        if [[ -z ${t} ]]; then
-               exec redshift -x
+               rs -x
        else
-               exec redshift -O ${t}k
+               rs -O ${t}k
        fi
 }
 main "$@"