Content added Content deleted
imported>Finn No edit summary |
imported>Finn mNo edit summary |
||
Line 1:
===wallpapers are in /home/finn/pictures/wallpaper ===
▲===menu.xml auszug:===
...
<menu id="Debian" />
Line 11 ⟶ 9:
<menu id="client-list-menu" />
<separator />
'''<menu id="wallpapers" label="wallpapers" execute="~/home/finn/.config/openbox/wallpaper.py" />'''
- <item label="ObConf">
...
Line 33 ⟶ 31:
</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
__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