tv xtoggledpms: init

This commit is contained in:
tv 2021-06-24 01:12:24 +02:00
parent 6c1f1c26e7
commit 1fe0a94192

View File

@ -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
''