diff options
author | lassulus <lassulus@lassul.us> | 2021-07-27 23:33:32 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-07-27 23:33:32 +0200 |
commit | d14077b06e82d7e4beb078d781a312c84f0a16db (patch) | |
tree | 54e24720d18bfccbb638e10ab8076a5b9763addf /tv/5pkgs/simple | |
parent | 1380200b30f2fd1dfce55a2ba28dc256fef951c6 (diff) | |
parent | 34c7d727afd14a82330dd6e53dee3591f01a5462 (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'tv/5pkgs/simple')
-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 +'' |