From baebc58472716b3f211506cbaf89ad82ffbeeb0f Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Sun, 10 Sep 2023 23:25:28 +0530 Subject: .config: waybar adding playerctl module for spotify --- .config/waybar/config.jsonc | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to '.config/waybar') diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index 01bf558..0c42d02 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -12,10 +12,13 @@ "passthrough": false, "modules-left": [ "custom/launcher", - "hyprland/workspaces" + "hyprland/workspaces", + "custom/playerctl", + "custom/playerlabel" ], "modules-center": [ - "hyprland/window" + "hyprland/window", + "idle_inhibitor" ], "modules-right": [ "cpu", @@ -69,6 +72,32 @@ "deactivated": "" } }, + "custom/playerctl": { + "format": "{icon}", + "return-type": "json", + "max-length": 64, + "exec": "playerctl -p spotify metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F", + "on-click-middle": "playerctl -p spotify play-pause", + "on-click": "playerctl -p spotify previous", + "on-click-right": "playerctl -p spotify next", + "format-icons": { + "Playing": "󰒮 󰏥 󰒭", + "Paused": "󰒮 󰐌 󰒭" + } + }, + "custom/playerlabel": { + "format": "{}", + "return-type": "json", + "max-length": 48, + "exec": "playerctl -p spotify metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F", + "on-click-middle": "playerctl -p spotify play-pause", + "on-click": "playerctl -p spotify previous", + "on-click-right": "playerctl -p spotify next", + "format-icons": { + "Playing": "󰒮 󰐌 󰒭", + "Paused": "󰒮 󰏥 󰒭" + } + }, "cpu": { "interval": 1, "format": "󰍛 {usage}% ", -- cgit v1.2.3