Add mpris module to Waybar

This commit is contained in:
Sam A. 2023-04-16 15:57:16 +02:00
parent 4ba0b52c7e
commit df6c3e40f0
Signed by: samsapti
GPG Key ID: CBBBE7371E81C4EA
2 changed files with 33 additions and 12 deletions

View File

@ -3,17 +3,14 @@
"layer": "top", "layer": "top",
"position": "top", "position": "top",
"height": 36, "height": 36,
"modules-left": ["idle_inhibitor", "sway/workspaces", "sway/mode"], "modules-left": ["idle_inhibitor", "sway/workspaces", "mpris", "sway/mode"],
"modules-center": ["clock"], "modules-center": ["clock"],
"modules-right": ["network", "pulseaudio", "backlight", "memory", "cpu", "temperature", "battery", "tray"], "modules-right": ["network", "pulseaudio", "backlight", "memory", "cpu", "temperature", "battery", "tray"],
"sway/workspaces": { "sway/workspaces": {
"disable-scroll": true "disable-scroll": true
}, },
"sway/window": {
"max-length": 64
},
"sway/mode": { "sway/mode": {
"format": "<span style=\"italic\">{}</span>" "format": "<i>{}</i>"
}, },
"idle_inhibitor": { "idle_inhibitor": {
"format": "{icon}", "format": "{icon}",
@ -63,8 +60,8 @@
"pulseaudio": { "pulseaudio": {
"scroll-step": 2, // %, can be a float "scroll-step": 2, // %, can be a float
"format": "{icon} {volume}% {format_source}", "format": "{icon} {volume}% {format_source}",
"format-bluetooth": "{icon} {volume}% {format_source}", "format-bluetooth": "{icon}  {volume}% {format_source}",
"format-bluetooth-muted": "{icon}  {format_source}", "format-bluetooth-muted": "{icon}   {format_source}",
"format-muted": " {format_source}", "format-muted": " {format_source}",
"format-source": " {volume}%", "format-source": " {volume}%",
"format-source-muted": "", "format-source-muted": "",
@ -79,6 +76,15 @@
}, },
"on-click": "/usr/bin/pavucontrol" "on-click": "/usr/bin/pavucontrol"
}, },
"mpris": {
"format": "{player_icon} <i>{artist} - {title}</i>",
"format-paused": "{player_icon} <i>{artist} - {title}</i>",
"player-icons": {
"default": "\uf001",
"Spot": "\uf1bc"
},
"ignored-players": ["chromium", "firefox"]
},
"backlight": { "backlight": {
"format": "{icon} {percent}%", "format": "{icon} {percent}%",
"format-icons": ["", "", "", "", "", "", "", "", ""] "format-icons": ["", "", "", "", "", "", "", "", ""]

View File

@ -72,10 +72,6 @@ window#waybar.hidden {
box-shadow: inset 0 3px @orange; box-shadow: inset 0 3px @orange;
} }
#mode {
box-shadow: inset 0 3px @cyan;
}
#clock, #clock,
#battery, #battery,
#cpu, #cpu,
@ -89,7 +85,7 @@ window#waybar.hidden {
#tray, #tray,
#mode, #mode,
#idle_inhibitor, #idle_inhibitor,
#mpd { #mpris {
padding: 0 4px; padding: 0 4px;
margin: 0 4px; margin: 0 4px;
color: @white; color: @white;
@ -177,6 +173,20 @@ label:focus {
box-shadow: inset 0 3px @orange; box-shadow: inset 0 3px @orange;
} }
#mpris {
color: @violet;
box-shadow: inset 0 3px @violet;
}
#mpris.Spot {
color: @green;
box-shadow: inset 0 3px @green;
}
#mpris.paused {
box-shadow: none;
}
#tray { #tray {
box-shadow: inset 0 3px @cyan; box-shadow: inset 0 3px @cyan;
} }
@ -199,6 +209,11 @@ label:focus {
box-shadow: inset 0 3px @violet; box-shadow: inset 0 3px @violet;
} }
#mode {
color: @cyan;
box-shadow: inset 0 3px @cyan;
}
#temperature { #temperature {
color: @yellow; color: @yellow;
box-shadow: inset 0 3px @yellow; box-shadow: inset 0 3px @yellow;