Waybar tweak

This commit is contained in:
francois
2026-05-25 11:51:23 +02:00
parent 06a02187dd
commit 88f40ff6f4
2 changed files with 187 additions and 162 deletions

View File

@@ -1,8 +1,8 @@
// -*- mode: jsonc -*- // -*- mode: jsonc -*-
{ {
// "layer": "top", // Waybar at top layer "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right) "position": "top", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height) //"height": 50, // Waybar height (to be removed for auto height)
//"width": 1280, // Waybar width //"width": 1280, // Waybar width
"spacing": 4, // Gaps between modules (4px) "spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules // Choose the order of the modules
@@ -19,19 +19,15 @@
"mpd", "mpd",
"idle_inhibitor", "idle_inhibitor",
"pulseaudio", "pulseaudio",
"network",
"network#wired",
"power-profiles-daemon",
"cpu",
"memory",
"temperature",
"backlight", "backlight",
"tray",
"keyboard-state", "keyboard-state",
"sway/language", "sway/language",
"battery", "bluetooth",
"battery#bat2", "group/nw",
"group/hw",
"group/power",
"clock", "clock",
"tray",
"custom/power" "custom/power"
], ],
// Modules configuration // Modules configuration
@@ -107,79 +103,11 @@
// "icon-size": 21, // "icon-size": 21,
"spacing": 10 "spacing": 10
}, },
"clock": {
// "timezone": "America/New_York",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "{usage}% ",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
// "thermal-zone": 2,
"hwmon-path": "/sys/class/hwmon/hwmon3/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": { "backlight": {
// "device": "acpi_video1", // "device": "acpi_video1",
"format": "{percent}% {icon}", "format": "{percent}% {icon}",
"format-icons": ["", "", "", "", "", "", "", "", ""] "format-icons": ["", "", "", "", "", "", "", "", ""]
}, },
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-full": "{capacity}% {icon}",
"format-charging": "{capacity}% 󱊥",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"power-profiles-daemon": {
"format": "{icon}",
"tooltip-format": "Power profile: {profile}\nDriver: {driver}",
"tooltip": true,
"format-icons": {
"default": "",
"performance": "",
"balanced": "",
"power-saver": ""
}
},
"network": {
"interface": "wlp2*", // (Optional) To force the use of this interface
"family": "ipv4",
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"network#wired": {
"interface": "enp*", // (Optional) To force the use of this interface
"family": "ipv4",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"pulseaudio": { "pulseaudio": {
// "scroll-step": 1, // %, can be a float // "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}", "format": "{volume}% {icon} {format_source}",
@@ -199,17 +127,111 @@
}, },
"on-click": "pavucontrol" "on-click": "pavucontrol"
}, },
"custom/media": { "bluetooth": {
"format": "{icon} {text}", "format": "󰂯 {status}",
"return-type": "json", "format-no-controller": "",
"max-length": 40, "format-on": "󰂯",
"format-icons": { "format-off": "󰂲",
"spotify": "", "format-connected": "󰂱 ({num_connections})",
"default": "🎜" "format-connected-battery": "󰂱 {device_alias}: {device_battery_percentage}% ({num_connections})",
"tooltip": true,
"tooltip-format": "{device_alias}: {device_address},{device_address_type}"
}, },
"escape": true, "group/nw": {
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder "orientation": "vertical",
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name "modules": [
"network",
"network#wired"
]
},
"network": {
"interface": "wlp2*", // (Optional) To force the use of this interface
"family": "ipv4",
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"network#wired": {
"interface": "enp*", // (Optional) To force the use of this interface
"family": "ipv4",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"group/hw": {
"orientation": "vertical",
"modules": [
"cpu",
"memory",
"temperature"
],
"drawer": {
"transition-duration": 500,
"children-class": "not-power",
"transition-left-to-right": true,
},
},
"cpu": {
"format": "{usage}% ",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
// "thermal-zone": 2,
"hwmon-path": "/sys/class/hwmon/hwmon3/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"group/power": {
"orientation": "vertical",
"modules": [
"battery",
"power-profiles-daemon"
]
},
"battery": {
"states": {
"good": 70,
"warning": 30,
"critical": 20
},
"format": "{capacity}% {icon}",
"format-full": "{capacity}% {icon}",
"format-charging": "{capacity}% 󱊥",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""],
"tooltip": true,
"tooltip-format": "{timeTo}\n{power}W\nHealth: {health}%\n{cycles} cycles seen"
},
"power-profiles-daemon": {
"format": "{icon}",
"tooltip-format": "Power profile: {profile}\nDriver: {driver}",
"tooltip": true,
"format-icons": {
"default": "",
"performance": "",
"balanced": "",
"power-saver": ""
}
},
"clock": {
// "timezone": "America/New_York",
"format": "{0:%H:%M}\n{0:%Y-%m-%d}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
}, },
"custom/power": { "custom/power": {
"format" : "⏻ ", "format" : "⏻ ",

View File

@@ -1,5 +1,5 @@
* { * {
font-family: Hack Nerd Font; font-family: Hack Nerd Font Mono;
font-size: 12px; font-size: 12px;
} }
@@ -10,9 +10,9 @@ window#waybar {
transition-duration: .5s; transition-duration: .5s;
} }
window#waybar:first-child > box { window#waybar:first-child > box {
margin-top: 6px; margin: 6px;
padding: 8px 4px 4px 4px; padding: 4px;
border-radius: 20px 20px 20px 20px; border-radius: 20px;
background-color: rgba(46, 52, 64, 0.5); background-color: rgba(46, 52, 64, 0.5);
border: 2px solid #88c0d0; border: 2px solid #88c0d0;
} }
@@ -100,9 +100,12 @@ button:hover {
#power-profiles-daemon, #power-profiles-daemon,
#keyboard-state, #keyboard-state,
#mpd { #mpd {
padding: 0 10px; /*padding: 0px;
color: #ffffff; color: #ffffff;*/
border-radius: 20px; border-radius: 20px;
margin: 2px;
padding-left: 5px;
padding-right: 5px;
} }
#window, #window,
@@ -119,57 +122,6 @@ button:hover {
margin-right: 0; margin-right: 0;
} }
#clock {
background-color: #64727D;
}
#battery {
background-color: #ffffff;
color: #000000;
}
#battery.charging, #battery.plugged {
color: #ffffff;
background-color: #26A65B;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
/* Using steps() instead of linear as a timing function to limit cpu usage */
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: steps(12);
animation-iteration-count: infinite;
animation-direction: alternate;
}
#power-profiles-daemon {
padding-right: 15px;
}
#power-profiles-daemon.performance {
background-color: #f53c3c;
color: #ffffff;
}
#power-profiles-daemon.balanced {
background-color: #2980b9;
color: #ffffff;
}
#power-profiles-daemon.power-saver {
background-color: #2ecc71;
color: #000000;
}
label:focus { label:focus {
background-color: #000000; background-color: #000000;
} }
@@ -286,21 +238,21 @@ label:focus {
#language { #language {
background: #00b093; background: #00b093;
color: #740864; color: #740864;
padding: 0 5px; /*padding: 0 5px;
margin: 0 5px; margin: 0 5px;*/
min-width: 16px; min-width: 16px;
} }
#keyboard-state { #keyboard-state {
background: #97e1ad; background: #97e1ad;
color: #000000; color: #000000;
padding: 0 0px; /*padding: 0 0px;
margin: 0 5px; margin: 0 5px;*/
min-width: 16px; min-width: 16px;
} }
#keyboard-state > label { #keyboard-state > label {
padding: 0 5px; /*padding: 0 5px;*/
} }
#keyboard-state > label.locked { #keyboard-state > label.locked {
@@ -334,3 +286,54 @@ label:focus {
#privacy-item.audio-out { #privacy-item.audio-out {
background-color: #0069d4; background-color: #0069d4;
} }
#battery {
background-color: #ffffff;
color: #000000;
}
#battery.charging, #battery.plugged {
color: #ffffff;
background-color: #26A65B;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
/* Using steps() instead of linear as a timing function to limit cpu usage */
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: steps(12);
animation-iteration-count: infinite;
animation-direction: alternate;
}
#power-profiles-daemon {
/*padding-right: 15px;*/
}
#power-profiles-daemon.performance {
background-color: #f53c3c;
color: #ffffff;
}
#power-profiles-daemon.balanced {
background-color: #2980b9;
color: #ffffff;
}
#power-profiles-daemon.power-saver {
background-color: #2ecc71;
color: #000000;
}
#clock {
background-color: #64727D;
}