You are not logged in.
Hey Team,
First off, epic thanks to mrneilypops for Sidbox, what an awesome distro.
I'm trying to incorporate elements of mrneilypops' Sidbox Openbox menu into mine.
I have a couple of questions as I am totally confused.
First off, links to the menu.xml:
Dobbie's menu.xml
mrneilypops menu.xml
I have scripts all set and in their correct folders. Is there something I am missing for this to work?
This is what I get as an error message for each issue (which is the sysinfo and places):
sysinfo:
Invalid output from the pipe-menu "perl /home/dobbie/.config/openbox/scripts/obsysinfo.pl"
Places menu:
Invalid output from pipe-menu "perl /home/dobbie/.config/openbox/scripts/places.py menu"
Do I have to use these menus as pipe menus? Is there something I need to install for pipemenus to work?
Just in case, the scripts:
obsysinfo.pl
places.py
Cheers in advance.
A very confused Dobbie (no, not the house elf).
Last edited by Döbbie03 (2017-01-25 22:58:48)
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
Do you need to explicitly use a shell command to run the script? Something like...
<menu execute="sh -c 'perl /home/dobbie/.config/openbox/scripts/obsysinfo.pl'" id="sysinfo" label="Sysinfo"/>
NB not tested
Last edited by damo (2017-01-23 20:31:27)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Unfortunately that removed the entry completely from the menu.
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
Any useful information if you run the pipemenu in a terminal? It should output the formatted xml.
Those fullstops at the start of the perl script print lines - is that perl syntax?
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
This is what I get (after installing XML::Simple module)
damo@graphix ~ $ perl ~/tmp/obsysinfo.pl
Use of uninitialized value in split at /home/damo/tmp/obsysinfo.pl line 29.
Use of uninitialized value $load in scalar chop at /home/damo/tmp/obsysinfo.pl line 30.
Warning: <font> element has non-unique value in 'name' key attribute: Sans at /home/damo/tmp/obsysinfo.pl line 51.
Warning: <font> element has non-unique value in 'name' key attribute: Sans at /home/damo/tmp/obsysinfo.pl line 51.
Warning: <font> element has non-unique value in 'name' key attribute: Sans at /home/damo/tmp/obsysinfo.pl line 51.
Warning: <font> element has non-unique value in 'name' key attribute: Sans at /home/damo/tmp/obsysinfo.pl line 51.
Warning: <font> element has non-unique value in 'name' key attribute: Sans at /home/damo/tmp/obsysinfo.pl line 51.
Use of uninitialized value $load in concatenation (.) or string at /home/damo/tmp/obsysinfo.pl line 67.
<?xml version="1.0" encoding="UTF-8"?>
<openbox_pipe_menu>
<item label="+ damo@graphix +" />
<separator /><item label="OS: Linux GNU/Linux x86_64 " />
<item label="Kernel: 4.4.0-21-generic " />
<item label="Uptime: 21:11:09 " />
<item label="Load: " />
<item label="Mem: 602 MB" />
<item label="Theme: FlatSlate " />
<separator /><item label="+ 01/23/17, 21:11 +" />
</openbox_pipe_menu>
And the menu entry appears OK with
<menu execute="perl /home/damo/tmp/obsysinfo.pl" id="sysinfo" label="Sysinfo"/>
Last edited by damo (2017-01-23 21:17:26)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Thanks Damo, I discovered I needed to install perl-xml-simple. Now the systeminfo is working.
Just need to sort the places menu.
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
When I call the places.py in the terminal, I get this error:
File "places.py", line 78
print '<openbox_pipe_menu>'
^
SyntaxError: Missing parentheses in call to 'print'
Not too sure what that means.
Another thing I would like to do is to execute an update in the terminal using the obmenu. I have an alias in .zshrc called syua which calls "pacaur -Syua". Any ideas how to do this, currently I have this:
urxvt -e --command="syua"
Which doesn't work. I have had a Google but no luck or I am asking Google the wrong thing.
Last edited by Döbbie03 (2017-01-23 23:00:09)
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
It is a python script, so use python
"python /home/dobbie/.config/openbox/scripts/places.py menu"
Or make the scripts executable, put them in ~/bin, and drop the perl/python commands in menu.xml
Last edited by damo (2017-01-23 23:10:45)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Okay, so I have put the script in ~/bin and I still get this error:
Invalid output from pipe-menu ...
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
Okay, so I have put the script in ~/bin and I still get this error:
Invalid output from pipe-menu ...
Have you made the script executable? Is ~/bin in your $PATH? Did you edit your menu.xml to
<menu execute="places.py" id="pipe-places" label="Places"/>
BTW I just noticed that this is wrong:
<menu execute="perl ~/.config/openbox/scripts/places.py menu" id="pipe-places" label="Places"/>
^
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Thanks for your patience damo.
Yes, script is executable. The path is /bin/places.py
This is what I have in my menu.xml:
<menu execute="python /bin/places.py" id="pipe-places" label="Places"/>
Cheers
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
When I run the script from the terminal I get this error:
File "places.py", line 78
print '<openbox_pipe_menu>'
^
SyntaxError: Missing parentheses in call to 'print'
This is what is contained from line 78 onward in the script:
print '<openbox_pipe_menu>'
# Each item becomes a menu entry
for i in items:
print '<item label="' + i + '">'
print '<action name="Execute">'
print '<execute>'
print manager + " " + i
print '</execute>'
print '</action>'
print '</item>'
print '</openbox_pipe_menu>'
Could this have something to do with the issue?
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
I put your places.py in my ~/tmp directory, and added this to my menu.xml:
<menu execute="python ~/tmp/places.py" id="places" label="Places"/>
(If you use the python command there is no need to make the script executable BTW)
It runs OK and outputs the places menu...
I think the bl-places-pipemenu is much superior though
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Are you running python3? In which case the print statement has been replaced by a print() function.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
I don't know what the hell is going on, I am still getting the same error as before.
I'm going to try and install the BL Pipemenus from the AUR again. I am having issues with that as well.
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
Are you running python3? In which case the print statement has been replaced by a print() function.
Try python3 syntax in places.py:
# Output xml for the openbox menu
print('<openbox_pipe_menu>')
# Each item becomes a menu entry
for i in items:
print ('<item label="',i,'">')
print ('<action name="Execute">')
print ('<execute>')
print (manager,'" "',i)
print ('</execute>')
print ('</action>')
print ('</item>')
print ('</openbox_pipe_menu>')
It works for me when I have
<menu execute="python3 ~/tmp/places.py" id="places" label="Places"/>
You could also try running the original script with
<menu execute="python2.7 /bin/places.py" id="pipe-places" label="Places"/>
Last edited by damo (2017-01-24 00:47:10)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
damo wrote:Are you running python3? In which case the print statement has been replaced by a print() function.
Try python3 syntax in places.py:
# Output xml for the openbox menu print('<openbox_pipe_menu>') # Each item becomes a menu entry for i in items: print ('<item label="',i,'">') print ('<action name="Execute">') print ('<execute>') print (manager,'" "',i) print ('</execute>') print ('</action>') print ('</item>') print ('</openbox_pipe_menu>')
It works for me when I have
<menu execute="python3 ~/tmp/places.py" id="places" label="Places"/>
You could also try running the original script with
<menu execute="python2.7 /bin/places.py" id="pipe-places" label="Places"/>
Finally! It works!
Thanks damo!
This worked a treat:
<menu execute="python2.7 /bin/places.py" id="pipe-places" label="Places"/>
I was just about to give up.
Thanks for your patience with a dumbass such as myself. Very much appreciated.
Last edited by Döbbie03 (2017-01-24 01:00:29)
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
Woo Hoo!
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Woo Hoo!
So happy!
Now to finish off calling commands from obmenu.
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Online
...
Another thing I would like to do is to execute an update in the terminal using the obmenu. I have an alias in .zshrc called syua which calls "pacaur -Syua". Any ideas how to do this, currently I have this:
urxvt -e --command="syua"
Which doesn't work. I have had a Google but no luck or I am asking Google the wrong thing.
^ -e | --command are alternatives. Don't try to use both
This is where my head starts to hurt a bit.... shell functions and aliases are limited to the shell, and don't work in executed shell scripts. You might be able to source the alias in the command (NB untested) (Tested, doesn't work)
urxvt --command="source .zshrc && syua"
But why not just use the full command, since you aren't having to type it in the terminal? (Add sudo if that is needed)
urxvt --command="pacaur -Syua"
or
urxvt -e pacaur -Syua
Last edited by damo (2017-01-24 02:05:49)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline