make waybar "float", change colors and way of styling widgets

This commit is contained in:
João Dias
2024-07-29 20:55:25 -03:00
parent 7cf61ae283
commit 27ca7b05a5
2 changed files with 66 additions and 36 deletions
+17 -7
View File
@@ -2,11 +2,12 @@
{ {
// "layer": "top", // Waybar at top layer // "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right) // "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 32, // Waybar height (to be removed for auto height) // "height": 32, // 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
"modules-left": [ "modules-left": [
"custom/logo",
"hyprland/workspaces", "hyprland/workspaces",
"hyprland/window" "hyprland/window"
], ],
@@ -69,6 +70,12 @@
}, },
"escape": true "escape": true
}, },
"custom/logo": {
"format": "", // Change to desired logo
"tooltip": false,
"escape": true,
"on-click": "wofi --show drun -I -a -b" // Change to desired action
},
"custom/notifications": { "custom/notifications": {
"tooltip": false, "tooltip": false,
"format": "{icon}", "format": "{icon}",
@@ -155,16 +162,15 @@
}, },
"battery": { "battery": {
"states": { "states": {
// "good": 95, "good": 95,
"warning": 30, "warning": 30,
"critical": 15 "critical": 15
}, },
"format": "{capacity}% {icon}", "format": "{capacity}% {icon}",
"format-full": "{capacity}% {icon}",
"format-charging": "{capacity}% ", "format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ", "format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}", "format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module "format-good": "{capacity}% {icon}",
"format-full": "", "format-full": "",
"format-icons": ["", "", "", "", ""] "format-icons": ["", "", "", "", ""]
}, },
@@ -192,12 +198,11 @@
"format-alt": "{ifname}: {ipaddr}/{cidr}" "format-alt": "{ifname}: {ipaddr}/{cidr}"
}, },
"pulseaudio": { "pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}", "format": "{volume}% {icon} {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}", "format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon}", "format-bluetooth-muted": " {icon}",
"format-muted": " {format_source}", "format-muted": " {format_source}",
"format-source": "{volume}%", "format-source": "{icon} {volume}%",
"format-icons": { "format-icons": {
"headphone": "", "headphone": "",
"hands-free": "", "hands-free": "",
@@ -218,7 +223,12 @@
"spotify": "", "spotify": "",
"default": "󰎇" "default": "󰎇"
}, },
"tooltip": true,
"tooltip-format": {
"1": "Scroll-Up: Next<br>Scroll-Down: Previous"
},
"on-scroll-down": "playerctl --player spotify previous",
"on-scroll-up": "playerctl --player spotify next",
"exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null", // Script in resources folder "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null", // Script in resources folder
"on-click": "playerctl --player spotify play-pause" // Change "spotify to your preferred player" "on-click": "playerctl --player spotify play-pause" // Change "spotify to your preferred player"
} }
+48 -28
View File
@@ -1,17 +1,30 @@
@import "mocha.css"; @import "mocha.css";
@define-color hover shade(@blue, .5);
* {
color: @text;
border-radius: 14px;
}
window { window {
font-family: "0xProto Nerd Font Regular", "Font Awesome", sans-serif; font-family: "0xProto Nerd Font Regular", "Font Awesome", sans-serif;
font-size: 12px; font-size: 12px;
color: @text; color: @text;
border-radius: 16px;
} }
* { /* Manage "floating" waybar position with paddings */
color: @text; window > * {
border-radius: 12px; margin-top: 5px;
margin-left: 0; margin-left: 4px;
margin-right: 0; margin-right: 4px;
padding: 2px;
}
window > * {
background: alpha(@base, .8);
} }
window#waybar { window#waybar {
@@ -22,22 +35,18 @@ window#waybar.hidden {
opacity: .1; opacity: .1;
} }
/* /*window#waybar.empty {
window#waybar.empty {
background-color: transparent; background-color: transparent;
} }
window#waybar.solo { window#waybar.solo {
background-color: #FFFFFF; background-color: #FFFFFF;
} }
*/
window#waybar.termite { window#waybar.termite {
background-color: alpha(@base, .1); background-color: alpha(@base, .1);
} }
window#waybar.chromium { window#waybar.chromium {
background-color: @base; background-color: @base;
} }*/
button { button {
/* Use box-shadow instead of border so the text isn't offset */ /* Use box-shadow instead of border so the text isn't offset */
@@ -50,7 +59,25 @@ button {
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover { button:hover {
background-color: alpha(shade(@blue, .3), .4); background-color: @hover;
}
widget > * {
padding-top: 1px;
padding-bottom: 1px;
transition: 100ms ease-in;
}
widget > *:hover:not(#window):not(#workspaces):not(#tray):not(#custom-media) {
background: @hover;
}
#custom-logo {
padding-left: 12px;
padding-right: 18px;
font-size: 15.2px;
transition: 110ms ease-in;
margin-right: 6px;
} }
/* you can set a style on hover for any module like this */ /* you can set a style on hover for any module like this */
@@ -59,21 +86,24 @@ button:hover {
} }
#workspaces { #workspaces {
background: alpha(@base, .3); border-radius: 16px;
padding-top: 2px; padding-left: 2px;
padding-bottom: 2px; padding-right: 2px;
} }
#workspaces button { #workspaces button {
color: @text; color: @text;
padding-left: 6px; background: transparent;
padding-right: 6.9px;
font-size: 19px; font-size: 19px;
border-radius: 16px;
}
#workspaces button *:hover {
background: @base;
} }
#workspaces button.active { #workspaces button.active {
background: alpha(shade(@blue, .5), .6); background: alpha(shade(@blue, .5), .6);
/* Customize font size and stuff when in different states */
} }
#workspaces button.urgent { #workspaces button.urgent {
@@ -126,16 +156,6 @@ button:hover {
#workspaces {} #workspaces {}
*/ */
/* 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;
}
#clock { #clock {
background-color: alpha(@base, .3); background-color: alpha(@base, .3);
} }