feat(waybar): add window title back to window module, fix others

This commit is contained in:
João Dias
2024-09-23 13:21:24 -03:00
parent 355026fa2a
commit 7407920ec2
3 changed files with 57 additions and 49 deletions
+23 -21
View File
@@ -6,10 +6,10 @@
"reload_style_on_change": true, "reload_style_on_change": true,
"modules-left": [ "modules-left": [
"custom/logo", "custom/logo",
"hyprland/workspaces", "hyprland/workspaces"
"hyprland/window"
], ],
"modules-center": [ "modules-center": [
"hyprland/window",
"clock", "clock",
"custom/media" "custom/media"
], ],
@@ -36,40 +36,42 @@
}, },
"on-scroll-down": "hyprctl dispatch workspace e-1", "on-scroll-down": "hyprctl dispatch workspace e-1",
"on-scroll-up": "hyprctl dispatch workspace e+1" "on-scroll-up": "hyprctl dispatch workspace e+1",
"escape": true
}, },
"bluetooth": { "bluetooth": {
"format": "", "format": "",
"format-on": "󰂯", "format-on": "󰂯",
"format-connected": "󰂱", "format-connected": "󰂱",
"tooltip-format": "{controller_alias}{controller_address}\n\n{num_connections} connected", "tooltip-format": "󰇄 {controller_alias}\n{controller_address}",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", "tooltip-format-connected": " Controller(s):\n {controller_alias}\t{controller_address}\n\n󰂱 Devices ( {num_connections} ) :\n {device_enumerate}",
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}\n",
"tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%" "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t󰁹 {device_battery_percentage}%\n"
}, },
"keyboard-state": { "keyboard-state": {
"numlock": true, "numlock": true,
"capslock": true, "capslock": true,
"format": "{name} {icon}", "format": "{icon} {name}",
"format-icons": { "format-icons": {
"locked": " ", "locked": " ",
"unlocked": " " "unlocked": " "
} }
}, },
"hyprland/window": { "hyprland/window": {
"format": "{class}", "format": "{class} - {title}",
"show-empty": false, "show-empty": false,
"icon": true, "icon": true,
"separate-outputs": true, "separate-outputs": true,
"rewrite": { "rewrite": {
"zen-alpha": "Zen Browser", " - ": "",
"firefox": "Firefox", "zen-alpha(.*)": "Zen Browser",
"kitty": "Kitty", "firefox(.*)": "Firefox",
"spotify": "Spotify", "kitty - (.*)": "Kitty - $1",
"(.*)spotube": "Spotube", "spotify(.*)": "Spotify",
"(.*)discord": "Discord", "spotube": "Spotube",
"(.*)vesktop": "Vesktop", "discord - Discord (.*)": "Discord $1",
"org.gnome.(.*)": "$1" "vesktop - Discord (.*)": "Vesktop $1",
"org.gnome.(.*) - (.*)": "$1 - $2"
}, },
"escape": true "escape": true
@@ -103,7 +105,7 @@
"custom/control-center": { "custom/control-center": {
"format": "loading control center...", "format": "loading control center...",
"return-type": "json", "return-type": "json",
"exec": "sh $HOME/.config/waybar/modules/control-center.sh" "exec": "bash $HOME/.config/waybar/modules/control-center.sh"
}, },
"idle_inhibitor": { "idle_inhibitor": {
"format": "{icon}", "format": "{icon}",
@@ -203,12 +205,12 @@
"firefox": "", "firefox": "",
"discord": "", "discord": "",
"spotify": "", "spotify": "",
"spotube": " ", "spotube": "",
"default": "󰎇" "default": "󰎇"
}, },
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null",
"on-scroll-down": "playerctl previous", "on-scroll-down": "playerctl previous",
"on-scroll-up": "playerctl next", "on-scroll-up": "playerctl next",
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null", // Script in resources folder "on-click": "playerctl play-pause"
"on-click": "playerctl play-pause" // Change "spotify to your preferred player"
} }
} }
+1 -1
View File
@@ -123,7 +123,7 @@ class PlayerManager:
track_info = "Advertisement" track_info = "Advertisement"
elif artist != None and title != None: elif artist != None and title != None:
track_info = f"{artist} - {title}" track_info = f"{artist} - {title}"
if(artist == "" or artist is " "): if(artist == "" or artist == " "):
track_info = f"{title}" track_info = f"{title}"
else: else:
track_info = title track_info = title
+33 -27
View File
@@ -1,9 +1,6 @@
@import "../../.cache/wal/colors-waybar.css"; @import "../../.cache/wal/colors-waybar.css";
@define-color default-workspace @color1;
@define-color active-workspace @color2;
* { * {
color: @foreground; color: @foreground;
border-radius: 14px; border-radius: 14px;
@@ -23,40 +20,36 @@ window#waybar.hidden {
} }
window > * > * { window > * > * {
padding: 2px; padding: 4px;
} }
/* General */
.modules-left, .modules-center, .modules-right { .modules-left, .modules-center, .modules-right {
background: alpha(@background, .65); background: alpha(@background, .80);
} }
.module, .widget { .module {
padding: 0 10px; padding: 0 10px;
font-weight: 500; font-weight: 500;
} }
widget > * { widget > *:hover:not(#workspaces):not(#tray):not(#custom-media) {
padding-top: 1px;
padding-bottom: 1px;
}
widget > *:hover:not(#window):not(#workspaces):not(#tray):not(#custom-media) {
background: @color1; background: @color1;
} }
button:hover { button:hover {
background: @color1; background: @color1;
} }
/***/
/* Workspaces */ /* Workspaces */
#workspaces { #workspaces {
border-radius: 16px;
padding: 4px; padding: 4px;
} }
#workspaces button { #workspaces button {
background: @color1; background: @color1;
border-radius: 24px; border-radius: 14px;
padding: 0 4px; padding: 0 4px;
margin: 0 2px; margin: 0 2px;
} }
@@ -69,7 +62,15 @@ button:hover {
#workspaces button.urgent { #workspaces button.urgent {
animation: pick-attention; animation: pick-attention;
animation-duration: .5s; animation-duration: 2s;
}
#workspaces button:first-child {
margin-left: 0px;
}
#workspaces button:last-child {
margin-right: 0px;
} }
/***/ /***/
@@ -81,18 +82,24 @@ button:hover {
margin-right: 6px; margin-right: 6px;
} }
#custom-notifications { widget #custom-notifications {
font-size: 16px; font-size: 16px;
padding-left: 10px; padding-left: 10px;
padding-right: 12px; padding-right: 12px;
} }
#battery.charging, #battery.plugged { widget #window.empty {
margin: 0 0 0 0;
padding: 16px 0 0 0;
}
widget #battery.charging,
widget #battery.plugged {
color: @text; color: @text;
background-color: @background; background-color: @background;
} }
#battery:not(.plugged):not(.charging) { widget #battery:not(.plugged):not(.charging) {
background-color: shade(@color1, .68); background-color: shade(@color1, .68);
} }
@@ -119,14 +126,14 @@ button:hover {
} }
#custom-media { #custom-media {
border: 2px solid @color1; box-shadow: none;
border: 2px solid @color3;
font-weight: 500; font-weight: 500;
transition: 200ms ease-in; transition: 200ms ease-in;
} }
#custom-media:hover { #custom-media:hover {
border: 2px solid transparent; background: @color3;
background: @color2;
} }
#temperature.critical { #temperature.critical {
@@ -143,25 +150,24 @@ button:hover {
@keyframes blink { @keyframes blink {
to { to {
background-color: alpha(@crust, .3); color: @color3;
color: @orange;
} }
} }
@keyframes pick-attention { @keyframes pick-attention {
25% { 25% {
background: @color3; background: @color4;
} }
50% { 50% {
background: @color2; background: @color1;
} }
75% { 75% {
background: @color3; background: @color4;
} }
100% { 100% {
background: @color2; background: @color1;
} }
} }