mirror of
https://github.com/DO1JLR/ansible_linux_desktop_setup.git
synced 2024-09-14 19:54:51 +02:00
11 lines
600 B
Bash
11 lines
600 B
Bash
#!/bin/bash
|
|
|
|
power="$((`cat /sys/class/power_supply/BAT0/energy_now` * 100 / `cat /sys/class/power_supply/BAT0/energy_full_design`))"
|
|
|
|
if (( $power < 15 && $power > 9 )); then
|
|
zenity --warning --title="Low Power" --text="$power percent remaining.\n\nPlease recharge soon!" --display=:0.0
|
|
elif (( $power < 9 && $power > 5 )); then
|
|
zenity --warning --title="Critical Power" --text="$power percent remaining.\n\nPlease recharge NOW!" --display=:0.0
|
|
elif (( $power < 5 )); then
|
|
zenity --warning --title="Critical Power" --text="$power percent remaining.\n\nRECHARGE!\nNOW!" --display=:0.0
|
|
fi
|