mirror of
https://github.com/artizirk/dotfiles.git
synced 2026-10-31 21:54:56 +02:00
Show battery charge icon in statusbar
This commit is contained in:
1 parent
7f00b7347c
commit
0397c80da6
1 file changed
+13
-10
+13
-10
@@ -6,7 +6,7 @@ print_dev_status() {
|
||||
status=$(busctl get-property org.freedesktop.UPower $dev_path org.freedesktop.UPower.Device State | cut -d' ' -f2)
|
||||
charge_f=$(busctl get-property org.freedesktop.UPower $dev_path org.freedesktop.UPower.Device Percentage | cut -d' ' -f2)
|
||||
|
||||
echo -e "$charge_f %"
|
||||
printf '%s%% ' "$charge_f"
|
||||
}
|
||||
|
||||
print_dev_status '/org/freedesktop/UPower/devices/DisplayDevice'
|
||||
@@ -25,15 +25,18 @@ print_dev_status '/org/freedesktop/UPower/devices/DisplayDevice'
|
||||
|
||||
#printf ' '
|
||||
|
||||
#if [[ "$status" == '1' ]]; then
|
||||
# printf '\uf106'
|
||||
#elif [[ "$status" == '2' ]]; then
|
||||
# printf '\uf107'
|
||||
#elif [[ "$status" == '4' ]]; then
|
||||
# printf '\uf0e7'
|
||||
#else
|
||||
# printf '[%s]' "$status"
|
||||
#fi
|
||||
if [[ "$status" == '1' ]]; then
|
||||
printf '\uf106'
|
||||
elif [[ "$status" == '2' ]]; then
|
||||
printf '\uf107'
|
||||
elif [[ "$status" == '4' ]]; then
|
||||
printf '\uf0e7'
|
||||
elif [[ "$status" == '5' ]]; then
|
||||
printf '\uf1e6'
|
||||
else
|
||||
printf '[%s]' "$status"
|
||||
fi
|
||||
echo
|
||||
|
||||
#printf ' '
|
||||
|
||||
|
||||
Reference in new issue
Block a user