summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-11-07 01:16:11 +0100
committertv <tv@krebsco.de>2016-11-07 01:17:39 +0100
commit67f68fe7ea55b57c5a3e69470266386549709787 (patch)
tree86bf578d4bd749e4dc48c204c57c3a4d9c41ed71
parentc8068a7c5027a94ca8480f94c6a31a5663c6106a (diff)
tv q: add intel_backlight
-rw-r--r--tv/5pkgs/q/default.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/tv/5pkgs/q/default.nix b/tv/5pkgs/q/default.nix
index 016da4405..7e2a30c3e 100644
--- a/tv/5pkgs/q/default.nix
+++ b/tv/5pkgs/q/default.nix
@@ -62,6 +62,21 @@ let
fi
'';
+ q-intel_backlight = ''
+ cd /sys/class/backlight/intel_backlight
+ </dev/null exec ${pkgs.gawk}/bin/awk '
+ END {
+ getline actual_brightness < "actual_brightness"
+ getline max_brightness < "max_brightness"
+ getline brightness < "brightness"
+ printf "intel_backlight %d%% %d/%d\n" \
+ , actual_brightness / max_brightness * 100 \
+ , actual_brightness \
+ , max_brightness
+ }
+ '
+ '';
+
q-power_supply = let
power_supply = pkgs.writeBash "power_supply" ''
set -efu
@@ -218,6 +233,7 @@ pkgs.writeBashBin "q" ''
${q-isodate}
${q-sgtdate}
(${q-gitdir}) &
+ (${q-intel_backlight}) &
(${q-power_supply}) &
(${q-virtualization}) &
(${q-wireless}) &