From 1fe0a9419290219dec4ea89c7b5e7052d7c19e18 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 24 Jun 2021 01:12:24 +0200 Subject: tv xtoggledpms: init --- tv/5pkgs/simple/xtoggledpms.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tv/5pkgs/simple/xtoggledpms.nix (limited to 'tv/5pkgs/simple') 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 +'' -- cgit v1.2.3