You are not logged in.

#1 2005-07-20 10:04:33

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,753

Openbox Resource Thread 2

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

#2 2005-07-20 17:35:01

jellywerker
Member
From: Sunny Seattle
Registered: 2005-04-04
Posts: 286

Re: Openbox Resource Thread 2

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

#3 2005-07-20 19:04:16

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,753

Re: Openbox Resource Thread 2

#!/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

#4 2005-07-21 16:34:56

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,753

Re: Openbox Resource Thread 2


Mr Green

Offline

#6 2005-07-21 21:49:33

jellywerker
Member
From: Sunny Seattle
Registered: 2005-04-04
Posts: 286

Re: Openbox Resource Thread 2

thanks green.

Offline

#7 2005-07-22 05:21:55

jellywerker
Member
From: Sunny Seattle
Registered: 2005-04-04
Posts: 286

Re: Openbox Resource Thread 2

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

#8 2005-07-22 06:49:13

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,753

Re: Openbox Resource Thread 2

I thought you wanted to just look at some code  smile  ... 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...  wink


Mr Green

Offline

#9 2005-07-22 08:01:58

Legout
Member
From: Wuerburg/germany
Registered: 2004-01-19
Posts: 292

Re: Openbox Resource Thread 2

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

#10 2005-07-22 09:01:59

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,753

Re: Openbox Resource Thread 2

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

#11 2005-07-22 17:22:04

jellywerker
Member
From: Sunny Seattle
Registered: 2005-04-04
Posts: 286

Re: Openbox Resource Thread 2

ok, thanks, I hadn't been able to get the other site to work till now, thus the question.

Offline

#12 2005-07-22 17:30:15

johnisevil
Member
From: Hamilton, ON Canada
Registered: 2003-08-07
Posts: 221
Website

Re: Openbox Resource Thread 2

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

#13 2005-07-22 17:42:45

jellywerker
Member
From: Sunny Seattle
Registered: 2005-04-04
Posts: 286

Re: Openbox Resource Thread 2

those look interesting john, thanks, and they are helping me with understanding making pipe menu's.

Offline

#14 2005-07-22 17:45:01

johnisevil
Member
From: Hamilton, ON Canada
Registered: 2003-08-07
Posts: 221
Website

Re: Openbox Resource Thread 2

I also just added corresponding screenshots for each script so you can actually see what they do before trying them out.

Offline

#15 2005-07-22 17:54:51

jellywerker
Member
From: Sunny Seattle
Registered: 2005-04-04
Posts: 286

Re: Openbox Resource Thread 2

I saw, thanks.

Offline

#16 2005-07-23 16:04:42

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,753

Re: Openbox Resource Thread 2

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  lol

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

#17 2005-08-01 12:49:57

nesta
Member
From: Nashville
Registered: 2003-11-21
Posts: 29

Re: Openbox Resource Thread 2

I've posted the theme collection I recieved from David Templer. It includes my favorit, "Curdled".


http://www.iceburg.net/~nesta/ob3/

Offline

#18 2005-08-01 16:20:57

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Openbox Resource Thread 2

Thanks!

Edit: Wow, some of those themes need editing... :shock: Either that or they're for use only at whacko high resolutions.

Offline

#19 2005-08-04 13:57:10

nesta
Member
From: Nashville
Registered: 2003-11-21
Posts: 29

Re: Openbox Resource Thread 2

Gullible Jones wrote:

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 wink

Brice

Offline

#20 2005-08-04 19:19:48

johnisevil
Member
From: Hamilton, ON Canada
Registered: 2003-08-07
Posts: 221
Website

Re: Openbox Resource Thread 2

http://avarice.oneeightseven.org/openbox/themes/

Another contribution of mine to Openbox resources.  Some themes I've made.

Offline

#21 2005-08-04 21:42:33

Lowe
Member
Registered: 2005-07-11
Posts: 89

Re: Openbox Resource Thread 2

johnisevil: Very nice themes i'm using your "Avarice-Industrial" I had to change the font though a bit too small wink . 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

#22 2005-08-04 22:52:42

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Openbox Resource Thread 2

You know, Openbox doesn't need a taskbar/panel - try the middle-click menu. 8)

Johnisevil: Wow... Those themes rock. :shock:

Offline

#23 2005-08-05 03:00:32

johnisevil
Member
From: Hamilton, ON Canada
Registered: 2003-08-07
Posts: 221
Website

Re: Openbox Resource Thread 2

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

#24 2005-08-05 07:47:11

Legout
Member
From: Wuerburg/germany
Registered: 2004-01-19
Posts: 292

Re: Openbox Resource Thread 2

YEAH!!!

THIS SITE IS BACK ONLINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

http://denstark.homelinux.org/~tim/openbox.php

:twisted:  lol  smile  big_smile  :shock:  tongue  :!:

Offline

#25 2005-08-05 08:17:52

Lowe
Member
Registered: 2005-07-11
Posts: 89

Re: Openbox Resource Thread 2

Gullible Jones: ah thanks. Silly me. :oops: I'm still finding it hard to keep track of some windows, any tips?

Offline

Board footer

Powered by FluxBB