.config
This commit is contained in:
parent
96d2769be7
commit
aa4c8d3193
9
.config/sway/scripts/battery.sh
Executable file
9
.config/sway/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/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
|
||||
|
@ -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
|
||||
|
9
.config/waybar/scripts/battery.sh
Executable file
9
.config/waybar/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
|
@ -91,6 +91,11 @@ window#waybar.chromium {
|
||||
margin: 0 1px;
|
||||
}
|
||||
|
||||
#custom-battery {
|
||||
color: #62bbfa;
|
||||
margin: 0 1px;
|
||||
}
|
||||
|
||||
#custom-cpu {
|
||||
color: #d26bff;
|
||||
margin: 0 1px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user