From 9a34aea1a07e6a50d2f1b90c1dc2b3c3748db453 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 10 Nov 2016 20:50:38 +0100 Subject: tv q power_supply: try not to die --- tv/5pkgs/q/default.nix | 97 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 74 insertions(+), 23 deletions(-) diff --git a/tv/5pkgs/q/default.nix b/tv/5pkgs/q/default.nix index 7e2a30c3e..a3a7cd739 100644 --- a/tv/5pkgs/q/default.nix +++ b/tv/5pkgs/q/default.nix @@ -84,11 +84,18 @@ let eval "$(${pkgs.gnused}/bin/sed -n ' s/^\([A-Z_]\+=[0-9A-Za-z_-]*\)$/export \1/p ' $uevent)" - if test "x''${POWER_SUPPLY_CHARGE_NOW-}" = x; then - exit # not battery - fi + case $POWER_SUPPLY_NAME in + AC) + exit # not battery + ;; + esac exec