From fdfcb750e36cda2c5cf796956bdc1cdec852e949 Mon Sep 17 00:00:00 2001 From: juan Date: Fri, 3 Sep 2021 11:43:21 +0800 Subject: [PATCH] waybar use playerctl for music --- .config/sway/config##hostname.T14s | 4 ++- .config/waybar/config | 39 +++++------------------------- .config/waybar/style.css | 4 +-- 3 files changed, 11 insertions(+), 36 deletions(-) diff --git a/.config/sway/config##hostname.T14s b/.config/sway/config##hostname.T14s index 1814f91..96ea496 100644 --- a/.config/sway/config##hostname.T14s +++ b/.config/sway/config##hostname.T14s @@ -11,10 +11,12 @@ output * bg $(find ~/Pictures/Wallpapers/ -type f | shuf -n1) fill ##starting userspace software exec wlsunset -l 30.4 -L 104.0 -T 6500 -t 3500 +exec light -S 70 exec --no-startup-id pipewire exec mako -exec light -S 70 exec mpd +exec ~/.cache/go/bin/mpd-mpris +exec playerctld daemon #my keybinds diff --git a/.config/waybar/config b/.config/waybar/config index bb98189..d93dc46 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -4,39 +4,7 @@ // Choose the order of the modules "modules-left": ["sway/workspaces", "sway/window"], "modules-center": [], - "modules-right": ["tray","mpd","custom/weather","network","battery","clock"], - "mpd": { - "format": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} {stateIcon}", - "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", - "format-disconnected": "Disconnected ", - "unknown-tag": "N/A", - "interval": 2, - "consume-icons": { - "on": " " - }, - "random-icons": { - "on": " " - }, - "repeat-icons": { - "on": " " - }, - "single-icons": { - "on": "1 " - }, - "state-icons": { - "paused": "", - "playing": "" - }, - "tooltip-format": "MPD (connected)", - "tooltip-format-disconnected": "MPD (disconnected)" - }, - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "" - } - }, + "modules-right": ["tray","custom/player","custom/weather","network","battery","clock"], "tray": { "spacing": 10 }, @@ -69,5 +37,10 @@ "custom/weather": { "exec": "sleep 10 && curl 'wttr.in/?format=%t+(%f)+%c' || echo 'No weather data '", "interval": 1800 + }, + "custom/player": { + "exec": "playerctl metadata --format '{{uc(playerName)}}: {{ artist }} - {{ album }} - {{ title }} {{emoji(status)}}'", + "interval": 10, + "on-click": "playerctl play-pause" } } diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 5087362..8df69fe 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -38,7 +38,7 @@ window#waybar { #clock, #battery, #network, -#mpd, +#custom-player, #custom-weather { background-color: #161821; padding: 0px 10px; @@ -70,7 +70,7 @@ window#waybar { animation-direction: alternate; } -#mpd { +#custom-player { border-radius: 2px 0px 0px 2px; margin-left: 10px; }