sway: tweak lock and bar

This commit is contained in:
2024-08-01 23:38:55 +02:00
parent c6ab0cad8f
commit 2c6fb03012
7 changed files with 85 additions and 79 deletions

View File

@@ -32,9 +32,12 @@
// "memory",
// "cpu",
// "temperature",
"custom/weather",
"backlight",
// "custom/keyboard-layout",
"battery",
"custom/conservation",
"custom/power",
"clock#date",
"clock#time"
],
@@ -51,10 +54,11 @@
"critical": 15
},
// Connected to AC
"format": " {capacity}%", // Icon: bolt
// "format": " {capacity}%", // Icon: bolt
"format": "⚡ {capacity}%", // Icon: bolt
// Not connected to AC
// "format-discharging": "{icon} {capacity}%",
"format-discharging": "{capacity}%",
"format-discharging": "🔋 {capacity}%",
"format-icons": [
"", // Icon: battery-full
"", // Icon: battery-three-quarters
@@ -67,15 +71,15 @@
"backlight": {
"device": "intel_backlight",
// "format": "{icon} {percent}%",
"format": "{percent}%",
"format-icons": ["", ""]
"format": "{icon} {percent}%",
// "format": "{percent}%",
"format-icons": ["🔅", "🔆"]
},
"clock#time": {
"interval": 1,
"format": "{:%H:%M}",
"format": "🕒 {:%H:%M}",
"tooltip": false,
"on-click": "gnome-clocks"
},
@@ -83,14 +87,23 @@
"clock#date": {
"interval": 10,
// "format": " {:%e %b %Y}", // Icon: calendar-alt
"format": "{:%e %b %Y}", // Icon: calendar-alt
"format": "🗓️ {:%e. %b %Y (%a)}", // Icon: calendar-alt
"tooltip-format": "{:%e %B %Y}",
"on-click": "gnome-calendar"
},
// https://github.com/bjesus/wttrbar
"custom/weather": {
"format": "{}°C",
"tooltip": true,
"interval": 3600,
"exec": "wttrbar --location Munich",
"return-type": "json"
},
"cpu": {
"interval": 5,
"format": " {usage}% ({load})", // Icon: microchip
"interval": 30,
"format": "🧮 {usage}% ({load})", // Icon: microchip
"states": {
"warning": 70,
"critical": 90
@@ -108,8 +121,8 @@
},
"memory": {
"interval": 5,
"format": "󰍛 {}%", // Icon: memory
"interval": 30,
"format": "💾 {used} GiB", // Icon: memory
"states": {
"warning": 70,
"critical": 90
@@ -179,6 +192,17 @@
"tray": {
"icon-size": 15,
"spacing": 20
},
"custom/conservation": {
"exec": "~/.config/waybar/conservation.sh",
"interval": 10,
"on-click": "~/.config/waybar/conservation-toggle.sh"
},
"custom/power": {
"exec": "echo 💻 $(cat /sys/firmware/acpi/platform_profile)",
"interval": 10,
}
}

View File

@@ -0,0 +1,10 @@
location='/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode'
val=$(cat $location)
if [ "X$val" == "X1" ]; then
echo 0 | sudo tee $location
notify-send "Battery" "Disabled conservation mode" -i battery
else
echo 1 | sudo tee $location
notify-send "Battery" "Enabled conservation mode" -i battery
fi

View File

@@ -0,0 +1,8 @@
location='/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode'
val=$(cat $location)
if [ "X$val" == "X1" ]; then
echo "(On)"
else
echo "(Off)"
fi

View File

@@ -61,6 +61,8 @@
#clock,
#cpu,
#custom-keyboard-layout,
#custom-weather,
#custom-power,
#memory,
#mode,
#network,
@@ -71,6 +73,10 @@
padding-right: 10px;
}
#custom-conservation {
padding-right: 10px;
}
/* -----------------------------------------------------------------------------
* Module styles