summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/simple/xtoggledpms.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tv/5pkgs/simple/xtoggledpms.nix')
-rw-r--r--tv/5pkgs/simple/xtoggledpms.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/tv/5pkgs/simple/xtoggledpms.nix b/tv/5pkgs/simple/xtoggledpms.nix
new file mode 100644
index 000000000..d164ad712
--- /dev/null
+++ b/tv/5pkgs/simple/xtoggledpms.nix
@@ -0,0 +1,16 @@
+{ pkgs }:
+
+let
+ grep = "${pkgs.gnugrep}/bin/grep";
+ xset = "${pkgs.xorg.xset}/bin/xset";
+in
+
+pkgs.writeDashBin "xtoggledpms" ''
+ # usage: xtoggledpms
+ set -efu
+ if ${xset} q | ${grep} -qF 'DPMS is Disabled'; then
+ ${xset} dpms force off
+ else
+ ${xset} s off -dpms
+ fi
+''