Content added Content deleted
imported>Finn No edit summary |
imported>Finn mNo edit summary |
||
Line 1: | Line 1: | ||
===wallpapers are in /home/finn/pictures/wallpaper === |
|||
das menu erzeugt zwar "wallpaper" aber dieses submenu bleibt leer. |
|||
in /home/finn/pictures/wallpaper befinden sich die bilder (teils jpg, teils png). |
|||
⚫ | |||
⚫ | |||
... |
... |
||
<menu id="Debian" /> |
<menu id="Debian" /> |
||
Line 11: | Line 9: | ||
<menu id="client-list-menu" /> |
<menu id="client-list-menu" /> |
||
<separator /> |
<separator /> |
||
<menu id="wallpapers" label="wallpapers" execute="~/home/finn/.config/openbox/wallpaper.py" /> |
'''<menu id="wallpapers" label="wallpapers" execute="~/home/finn/.config/openbox/wallpaper.py" />''' |
||
- <item label="ObConf"> |
- <item label="ObConf"> |
||
... |
... |
||
Line 33: | Line 31: | ||
</item>''' % (name, pic) |
</item>''' % (name, pic) |
||
print '</openbox_pipe_menu>' |
print '</openbox_pipe_menu>' |
||
===''python wallpaper.py''=== gives me: |
|||
<openbox_pipe_menu> |
|||
Trackback (most recent call last): |
|||
File "wallpaper.py", line 9, in = |
|||
for pic in wallpapers: |
|||
TypeError: iteration over non-sequence |
|||
__NOTOC__ |
Revision as of 20:01, 25 July 2005
wallpapers are in /home/finn/pictures/wallpaper
... <menu id="Debian" /> <separator /> <menu id="client-list-menu" /> <separator /> <menu id="wallpapers" label="wallpapers" execute="~/home/finn/.config/openbox/wallpaper.py" /> - <item label="ObConf"> ...
/home/finn/.config/openbox/wallpaper.py :
#!/usr/bin/python # Generates a dynamic menu import glob wallpapers = glob.glob('/home/finn/pictures/wallpaper/*').sort() #wallpapers.sort() print '<openbox_pipe_menu>' for pic in wallpapers: name = pic.split('/')[-1] print <item label="%s"> <action name="Execute"><execute>Esetroot -scale %s</execute></action> </item> % (name, pic) print '</openbox_pipe_menu>'
===python wallpaper.py=== gives me:
<openbox_pipe_menu> Trackback (most recent call last): File "wallpaper.py", line 9, in = for pic in wallpapers: TypeError: iteration over non-sequence