Skip to content

Custom Waybar module (custom/spotify) not displaying despite correct configuration - worked before update #1575

@ftbhabuk

Description

@ftbhabuk

Description

The custom Waybar Spotify module stopped working after a system update. The module is properly configured and the script executes successfully when run manually, but Waybar refuses to display it. Other Waybar layouts (default HyDE configurations) show Spotify information correctly, indicating the issue is specific to custom layout configurations.

Key Point: Even a simple test module with hardcoded text output fails to display, suggesting a deeper issue with custom module rendering in this layout configuration.

Steps to Reproduce

  1. Configure custom Waybar layout with the following structure:
    • Use group/pill#left grouping
    • Add "custom/spotify" to the modules array
  2. Define the custom module in ~/.config/waybar/config.jsonc:
   "custom/spotify": {
       "exec": "/usr/bin/python3 /home/bbook/.local/lib/hyde/mediaplayer.py",
       "return-type": "json",
       "format": "{}"
   }
  1. Ensure module is listed in modules array:
   "modules": ["cpu", "memory", "wlr/taskbar", "custom/spotify"]
  1. Restart Waybar: killall waybar && waybar &
  2. Observe that the custom/spotify module does not appear anywhere in the bar

Also tested simplified version:

"custom/spotify": {
    "exec": "echo '{\"text\":\"🎵 TEST\"}'",
    "return-type": "json",
    "format": "{}"
}

This also fails to display.

Expected Behavior

The Waybar Spotify module should display currently playing track information from Spotify/Spicetify and other additional infos.

Actual Behavior

Nothing displays - the custom/spotify module is completely invisible:

  • No text appears in the bar
  • No space allocated for the module
  • Module acts as if it doesn't exist
  • Other modules (cpu, memory, taskbar) display correctly in the same group

Script verification (works perfectly when run manually):

$ /usr/bin/python3 /home/bbook/.local/lib/hyde/mediaplayer.py
{"text": "\uf001\u2004\u2004<i>Coldplay</i>\u2004\uf444 <b>Yellow</b>", "class": "custom-spotify", "alt": "spotify", "tooltip": "<span foreground=\"#FFFFFF\"><b>Yellow</b></span>\n<span foreground=\"#B8AAF0\"><i>Coldplay</i>
# Continues outputting JSON every second

Simplified test also works when run manually:

$ echo '{"text":"🎵 TEST"}'
{"text":"🎵 TEST"}  # Valid JSON output

Yet Waybar doesn't display either of them.

Waybar logs show:

(waybar:1364020): GLib-GObject-CRITICAL **: 17:39:13.059: invalid (NULL) pointer instance
(waybar:1364020): GLib-GObject-CRITICAL **: 17:39:13.059: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
[2026-01-27 17:39:13.155] [error] spotify stopped unexpectedly, is it endless?

Despite the script running successfully when executed directly.

Screenshots

Image Image

Environment

hyprland_systeminfo.txt

Additional Information

Timeline

  • Before update: Custom Spotify module worked perfectly in this exact configuration
  • After update: Module completely stopped displaying (exact package/date unknown, but recent)
  • Current status: Script works, config is valid, but Waybar won't render the module

Exhaustive Troubleshooting Attempts

✅ Verified Script Works

  • Runs without errors when executed directly
  • Outputs valid, continuous JSON stream
  • python-gobject dependency installed and working (import gi succeeds)
  • playerctl installed and functional

✅ Tried Multiple Module Configurations

Path variations (ALL FAILED):

  1. Original relative path: mediaplayer.py
  2. Home directory path: ~/.local/lib/hyde/mediaplayer.py
  3. Absolute path: /home/bbook/.local/lib/hyde/mediaplayer.py
  4. Full explicit paths with interpreter:
   "exec": "/usr/bin/python3 /home/bbook/.local/lib/hyde/mediaplayer.py"

(Specifically tried this thinking path resolution was the issue - FAILED)

Parameter combinations tried (ALL FAILED):

  1. With "return-type": "json"
  2. With "restart-interval": 5" (incorrect parameter)
  3. With "interval": 1
  4. Without any interval (streaming output)
  5. With "escape": true
  6. Various "format" strings

Module placement attempts (ALL FAILED):

  1. Added to group/pill#left modules array
  2. Tried adding to group/pill#right modules array
  3. Tried different positions in the modules array

Simplified test (ALSO FAILED):

"custom/spotify": {
    "exec": "echo '{\"text\":\"🎵 TEST\"}'",
    "return-type": "json",
    "format": "{}"
}

Even this trivial hardcoded test fails to display, ruling out any script-specific issues.

✅ Config Structure Verified

  • Module properly defined in main config file
  • Module name added to modules array: ["cpu", "memory", "wlr/taskbar", "custom/spotify"]
  • JSON syntax validated with jq . (no parsing errors)
  • Config includes work correctly (other modules from includes display fine)
  • Restarted Waybar multiple times after each change
  • Tried defining module both inline and in separate include files

✅ Comparison Testing

  • Default HyDE Waybar layouts: Spotify displays correctly ✅
  • Other default Waybar configs: Show Spotify info perfectly ✅
  • This custom layout: Spotify doesn't display at all ❌
  • Other custom modules in same config: Work fine ✅
    • custom/cpuinfo - works
    • custom/gpuinfo - works
    • custom/swaync - works
    • custom/hyde-menu - works
    • custom/power - works
  • Only custom/spotify is invisible in this specific layout

Critical Observations

  1. Path specification doesn't matter:

    • Tried relative paths
    • Tried ~ expansion paths
    • Tried absolute paths (/home/bbook/...)
    • Tried full interpreter + script paths (/usr/bin/python3 /home/bbook/...)
    • ALL FAILED identically - no difference in behavior
  2. Even trivial test fails:

   "exec": "echo '{\"text\":\"🎵 TEST\"}'"

This completely rules out ANY script-specific issues (dependencies, permissions, execution, JSON format, etc.). The problem is with Waybar's module rendering itself.

  1. Other custom modules work in same config:

    • Multiple other custom/* modules work fine
    • They use similar JSON output formats
    • They're in the same config file
    • Only custom/spotify specifically doesn't render

    This proves custom modules CAN work in this config, but something specifically breaks when the module is named custom/spotify.

  2. Works in other Waybar configs:

    • Default HyDE layouts show Spotify perfectly
    • Same script, same system, different config file
    • Suggests issue is configuration-specific, not system-wide

Current Config Structure

{
  "layer": "top",
  "output": ["*"],
  "height": 10,
  "exclusive": true,
  "passthrough": false,
  "reload_style_on_change": true,
  "include": [
    "$XDG_CONFIG_HOME/waybar/modules/*json*",
    "$XDG_CONFIG_HOME/waybar/includes/includes.json"
  ],
  "modules-left": ["group/pill#left"],
  "group/pill#left": {
    "orientation": "inherit",
    "modules": ["cpu", "memory", "wlr/taskbar", "custom/spotify"]
  },
  "modules-center": ["group/pill#center"],
  "group/pill#center": {
    "orientation": "inherit",
    "modules": ["idle_inhibitor", "clock"]
  },
  "modules-right": ["group/pill#right"],
  "group/pill#right": {
    "orientation": "inherit",
    "modules": [
      "privacy", "tray", "network", "custom/bluetooth",
      "pulseaudio#microphone", "battery",
      "custom/gpuinfo", "custom/cpuinfo",
      "custom/swaync", "custom/hyde-menu", "custom/power"
    ]
  },
  "custom/spotify": {
    "exec": "/usr/bin/python3 /home/bbook/.local/lib/hyde/mediaplayer.py",
    "return-type": "json",
    "format": "{}"
  }
}

I'm completely stuck. The script works, the config looks correct, other modules work, but this specific module just won't display. Any help would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions