You are not logged in.

#1 2012-11-26 16:36:15

t0m5k1
Member
From: overthere
Registered: 2012-02-10
Posts: 326

[SOLVED] problems with openbox pipemenu for mpd

Hey Archers,

I have had this issue for ages now & cannot seem to resolve it.
I have tried the following python scripts as pipemenus :
http://zhar.net/projects/openbox/ob-mpd.py

http://david.chalkskeletons.com/scripts/ob-mpd-0.3.py

incorporated in to the menu.xml thus:

<menu id="root-menu-701353" label="Music Controls">
		<menu id="mpd" label="MPD" execute="~/.config/openbox/ob-mpd.py" />
</menu>

OR

<menu id="root-menu-701353" label="Music Controls">
			<menu id="mpd" label="MPD" execute="~/.config/openbox/ob-mpd-0.3.py" />
</menu>

but alas they both fail & just give the following openbox error:

Invalid output from pipe-menu "/home/t0m5k1/.config/openbox/ob-mpd.py"

and

Invalid output from pipe-menu "/home/t0m5k1/.config/openbox/ob-mpd-0.3.py"

when I run them from term I get the following:

┌─[t0m5k1@b0x] 
└─[~/.config/openbox]> ./ob-mpd.py 
  File "./ob-mpd.py", line 81
    print action % ('MPD is not running  [start]','start')
               ^
SyntaxError: invalid syntax
┌─[t0m5k1@b0x] 
└─[~/.config/openbox]> ./ob-mpd-0.3.py 
  File "./ob-mpd-0.3.py", line 88
    print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                                                     ^
SyntaxError: invalid syntax

I am sorry but my python skills are non existent so I do not even know if this error is correct sad

are any of you guy's using these with any sucsess?

I really am stuck & have no way forward, I use conky to display what the current status of mpd is & really just need a way to control it in openbox & was hoping one of these would work & have tried to look for alternatives but these seem to be the only option.

any advice is very appreciated.

Last edited by t0m5k1 (2012-11-27 06:01:13)


Aurora R10 (0TYR0X) - Ryzen 7 5800X - 16GB - RX6700XT 12GB - Hyprland (occasionally XFCE) - AOC Q27G3XMN 1440P
EFI Stub Boot
PROUD XLIBRE USER
Linux User: 401820  Steam-Reddit

Offline

#2 2012-11-26 23:25:19

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [SOLVED] problems with openbox pipemenu for mpd

first script works. install python2-mpdclient2 and change the shebang of the script to python2

Last edited by Rasi (2012-11-26 23:28:52)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#3 2012-11-27 06:00:41

t0m5k1
Member
From: overthere
Registered: 2012-02-10
Posts: 326

Re: [SOLVED] problems with openbox pipemenu for mpd

doh! such a simple fix lol caused me many a head scratch, I guess it's time I learn python!
Thank You so much Rasi

FYI to anyone who wants to use this script/pipemenu with a remote instance of mpd add this to line 47:

mpdHost = '192.168.1.250'

obviously change the IP to suit!
then edit line 70 to the following:

    server = mpdclient2.connect(host=mpdHost,port=mpdPort)

Aurora R10 (0TYR0X) - Ryzen 7 5800X - 16GB - RX6700XT 12GB - Hyprland (occasionally XFCE) - AOC Q27G3XMN 1440P
EFI Stub Boot
PROUD XLIBRE USER
Linux User: 401820  Steam-Reddit

Offline

#4 2012-11-27 17:23:52

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [SOLVED] problems with openbox pipemenu for mpd

actually it also works by exporting the MPD_HOST variable


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

Board footer

Powered by FluxBB