.config/i3/scripts/battery.sh
This commit is contained in:
parent
2ea4fbfc60
commit
fd2bf4de2b
9
.config/i3/scripts/battery.sh
Executable file
9
.config/i3/scripts/battery.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
detect_battery=$(upower -e | grep "battery_BAT" | head -1)
|
||||
if [ ! -z "${detect_battery}" ] ; then
|
||||
battery=$(upower -i ${detect_battery} | grep -E "percentage" | awk '{print $2}')
|
||||
echo " ${battery} "
|
||||
else
|
||||
echo " "
|
||||
fi
|
@ -9,7 +9,8 @@ while [ ${status_bar} -eq 0 ] ; do
|
||||
meminfo=$(~/.config/i3/scripts/mem_info.sh)
|
||||
volume=$(~/.config/i3/scripts/get_volume.sh)
|
||||
lang=$(~/.config/i3/scripts/get_lang.sh)
|
||||
battery=$(~/.config/i3/scripts/battery.sh)
|
||||
date=$(~/.config/i3/scripts/current_date.sh)
|
||||
echo "${updates} ${kernel} ${cpuinfo} ${meminfo} ${volume} ${lang} ${date}"
|
||||
echo "${updates} ${kernel} ${cpuinfo} ${meminfo} ${volume} ${lang} ${battery} ${date}"
|
||||
sleep 2
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user