From 0fbe88364f9eb0a1689f5421476a2796ff291082 Mon Sep 17 00:00:00 2001 From: Xavi Garcia Mena Date: Wed, 30 Mar 2016 15:09:04 +0200 Subject: [PATCH] Changing upower configuration to use percentages and poweroff the device when the critical battery level has been reached --- .../hooks/50-upower-poweroff-percentages.chroot | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 live-build/ubuntu-touch/hooks/50-upower-poweroff-percentages.chroot diff --git a/live-build/ubuntu-touch/hooks/50-upower-poweroff-percentages.chroot b/live-build/ubuntu-touch/hooks/50-upower-poweroff-percentages.chroot new file mode 100755 index 00000000..e39a91eb --- /dev/null +++ b/live-build/ubuntu-touch/hooks/50-upower-poweroff-percentages.chroot @@ -0,0 +1,10 @@ +#! /bin/sh + +set -e + +echo "Updating upower configuration..." + +sed -i 's/^UsePercentageForPolicy=.*/UsePercentageForPolicy=true/' /etc/UPower/UPower.conf +sed -i 's/^CriticalPowerAction=.*/CriticalPowerAction=PowerOff/' /etc/UPower/UPower.conf + +