]> git.draconx.ca Git - fvwmconf.git/blobdiff - common/wallpaper
Add wallpaper setting to SessionInitFunction as well as InitFunction.
[fvwmconf.git] / common / wallpaper
index 46a3e4d56b013ef1d76e00fd2ad2c37d0048af47..b858eb40bbecb520e83efb8a7b5686cbc8eec273 100644 (file)
@@ -1,6 +1,6 @@
 # Stuff to handle pretty pictures on the background.
 SetEnv SETROOT "fvwm-root -r"
-SetEnv BGFILE  "$[FVWM_USERDIR]/wallpaper$[screen].png"
+SetEnv BGFILE  "$[FVWM_USERDIR]/.state/wallpaper$[screen].png"
 SetEnv BGROOT  "$[HOME]/wallpaper"
 
 CopyMenuStyle * MenuWallpaper
@@ -15,12 +15,20 @@ DestroyFunc MakeMenuWallpaper
 AddToFunc   MakeMenuWallpaper
  + I DestroyMenu recreate MenuWallpaper
  + I AddToMenu MenuWallpaper Wallpaper Title
- + I PipeRead '. $[FVWM_USERDIR]/scripts/bgmenu.sh $[BGROOT] MenuWallpaper'
+ + I PipeRead 'exec $[FVWM_USERDIR]/scripts/bgmenu.zsh $[BGROOT] MenuWallpaper'
 
 DestroyFunc SetWallpaper
 AddToFunc   SetWallpaper
  + I Exec exec ln -sf "$0" "$[BGFILE]"
  + I Exec exec $[SETROOT] "$[BGFILE]"
 
-AddToFunc InitFunction
- + I Exec exec $[SETROOT] "$[BGFILE]"
+DestroyFunc SetInitialWallpaper
+AddToFunc   SetInitialWallpaper
+ + I Exec if [ -f "$[BGFILE]" ]; then \
+              $[SETROOT] "$[BGFILE]"; \
+          else \
+             $[SETROOT] "$($[FVWM_USERDIR]/scripts/randombg.pl $[BGROOT])"; \
+         fi
+
+AddToFunc InitFunction I SetInitialWallpaper
+AddToFunc SessionInitFunction I SetInitialWallpaper