Skip to content

Instantly share code, notes, and snippets.

@hansp27
Last active November 4, 2024 04:07
Show Gist options
  • Select an option

  • Save hansp27/7d957d85c3339e691a286104b2efa18c to your computer and use it in GitHub Desktop.

Select an option

Save hansp27/7d957d85c3339e691a286104b2efa18c to your computer and use it in GitHub Desktop.
waybar configuration customized for the rounded corners/notch of macbook pros (optimized for 16")
// waybar config file
{
"layer": "top",
"position": "top",
"height": 32,
"fixed-center": true,
"modules-left": [
"sway/workspaces",
"sway/mode",
"sway/window"
],
"modules-right": [
"wireplumber",
"memory",
"cpu",
"sway/language",
"battery",
"bluetooth",
"network",
"tray",
"clock"
],
"battery": {
"interval": 10,
"states": {
"warning": 30,
"critical": 10
},
// Connected to AC
"format": "{icon} {capacity}%⚡", // Icon: bolt
// Not connected to AC
"format-discharging": "bat {capacity}",
"format-icons": [
"", // Icon: battery-full
"", // Icon: battery-three-quarters
"", // Icon: battery-half
"", // Icon: battery-quarter
"" // Icon: battery-empty
],
"tooltip": true
},
"cpu": {
"interval": 5,
"format": "cpu {usage}%", // Icon: microchip
"states": {
"warning": 70,
"critical": 90
}
},
"sway/language": {
"format": "{short} {flag} ",
},
"memory": {
"interval": 5,
"format": "mem {percentage}% swp {swapPercentage}%", // Icon: memory
"states": {
"warning": 70,
"critical": 90
},
"on-click": "gnome-system-monitor"
},
"network": {
"interval": 5,
"format-wifi": " {essid} ({signalStrength}%)", // Icon: wifi
"format-ethernet": " {ifname}: {ipaddr}/{cidr}", // Icon: ethernet
"format-disconnected": "⚠ Disconnected",
"tooltip-format": "{ifname}: {ipaddr}",
"on-click": "alacritty -e nmtui",
},
"sway/mode": {
"format": "<span style=\"italic\"> {}</span>", // Icon: expand-arrows-alt
"tooltip": false
},
"sway/window": {
"format": "{title}",
"align": 0,
"all-outputs": true,
},
"sway/workspaces": {
"all-outputs": false,
"disable-scroll": true,
"format": "{icon}",
"format-icons": {
"urgent": "",
//"focused": "",
//"default": ""
}
},
"temperature": {
"thermal-zone": 0,
"critical-threshold": 80,
"interval": 5,
"format": "{icon} {temperatureC}°C ",
"format-icons": [
"", // Icon: temperature-empty
"", // Icon: temperature-quarter
"", // Icon: temperature-half
"", // Icon: temperature-three-quarters
"" // Icon: temperature-full
],
"tooltip": true
},
"tray": {
"icon-size": 21,
"spacing": 5,
"show-passive-items": true,
},
"bluetooth": {
"format": " {status}",
"format-connected": " {device_alias}",
"format-connected-battery": " {device_alias} {device_battery_percentage}%",
"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-enumerate-connected": "{device_alias}\t{device_address}",
"tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%",
"on-click": "blueberry"
},
"wlr/taskbar": {
"on-click": "activate",
},
"clock": {
"format": "{:%a, %b %d, %Y | %R}",
"format-alt": "{:%H:%M}  ",
"tooltip-format": "<tt><small>{calendar}</small></tt>",
"calendar": {
"mode" : "year",
"mode-mon-col" : 2,
"weeks-pos" : "right",
"on-scroll" : 1,
"on-click-right": "mode",
"format": {
"months": "<span color='#ffead3'><b>{}</b></span>",
"days": "<span color='#ecc6d9'><b>{}</b></span>",
"weeks": "<span color='#99ffdd'><b>W{}</b></span>",
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
"today": "<span color='#ff6699'><b><u>{}</u></b></span>"
}
},
"actions": {
"on-click-right": "mode",
"on-click-forward": "tz_up",
"on-click-backward": "tz_down",
"on-scroll-up": "shift_up",
"on-scroll-down": "shift_down"
}
},
"wireplumber": {
"format": " {volume}%",
"format-muted": "",
"on-click": "pavucontrol"
}
}
/* waybar styles.css with rounded corners*/
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: "Cantarell";
font-size: 15px;
min-height: 0;
font-weight: 500;
}
window#waybar {
background: transparent;
background-color: rgba(43, 48, 59, 0.9);
/* border-bottom: 3px solid rgba(100, 114, 125, 0.5); */
color: white;
transition-property: background-color;
transition-duration: .5s;
border-radius: 20px 24px 0px 0px;
}
window#waybar.hidden {
opacity: 0.2;
}
#waybar.empty #window {
background-color: transparent;
}
#workspaces {
padding-left: 1px;
}
#window {
margin: 2;
padding-left: 8;
padding-right: 8;
background-color: rgba(0, 0, 0, 0.3);
font-weight: bold;
}
button {
/* Use box-shadow instead of border so the text isn't offset */
box-shadow: inset 0 -3px transparent;
/* Avoid rounded borders under each button name */
border: none;
border-radius: 0;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover {
background: inherit;
border-top: 2px solid #c9545d;
}
#workspaces button {
padding: 0 4px;
border-right: 1 solid aqua;
color: white;
/* background-color: rgba(0,0,0,0.3); */
border-top: 2px solid transparent;
}
#workspaces button:hover {}
#workspaces button.focused {
/* box-shadow: inset 0 -2px #c9545d; */
background-color: rgba(0, 0, 0, 0.3);
color: #c9545d;
border-top: 2px solid #c9545d;
}
/* leftmost workspace */
#workspaces button:first-child {
border-radius: 20px 0px 0px 0px;
border-left: 2px solid transparent;
padding-left: 7px;
}
#workspaces button:first-child.focused {
border-left: 2px solid #c9545d;
border-radius: 20px 0px 0px 0px;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#mode {
background-color: #64727D;
border-bottom: 3px solid #ffffff;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#language,
#bluetooth,
#mpd {
margin: 2px;
padding-left: 4px;
padding-right: 4px;
background-color: rgba(0, 0, 0, 0.3);
color: #ffffff;
border-radius: 2px;
}
#clock {
font-family: 'C059';
font-style: italic;
font-weight: bold;
font-size: 15px;
padding-top: 5px;
}
#cpu {
min-width: 60px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left>widget:first-child>#workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right>widget:last-child>#workspaces {
margin-right: 0;
}
#battery icon {
color: red;
}
#battery.charging,
#battery.plugged {
color: #ffffff;
background-color: #26A65B;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.warning:not(.charging) {
background-color: #E39624;
color: #000000;
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#network.disconnected {
background-color: #f53c3c;
}
#temperature.critical {
background-color: #eb4d4b;
}
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
}
#tray>.passive {
-gtk-icon-effect: dim;
}
#tray>.needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}
/* rightmost widget */
window#waybar>box>box:last-child>widget:last-child>label {
padding-right: 7px;
padding-bottom: 0px;
}
label.module {}
@hansp27
Copy link
Author

hansp27 commented Nov 4, 2024

20241104_07h56m03s_grim
preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment