🐛 fix(waybar): custom-music module now works correctly

This commit is contained in:
Sergio Laín 2024-10-15 09:51:01 +02:00
parent c0b455bb06
commit 81dabd6bca
No known key found for this signature in database
GPG key ID: 51BB28D8B42FB438
4 changed files with 9 additions and 14 deletions

View file

@ -3,7 +3,7 @@
"~/.config/waybar/modules/custom-cava.jsonc",
"~/.config/waybar/modules/custom-wf-recorder.jsonc",
"~/.config/waybar/modules/custom-updates.jsonc",
"~/.config/waybar/modules/custom-media.jsonc",
"~/.config/waybar/modules/custom-music.jsonc",
"~/.config/waybar/modules/custom-logo.jsonc",
"~/.config/waybar/modules/custom-notifications.jsonc",
"~/.config/waybar/modules/custom-weather.jsonc",
@ -18,7 +18,7 @@
"custom/cava",
"custom/wf-recorder",
],
"modules-center": ["custom/media"],
"modules-center": ["custom/music"],
"modules-right": [
"custom/updates",
"hyprland/language",

View file

@ -1,14 +1,11 @@
{
"custom/media": {
"format": "{icon} {}",
"custom/music": {
"format": "{0}",
"return-type": "json",
"max-length": 100,
"format-icons": {
"spotify": " ",
"default": " ",
},
"escape": true,
"exec": "$HOME/.config/waybar/scripts/mediaplayer.py 2> /dev/null",
"tooltip": true,
"exec": "~/.config/waybar/scripts/mediaplayer.py --player spotify",
"on-click": "playerctl play-pause",
"on-scroll-up": "playerctl next",
"on-scroll-down": "playerctl previous",

View file

@ -135,9 +135,7 @@ class PlayerManager:
track_info = title
if track_info:
if player.props.status == "Playing":
track_info = "" + track_info
else:
if player.props.status != "Playing":
track_info = "" + track_info
# only print output if no other player is playing
current_playing = self.get_first_playing_player()

View file

@ -39,7 +39,7 @@
#cpu,
#memory,
#temperature,
#custom-media,
#custom-music,
#custom-fans,
#clock,
#idle_inhibitor,
@ -252,7 +252,7 @@ window#waybar.hidden {
color: @mantle;
}
#custom-media {
#custom-music {
background: @lavender;
background: linear-gradient(
52deg,