You are not logged in.
Hi,
Calling all Openbox users 8)
If you have any tips, tricks, scripts (pipe-menus), themes, links etc...
post them in this thread .....
Mr Green
Offline
I am interested in learning how to make pipe menu's, in python, and can find no guidlines, premade scripts to study, etc... any help?
Offline
#!/usr/bin/env python
# Openbox Music pipe menu maker
import os
import string
import sys
from os.path import isdir
import tag
directory = sys.argv[1] # full path to music files...
program = sys.argv[2]
def genmenu(start, directory):
dirlist = os.listdir(directory)
for d in dirlist:
di = directory + "/" + d
if isdir(di):
print ""
print "<menu id="" + di + "" label="" + d + "">"
genmenu(start, di)
print "</menu>"
fi = string.replace(string.replace(di, directory, ""), "/", "")
fi = fi[:string.rfind(fi, ".")]
print "<item label="" + fi + "">"
print "<action name="Execute"><execute>" + program + " "" + di + ""</execute></action>"
print "</item>"
def main():
tag.menu("start")
start = directory
genmenu(start, directory)
tag.menu("end")
# run the main() function
if __name__ == "__main__":
main()
Something like that ;-)
emmm you might need tag....
!/usr/bin/env python
# usage tag.opact -- or tag.menu("start/end")
def menu(x) :
if x == "start" :
print "<?xml version="1.0" encoding="UTF-8"?>"
print "<openbox_pipe_menu>"
else:
print "</openbox_pipe_menu>"
#end
Hope that helps....
Mr Green
Offline
Offline
Offline
thanks green.
Offline
hmm, I have been going over it, but what does it do? How does it work? I am sorry, but I am new to coding.
Offline
I thought you wanted to just look at some code ... check out the link in my post above, there you will find python scripts & how to use them...
If you get stuck give me a pm...
Mr Green
Offline
I tried to insert wome scripts from here in my menu. But i doesn´t work for me.
Here u can see how i tried to insert
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://openbox.org/
file:///usr/X11R6/share/openbox/menu.xsd">
<menu id="root-menu" label= "openbox3" >
<item label="ob3 Terminal"><action name="Execute"><execute>ob3_term</execute></action></item>
<item label="ob3 Editor"><action name="Execute"><execute>ob3_editor</execute></action></item>
<separator />
<menu id="System Admin" label="System Admin">
<menu id="config" execute="~/.config/openbox/scripts/cfgmenu.py -m"/> <------------THIS HERE IS WHAT I INSERT.
<item label="root terminal"><action name="Execute"><execute>ob3_term -e su</execute></action></item>
<item label="Edit this menu"><action name="Execute"><execute>ob3_editor ~/.config/openbox/menu.xml</execute></action></item>
<item label="Regen this menu"><action name="Execute"><execute>openbox-autogen_menu</execute></action></item>
<item label="Reconfigure ob3"><action name="Reconfigure" /></item>
<item label="edit_fstab"> <action name="Execute"><execute>edit_fstab</execute></action> </item>
<item label="switch2"> <action name="Execute"><execute>switch2</execute></action> </item>
<item label="obconf"> <action name="Execute"><execute>obconf</execute></action> </item>
</menu>
But nothing is shown.
I testes the script on the console and it failed.
$$ python /home/volker/.config/openbox/scripts/cfgmenu.py
Traceback (most recent call last):
File "/home/volker/.config/openbox/scripts/cfgmenu.py", line 196, in ?
main()
File "/home/volker/.config/openbox/scripts/cfgmenu.py", line 161, in main
if sys.argv[1] == "-c":
IndexError: list index out of range
What´s wrong??
Offline
try it with -m
python /home/volker/.config/openbox/scripts/cfgmenu.py -m
in a terminal ;-)
The code in your menu.xml looks right did you reconfigure after adding to menu.xml ?
I add menus in a different way so will have to check it .....
might help to make cfgmenu.py +x as well so it will run
HTH
Mr Green
Offline
ok, thanks, I hadn't been able to get the other site to work till now, thus the question.
Offline
You can find some Openbox pipemenu scripts that I've hacked up here (http://avarice.oneeightseven.org/openbox/scripts). Since I now know there are other Arch users who use Openbox, I'd appreciate it if people could test these and give some feedback.
Offline
those look interesting john, thanks, and they are helping me with understanding making pipe menu's.
Offline
I also just added corresponding screenshots for each script so you can actually see what they do before trying them out.
Offline
I saw, thanks.
Offline
This little script may help :
#!/usr/bin/env ruby
#Openbox todo.rb menu .....
# version 0.0.1 MrGreen (please forgive quality of script)
#
# To use .....
# create a file todo (touch todo) ie /home/foo/.config/openbox/todo
# in menu.xml add <menu id="todo" label="Todo" execute="<path to>/todo.rb" />
# where you want pipe menu to be displayed <menu id="todo" />
# do not forget to chmod +x todo.rb
#
path = "<path to>/todo" # full path to todo file ie /home/foo/.config/openbox/todo
arr = IO.readlines( path )
#menu starts here
print "<?xml version="1.0" encoding="UTF-8"?>"
print "<openbox_pipe_menu>"
print "<item label="Click Here to Edit">n"
# you can change aterm to your favourite terminal or editor
print "<action name="Execute"><execute>aterm -e nano" + path + "</execute></action>n"
print "</item>"
print "<separator/>"
# next line prints out contents of todo file
arr.each { |i| puts "<item label="" + i + ""/>" }
print "</openbox_pipe_menu>n"
# menu end
I hope it works
Added comments might help you understand how pipe menus work, & maybe you will be able to create your own ...do not be put off by ruby, you can use python, bash, java (anything whatever you are happy using ;-))
Enjoy
Mr Green
Offline
I've posted the theme collection I recieved from David Templer. It includes my favorit, "Curdled".
Offline
Thanks!
Edit: Wow, some of those themes need editing... :shock: Either that or they're for use only at whacko high resolutions.
Offline
Thanks!
Edit: Wow, some of those themes need editing... :shock: Either that or they're for use only at whacko high resolutions.
heh. Who knows.. if you want to edit them, go ahead. Send changes
Brice
Offline
http://avarice.oneeightseven.org/openbox/themes/
Another contribution of mine to Openbox resources. Some themes I've made.
Offline
johnisevil: Very nice themes i'm using your "Avarice-Industrial" I had to change the font though a bit too small . Thanks for sharing the themes.
I've only been using OpenBox for around two days and although i really like pypanel, it has problems with japanese text I submitted a bug but does anyone know a quick fix? I kind of doubt it but i thought i might aswell ask.
So for the time being i'm using the xfce4 panel, since i can't find anything as good yet, pypanel was great just lacking support for japanese so It's not much use to me.
Offline
You know, Openbox doesn't need a taskbar/panel - try the middle-click menu. 8)
Johnisevil: Wow... Those themes rock. :shock:
Offline
Thanks guys. A few of these are ports and made to match GTK themes (mainly the Clearlooks and Graphite themes), Austere and Avarice-Industrial are originals. Maybe I'll put up the original Avarice which was made so that a few elements of it could be changed to have it match a GTK theme of your choice.
Offline
YEAH!!!
THIS SITE IS BACK ONLINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
http://denstark.homelinux.org/~tim/openbox.php
:twisted: :shock: :!:
Offline
Gullible Jones: ah thanks. Silly me. :oops: I'm still finding it hard to keep track of some windows, any tips?
Offline