Change Waybar configuration

This commit is contained in:
Fabio Scotto di Santolo
2025-07-27 14:50:59 +02:00
parent c95101db2b
commit b1be4dd5f5
2 changed files with 211 additions and 169 deletions

View File

@@ -2,19 +2,31 @@
"layer": "top", // Waybar at top layer "layer": "top", // Waybar at top layer
"position": "top", // Waybar position (top|bottom|left|right) "position": "top", // Waybar position (top|bottom|left|right)
"modules-left": [ "modules-left": [
// "custom/launcher",
"sway/workspaces", "sway/workspaces",
"sway/window" "temperature",
"idle_inhibitor",
"mpd",
], ],
"modules-center": [ "modules-center": [
"clock" "clock"
], ],
"modules-right": [ "modules-right": [
"memory",
"cpu",
"pulseaudio", "pulseaudio",
"tray", "backlight",
"network",
"bluetooth", "bluetooth",
"battery", "battery",
"custom/power" "custom/powermenu",
"tray"
], ],
"custom/launcher": {
"format": " ",
"on-click": "~/.config/waybar/launcher.sh",
"tooltip": false
},
"sway/workspaces": { "sway/workspaces": {
"disable-scroll": true, "disable-scroll": true,
"disable-markup": false, "disable-markup": false,
@@ -32,65 +44,20 @@
"active": "", "active": "",
"default": "" "default": ""
}, },
"persistent-workspaces": {
"1": [
"HDMI-A-1"
],
"2": [
"HDMI-A-1"
],
"3": [
"HDMI-A-1"
],
"4": [
"HDMI-A-1"
],
"5": [
"HDMI-A-1"
],
"6": [
"HDMI-A-1"
],
"7": [
"HDMI-A-1"
],
"8": [
"HDMI-A-1"
],
"9": [
"HDMI-A-1"
],
"10": [
"eDP-1"
]
}
}, },
"sway/window": { "idle_inhibitor": {
"format": "<span>{}</span>", "format": "{icon}",
"max-length": 50 "format-icons": {
"activated": "",
"deactivated": ""
}, },
"tray": { "tooltip": false
"icon-size": 24,
"spacing": 5
},
"custom/spotify": {
"format": " {}",
"escape": true,
"interval": 5,
"tooltip": false,
"exec": "playerctl metadata --format='{{ title }}'",
"on-click": "playerctl play-pause",
"max-length": 50
},
"clock": {
"timezone": "Europe/Rome",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%d/%m/%Y}",
"format": "{:%a %b %d %I:%M %p}"
}, },
"backlight": { "backlight": {
"device": "intel_backlight", "device": "intel_backlight",
"format": "{icon} {percent}%", "on-scroll-up": "light -A 5",
"on-scroll-down": "light -U 5",
"format": "{percent}% {icon}",
"format-icons": [ "format-icons": [
"", "",
"", "",
@@ -103,15 +70,33 @@
"" ""
] ]
}, },
"battery": { "pulseaudio": {
"states": { "scroll-step": 1,
"warning": 30, "format": "{volume}% {icon}",
"critical": 15 "format-muted": " {format_source}",
"format-icons": {
"headphone": "",
"phone": "",
"portable": "",
"car": "",
"default": [
"",
"",
" "
]
}, },
"format": "{icon} {capacity}%", "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
"format-charging": "󰂄", },
"format-plugged": "󰂄", "battery": {
"format-alt": "{icon}", "interval": 10,
"states": {
"warning": 20,
"critical": 10
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% 󰂄",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
"format-icons": [ "format-icons": [
"󰁺", "󰁺",
"󰁻", "󰁻",
@@ -124,33 +109,65 @@
"󰂂" "󰂂"
] ]
}, },
"pulseaudio": { "clock": {
// "scroll-step": 1, // %, can be a float "interval": 1,
"format": "{icon} {volume}%", "timezone": "Europe/Rome",
"format-muted": "", "format": "{:%I:%M %p %A %b %d}",
"format-icons": { "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"default": [ "format-alt": "{:%d/%m/%Y}",
"",
"",
" "
]
}, },
"on-click": "pavucontrol" "memory": {
"interval": 1,
"format": "{percentage}% ",
"states": {
"warning": 85,
}, },
"custom/lock": { },
"cpu": {
"interval": 1,
"format": "{usage}% ",
"tooltip": false
},
"mpd": {
"max-length": 25,
"format": "<span foreground='#bb9af7'></span> {title}",
"format-paused": " {title}",
"format-stopped":"<span foreground='#bb9af7'></span>",
"format-disconnected": "",
"on-click": "mpc --quiet toggle",
"on-click-right": "mpc ls | mpc add",
"on-click-middle": "kitty ncmpcpp",
"on-scroll-up": "mpc --quiet prev",
"on-scroll-down": "mpc --quiet next",
"smooth-scrolling-threshold":5,
"tooltip-format": "{title} - {artist} ({elapsedTime:%M:%S}/{totalTime:%H:%M:%S})"
},
"network": {
"interval": 1,
"format-wifi": "{essid} ",
"format-ethernet": "{ifname} ({ipaddr})",
"format-linked": "{essid} (No IP)",
"format-disconnected": "Disconnected ⚠",
"tooltip": false
},
"temperature": {
"hwmon-path": "/sys/class/hwmon/hwmon6/temp2_input",
"tooltip": false, "tooltip": false,
"on-click": "sh -c '(sleep 0.5s; swaylock --grace 0)' & disown", "format": "{temperatureC}°C "
"format": ""
}, },
"custom/power": { "custom/powermenu": {
"tooltip": false, "format": "",
"on-click": "wlogout &", "on-click": "wlogout &",
"format": "" "tooltip": false
},
"tray": {
"icon-size": 15,
"spacing": 5
}, },
"bluetooth": { "bluetooth": {
"format": "{status}", "format": "{status}",
"format-connected": "{device_alias}", "format-connected": "{device_alias}",
"format-connected-battery": "{device_alias} {device_battery_percentage}%", "format-connected-battery": "{device_alias} {device_battery_percentage}%",
"format-off": "󰂲", // "format-device-preference": [ "device1", "device2" ], // preference list deciding the displayed device "format-off": "󰂲", // "format-device-preference": [ "device1", "device2" ], // preference list deciding the displayed device
"tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}",

View File

@@ -1,107 +1,132 @@
@import "themes/mocha.css"; @import "themes/mocha.css";
* { * {
font-family: FiraCode Nerd Font; font-family: "JetBrainsMono Nerd Font";
font-size: 12px; font-size: 12pt;
min-height: 0; font-weight: bold;
border-radius: 0px;
transition-property: background-color;
transition-duration: 0.5s;
} }
@keyframes blink_red {
#waybar { to {
/*background: transparent;*/ background-color: rgb(242, 143, 173);
color: @text; color: rgb(26, 24, 38);
/*margin: 5px 5px;*/ }
}
.warning, .critical, .urgent {
animation-name: blink_red;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
window#waybar {
background-color: transparent;
}
window > box {
margin-left: 5px;
margin-right: 5px;
margin-top: 5px;
background-color: rgb(30, 30, 46);
} }
#workspaces { #workspaces {
border-radius: 1rem; padding-left: 0px;
margin: 5px; padding-right: 4px;
background-color: @surface0;
margin-left: 1rem;
} }
#workspaces button { #workspaces button {
color: @lavender; padding-top: 5px;
border-radius: 1rem; padding-bottom: 5px;
padding: 0.4rem; padding-left: 6px;
padding-right: 6px;
} }
#workspaces button.focused {
#workspaces button.active { background-color: rgb(181, 232, 224);
color: @sky; color: rgb(26, 24, 38);
border-radius: 1rem; }
#workspaces button.urgent {
color: rgb(26, 24, 38);
} }
#workspaces button:hover { #workspaces button:hover {
color: @sapphire; background-color: rgb(248, 189, 150);
border-radius: 1rem; color: rgb(26, 24, 38);
} }
tooltip {
#custom-music, background: rgb(48, 45, 65);
#tray, }
#backlight, tooltip label {
#bluetooth, color: rgb(217, 224, 238);
#clock, }
#battery, #custom-launcher {
#pulseaudio, padding-left: 8px;
#custom-lock, padding-right: 6px;
#custom-power { color: rgb(201, 203, 255);
background-color: @surface0; }
padding: 0.5rem 1rem; #mode, #clock, #memory, #temperature, #cpu, #mpd, #idle_inhibitor, #temperature, #backlight, #pulseaudio, #network, #battery, #custom-powermenu, #bluetooth {
margin: 5px 0; padding-left: 10px;
padding-right: 10px;
}
#memory {
color: rgb(181, 232, 224);
}
#cpu {
color: rgb(245, 194, 231);
} }
#clock { #clock {
border-radius: 0px 1rem 1rem 0px; color: rgb(217, 224, 238);
margin-right: 1rem; }
#idle_inhibitor {
color: rgb(221, 182, 242);
}
#temperature {
color: rgb(150, 205, 251);
}
#backlight {
color: rgb(248, 189, 150);
}
#pulseaudio {
color: rgb(245, 224, 220);
}
#network {
color: #ABE9B3;
}
#network.disconnected {
color: rgb(255, 255, 255);
} }
#battery { #battery {
color: @green; color: @sky;
} }
#battery.charging { #battery.charging {
color: @green; color: @green;
} }
#battery.full, #battery.discharging {
#battery.warning:not(.charging) { color: rgb(250, 227, 176);
color: @red; }
#battery.critical:not(.charging) {
color: @red;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#custom-powermenu {
color: rgb(242, 143, 173);
}
#tray {
padding-right: 8px;
padding-left: 10px;
}
#mpd.paused {
color: #414868;
font-style: italic;
}
#mpd.stopped {
background: transparent;
}
#mpd {
color: #c0caf5;
} }
#bluetooth { #bluetooth {
color: @blue; color: @blue;
} }
#bluetooth, #battery {
border-radius: 0;
}
#pulseaudio {
color: @maroon;
border-radius: 1rem 0px 0px 1rem;
margin-left: 1rem;
}
#clock, #custom-music {
color: @mauve;
border-radius: 1rem;
}
#custom-lock {
border-radius: 1rem 0px 0px 1rem;
color: @lavender;
}
#custom-power {
margin-right: 1rem;
border-radius: 0px 1rem 1rem 0px;
color: @red;
}
#tray {
margin-right: 1rem;
border-radius: 1rem;
}
window#waybar {
background-color: shade(@base, 0.9);
border: 2px solid alpha(@crust, 0.3);
}