Content added Content deleted
imported>Finn No edit summary |
imported>mutante |
||
Line 35: | Line 35: | ||
</pre> |
</pre> |
||
===''python wallpaper.py''=== gives me: |
===''[[python]] wallpaper.py''=== gives me: |
||
<openbox_pipe_menu> |
<openbox_pipe_menu> |
Revision as of 20:34, 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