mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-12 17:58:50 +01:00
add lowpower.sh
This commit is contained in:
parent
425cb66d6f
commit
52bc2bed04
1
sys.py/gsnotify/Jobs/00_lowpower.alias
Normal file
1
sys.py/gsnotify/Jobs/00_lowpower.alias
Normal file
@ -0,0 +1 @@
|
||||
Low Battery Warning
|
||||
17
sys.py/gsnotify/Jobs/00_lowpower.sh
Normal file
17
sys.py/gsnotify/Jobs/00_lowpower.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
BAT_PNT=`upower -i $(upower -e | grep 'battery') | grep -E "state|to\ full|percentage" | awk '/perc/{print $2}' | cut -d % -f1 `
|
||||
|
||||
if [ "$BAT_PNT" -lt "20" ]; then
|
||||
|
||||
if [ "$BAT_PNT" -lt "10" ]; then
|
||||
echo '{"type":"once","content":"Low Battery: 10% of battery remaining"}'
|
||||
fi
|
||||
|
||||
if [ "$BAT_PNT" -lt "5" ]; then
|
||||
echo '{"type":"once","content":"Low Battery: 10% of battery remaining"}'
|
||||
fi
|
||||
|
||||
else
|
||||
echo $BAT_PNT
|
||||
fi
|
||||
Loading…
x
Reference in New Issue
Block a user