feat(custom): make spotify module generic

Set class via json attribute
Choose icon via alt attribute
This commit is contained in:
Sibren Vasse
2019-03-31 16:12:38 +02:00
parent 618fe80670
commit 0f689b733d
3 changed files with 33 additions and 14 deletions

View File

@ -4,7 +4,7 @@
// "height": 30, // Waybar height
// "width": 1280, // Waybar width
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "custom/spotify"],
"modules-left": ["sway/workspaces", "sway/mode", "custom/media"],
"modules-center": ["sway/window"],
"modules-right": ["idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "battery#bat2", "clock", "tray"],
// Modules configuration
@ -95,9 +95,14 @@
},
"on-click": "pavucontrol"
},
"custom/spotify": {
"format": " {}",
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
}