From 5c4a03900d3a4c772e5b2c879a7ce51ab44e73c6 Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Thu, 15 Feb 2024 02:17:45 -0600 Subject: [PATCH] Add mpris (media player) widget to waybar --- desktop-gruvbox-sway/.config/waybar/config | 17 ++++++++++++++++- desktop-gruvbox-sway/.config/waybar/style.css | 13 ++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/desktop-gruvbox-sway/.config/waybar/config b/desktop-gruvbox-sway/.config/waybar/config index b18bf825..3a0b12d5 100644 --- a/desktop-gruvbox-sway/.config/waybar/config +++ b/desktop-gruvbox-sway/.config/waybar/config @@ -3,7 +3,7 @@ "height": 40, "modules-left": ["sway/workspaces", "sway/mode", "idle_inhibitor"], "modules-center": ["tray"], - "modules-right": ["pulseaudio", "battery", "clock"], + "modules-right": ["mpris", "pulseaudio", "battery", "clock"], "sway/workspaces": { "disable-scroll": true, "persistent_workspaces": { @@ -46,6 +46,21 @@ "format-plugged": "{icon} {capacity}%", "format-icons": ["", "", "", "", ""] }, + "mpris": { + "interval": 1, + "format": "{status_icon} {title} {player_icon}", + "ignored-players": [ + "firefox" + ], + "player-icons": { + "default": "♫" + }, + "status-icons": { + "playing": "⏵", + "paused": "⏸", + "stopped": "⏹" + } + }, "pulseaudio": { "scroll-step": 0, "format": "{icon} {volume}%", diff --git a/desktop-gruvbox-sway/.config/waybar/style.css b/desktop-gruvbox-sway/.config/waybar/style.css index 98a2c4c0..64cb63e4 100644 --- a/desktop-gruvbox-sway/.config/waybar/style.css +++ b/desktop-gruvbox-sway/.config/waybar/style.css @@ -8,7 +8,7 @@ * { border: none; border-radius: 0; - font-family: IBM Plex Sans Medium; + font-family: "IBM Plex Sans Medium"; font-size: 13px; } @@ -48,6 +48,17 @@ window#waybar { padding: 0 1em; color: #ebdbb2; } +#mpris { + padding: 0 1em; +} +#mpris.playing { + background: #d3869b; + color: #282828; +} +#mpris.paused, #mpris.stopped { + background: #32302f; + color: #282828; +} #idle_inhibitor { padding: 0 1em; }