commit e62ea5e97f3f94505e6db0ade5557ea228b1f135 parent 7ec639705b562d23beb4b0f7d0ea3e3845e71557 Author: clamiax <smoppy@gmail.com> Date: Sun, 20 Sep 2015 14:11:34 +0200 Make warning() works from crontab. Diffstat:
M | acpi | | | 5 | ++++- |
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/acpi b/acpi @@ -7,8 +7,11 @@ ACPLUGGED="$(cat $(du -a /sys/devices |grep 'AC0/online' |awk '{print $2}'))" LIDSTATE="$(cat /proc/acpi/button/lid/LID/state |awk '{print $2}')" warning() { + pct="$1" L=" OK " - xmessage -center -buttons "$L" -default "$L" "WARNING: battery level is ${t}%" & + + export DISPLAY=:0 + xmessage -center -buttons "$L" -default "$L" "WARNING: battery level is ${pct}%" & for i in $(seq 3) do