summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-02-21 16:15:02 -0500
committerJesse Luehrs <doy@tozt.net>2021-02-21 16:15:02 -0500
commitec9ed37dd9af16904bf433a4d7e28816736943c0 (patch)
tree4166c679d1848af40075712b86819633d3e814d0 /bin
parent67cd4811967bae3c8962f1196c8c4ada8ac582df (diff)
downloadconf-ec9ed37dd9af16904bf433a4d7e28816736943c0.tar.gz
conf-ec9ed37dd9af16904bf433a4d7e28816736943c0.zip
command for setting screen saver state
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hush/sc19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/hush/sc b/bin/hush/sc
new file mode 100755
index 0000000..d86b917
--- /dev/null
+++ b/bin/hush/sc
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+case "$1" in
+ on)
+ xset s 300 5
+ xset dpms 600 600 600
+ ;;
+ off)
+ xset s off
+ xset dpms 0 0 0
+ ;;
+ q)
+ xset q | perl -nlE'print if ((/^(:?Screen Saver|DPMS)/.../^[^\s]/) && /^(:?Screen Saver|DPMS|\s)/)'
+ ;;
+ *)
+ echo "$(basename "$0"): unknown argument '$1'" >&2
+ exit 1
+ ;;
+esac