diff options
author | tv <tv@krebsco.de> | 2021-06-24 01:12:24 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2021-06-24 01:12:24 +0200 |
commit | 1fe0a9419290219dec4ea89c7b5e7052d7c19e18 (patch) | |
tree | 36dd7a67ecc7f89bc900ef9fec99f0d1617b96e0 /tv | |
parent | 6c1f1c26e7a5e2d11cc8a1d43d86568c760af526 (diff) |
tv xtoggledpms: init
Diffstat (limited to 'tv')
-rw-r--r-- | tv/5pkgs/simple/xtoggledpms.nix | 16 |
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 +'' |