This commit is contained in:
q3aql 2025-09-03 18:24:36 +02:00
parent 96d2769be7
commit aa4c8d3193
5 changed files with 32 additions and 2 deletions

View 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

View File

@ -9,7 +9,8 @@ while [ ${status_bar} -eq 0 ] ; do
meminfo=$(~/.config/sway/scripts/mem_info.sh)
volume=$(~/.config/sway/scripts/get_volume.sh)
lang=$(~/.config/sway/scripts/get_lang.sh)
battery=$(~/.config/sway/scripts/battery.sh)
date=$(~/.config/sway/scripts/current_date.sh)
echo "${updates} ${kernel} ${cpuinfo} ${meminfo} ${volume} ${lang} ${date}"
echo "${updates} ${kernel} ${cpuinfo} ${meminfo} ${volume} ${lang} ${battery} ${date}"
sleep 2
done

View File

@ -2,7 +2,7 @@
"position": "top", // Waybar position (top|bottom|left|right)
"height": 28, // Waybar height (to be removed for auto height)
"modules-left": ["custom/desktop-icon", "sway/workspaces"],
"modules-right": ["custom/checkupdates", "custom/kernel", "custom/cpu", "custom/memory", "custom/getvolume", "custom/language", "custom/currentdate", "tray"],
"modules-right": ["custom/checkupdates", "custom/kernel", "custom/cpu", "custom/memory", "custom/getvolume", "custom/language", "custom/battery", "custom/currentdate", "tray"],
"sway/workspaces": {
"all-outputs": false,
@ -81,6 +81,12 @@
"exec": "~/.config/waybar/scripts/disk_info.sh",
},
"custom/battery": {
"format": "{}",
"interval": 10,
"exec": "~/.config/waybar/scripts/battery.sh",
},
"tray": {
// "icon-size": 21,
"spacing": 5

View 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

View File

@ -91,6 +91,11 @@ window#waybar.chromium {
margin: 0 1px;
}
#custom-battery {
color: #62bbfa;
margin: 0 1px;
}
#custom-cpu {
color: #d26bff;
margin: 0 1px;