Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default custom/media module not working with default script #3757

Open
Manah7 opened this issue Nov 10, 2024 · 4 comments
Open

Default custom/media module not working with default script #3757

Manah7 opened this issue Nov 10, 2024 · 4 comments
Labels
bug Something isn't working custom sway

Comments

@Manah7
Copy link

Manah7 commented Nov 10, 2024

Hello all,

I am using the default custom/media module with the default mediaplayer.py file, but nothing show up.

Here is the module from my config.jsonc:

    "custom/media": {
        "format": "{icon} {}",
        "format-alt": "{} ",
        "return-type": "json",
        "max-length": 40,
        "format-icons": {
            "spotify": "🎜",
            "default": "🎜"
        },
        "escape": true,
        "exec": "~/.config/waybar/mediaplayer.py" // Script in resources folder
    },

The script itself works great:

$ ~/.config/waybar/mediaplayer.py
{"text": "\uf28b John D. Boswell - Ether", "class": "custom-spotify", "alt": "spotify"}

I have done different tests, the most interesting one is that if I create a ~/.config/waybar/test.sh file like this one :

#!/bin/bash

echo '{"text": "\uf28b John D. Boswell - Ether", "class": "custom-spotify", "alt": "spotify"}'

and change

"exec": "~/.config/waybar/mediaplayer.py"

to

"exec": "~/.config/waybar/test.sh" 

the custom/media module appear ! So it seems linked to the mediaplayer.py file, which works great by itself... So strange ! Moreover, when sway and waybar are loaded, the script correctly runs :

$ ps -ef | grep media
manah      27465   27447  0 11:23 tty2     00:00:00 python3 /home/manah/.config/waybar/mediaplayer.py

How can I debug this ?

Some info:

$ waybar --version
Waybar v0.11.0
$ sway --version
sway version 1.10
@github-actions github-actions bot added bug Something isn't working custom sway labels Nov 10, 2024
@Shoxx98
Copy link

Shoxx98 commented Nov 12, 2024

experiencing the same issue with nothing showing up. have not tested beyond that though.

@Shoxx98
Copy link

Shoxx98 commented Nov 12, 2024

#3623
found a fix for this
Edit: fix -> workaround

@Manah7
Copy link
Author

Manah7 commented Nov 13, 2024

Yes, this is a working workaround, tldr :

Change:

"custom/media": {
        "format": "{icon} {}",

to:

"custom/media": {
        "format": "{0} {1}",

@dannightmare
Copy link

#3425 Seems related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working custom sway
Projects
None yet
Development

No branches or pull requests

3 participants