From: <dom...@us...> - 2011-01-29 21:22:04
|
Revision: 76 http://fvwm-crystal.svn.sourceforge.net/fvwm-crystal/?rev=76&view=rev Author: dominique_libre Date: 2011-01-29 21:21:58 +0000 (Sat, 29 Jan 2011) Log Message: ----------- Support for multiple wallpapers Modified Paths: -------------- ChangeLog fvwm/components/functions/Wallpaper Added Paths: ----------- fvwm/components/functions/Tooltip Modified: ChangeLog =================================================================== --- ChangeLog 2011-01-29 21:19:12 UTC (rev 75) +++ ChangeLog 2011-01-29 21:21:58 UTC (rev 76) @@ -22,6 +22,7 @@ * Trayer: support for $trayer_height into the recipes * Preferences-Menu: cleanup * Initial support for tooltips (used for the media button) + * Support for multiple wallpapers Samedi 1 janvier 2011 Dominique Michel * Wimdow-Raise-Move-Lover witll focus on a non overlapped window Added: fvwm/components/functions/Tooltip =================================================================== --- fvwm/components/functions/Tooltip (rev 0) +++ fvwm/components/functions/Tooltip 2011-01-29 21:21:58 UTC (rev 76) @@ -0,0 +1,34 @@ +# Support for Tooltip +# Written by: Dominique Michel <dom...@so...> +# +# Usage : FvwmButtons-Tooltip <name> <title> <"string to display"> <geometry> <layer> <delay> +# +# where <name> is the name of the button such as FvwmButtons-Tooltip-<Name> +# <title> is the titile to draw on the button. It support gettext. +# <"string to display"> can be anything, i.e. $[My_Var_Env] +# <geometry> is in standard X11 notation (+x+y are enough) +# <layer> is the layer in wich the tooltip will be draw +# <delay> is the time in msec during wich the tolltip will be visible +# An argument with a space must be quoted. +# +# Example : +# + I PointerWindow (FvwmButtons-Music) FvwmButtons-Tooltip Volume "Main volume" "$[CurrentVolume]" "+4-40" 20 1000 +# will show a tooltip when the pointer is entering on FvwmButtons-Music. + +DestroyFunc FvwmButtons-Tooltip +AddToFunc FvwmButtons-Tooltip ++ I DestroyModuleConfig FvwmButtons-Tooltip-$0: * ++ I *FvwmButtons-Tooltip-$0: Geometry $3 ++ I *FvwmButtons-Tooltip-$0: BoxSize smart ++ I *FvwmButtons-Tooltip-$0: ActiveColorset $[cs_menu_inactive] ++ I *FvwmButtons-Tooltip-$0: Colorset $[cs_menu_inactive] ++ I *FvwmButtons-Tooltip-$0: Rows 1 ++ I *FvwmButtons-Tooltip-$0: Padding 1 1 ++ I *FvwmButtons-Tooltip-$0: Frame 0 ++ I *FvwmButtons-Tooltip-$0: Font "xft:$[panel_font]:pixelsize=$[menu_font_size]:encoding=iso10646-1" ++ I *FvwmButtons-Tooltip-$0: (1x1, Id "Tooltip-$0", Title (Side) "$[gt.$1] $2") ++ I Style FvwmButtons-Tooltip-$0 Layer $4 ++ I Module FvwmButtons FvwmButtons-Tooltip-$0 ++ I Schedule $5 KillModule FvwmButtons FvwmButtons-Tooltip-$0 + +# vim:ft=fvwm Modified: fvwm/components/functions/Wallpaper =================================================================== --- fvwm/components/functions/Wallpaper 2011-01-29 21:19:12 UTC (rev 75) +++ fvwm/components/functions/Wallpaper 2011-01-29 21:21:58 UTC (rev 76) @@ -1,19 +1,80 @@ # Wallpaper menu and functions # ---------------------------- +# Use FvwmBacker in order to be able to set different wallpapers +# for each page. +# EnvVars: Desk_Pages_X, Desk_Pages_Y +# +# Recipes Desk_Pages_X Desk_Pages_Y +# Amiga 8 1 +# Clean 8 1 +# Clean Vertical 1 8 +# Corner 8 1 +# Default 8 1 +# Default with ACPI 8 1 +# Dock 4 1 +# Light 8 1 +# Nebulae 8 1 +# Old School 8 1 +# SideLine 8 1 +# SilentHacker 8 1 +# Thin 8 1 +# TopDown 8 1 +# TopLine 8 1 +# +# Il est nécessaire de tester Desk_Pages_X et Desk_Pages_Y afin de déterminer +# la syntaxe de FvwmBacker: *FvwmBacker: Command (Desk d, Page x y) command +# Ex : *FvwmBacker: Command (Desk *, Page 1 0) Exec habak -ms /home/dom/.fvwm-crystal/wallpapers/Nonnes/146.JPG +# régle la 2ème page en x de la 1ère colonne de pages de tous les desks. +# +# + I Test (x habak) *FvwmBacker: Command (Desk *, Page $0 $1) Exec habak -ms $3 +# +# La page courante est donnée par +# $[page.nx] $[page.ny] +# Menu: Wallpaper -> Toutes les pages -> menu actuel +# -> Page 1 -> menu actuel +# -> Page 2 -> menu actuel +# ... +# Préférences: +# 1) Si toutes les pages, effacer toutes les lignes et ajouter cette ligne +# 2) Si une page, effacer la ligne de toutes les pages si elle existe +# et écrire cette ligne en l'écrivant par-dessus si besoin. +# +# + +Module FvwmBacker + # Set the specified wallpaper using available programs -DestroyFunc Wallpaper-Set -AddToFunc Wallpaper-Set -+ I Test (x habak) Exec habak -ms $* -+ I TestRc (NoMatch) Test (x Esetroot) Exec Esetroot -scale $* -+ I TestRc (NoMatch) Test (x hsetroot) Exec hsetroot -fill $* -+ I SavePreferences LastChoosenWallpaper "Wallpaper-Set \"$*\"" +DestroyFunc Wallpaper-Set-All +AddToFunc Wallpaper-Set-All ++ I Test (x habak) *FvwmBacker: Command (Desk *, Page \* \*) Exec habak -ms $0 ++ I TestRc (NoMatch) Test (x Esetroot) *FvwmBacker: Command (Desk *, Page * *) Exec Esetroot -scale $0 ++ I TestRc (NoMatch) Test (x hsetroot) *FvwmBacker: Command (Desk *, Page * *) Exec hsetroot -fill $0 ++ I SavePreferences LastChoosenWallpaper "Wallpaper-Pref-Write \\* \\* \"$0\"" +DestroyFunc Wallpaper-Set-Current +AddToFunc Wallpaper-Set-Current ++ I Test (x habak) *FvwmBacker: Command (Desk *, Page $[page.nx] $[page.ny]) Exec habak -ms $0 ++ I TestRc (NoMatch) Test (x Esetroot) *FvwmBacker: Command (Desk *, Page $[page.nx] $[page.ny]) Exec Esetroot -scale $* ++ I TestRc (NoMatch) Test (x hsetroot) *FvwmBacker: Command (Desk *, Page $[page.nx] $[page.ny]) Exec hsetroot -fill $* ++ I UpdateAppendPreferences LastChoosenWallpaper "Wallpaper-Pref-Write $[page.nx] $[page.ny] \"$0\"" "Wallpaper-Pref-Write $[page.nx] $[page.ny]" + +# Write the wallpaper preferences +DestroyFunc Wallpaper-Pref-Write +AddToFunc Wallpaper-Pref-Write ++ I Test (x habak) *FvwmBacker: Command (Desk *, Page $0 $1) Exec habak -ms $2 ++ I TestRc (NoMatch) Test (x Esetroot) Command (Desk *, Page $0 $1) Exec Esetroot -scale $2 ++ I TestRc (NoMatch) Test (x hsetroot) Command (Desk *, Page $0 $1) Exec hsetroot -fill $2 + # Select random wallpaper from given directories and set it -DestroyFunc Wallpaper-Random -AddToFunc Wallpaper-Random -+ I PipeRead "echo Wallpaper-Set \\'`fvwm-crystal.wallpaper $*`\\'" +DestroyFunc Wallpaper-Random-All +AddToFunc Wallpaper-Random-All ++ I PipeRead "echo Wallpaper-Set-All \\'`fvwm-crystal.wallpaper $*`\\'" +DestroyFunc Wallpaper-Random-Current +AddToFunc Wallpaper-Random-Current ++ I PipeRead "echo Wallpaper-Set-Current \\'`fvwm-crystal.wallpaper $*`\\'" + # Where are kept wallpaper thumbnails? SetEnv WallpaperThumbnails "$[FVWM_USERDIR]/wallpaper-thumbnails" @@ -22,26 +83,46 @@ CheckPreferences LastChoosenWallpaper 'SavePreferences LastChoosenWallpaper "Wallpaper-Set $[FVWM_SYSTEMDIR]/wallpapers/fvwm-crystal-dark1-1024x768.jpg"' # Menu for wallpapers -DestroyMenu /Wallpaper -AddToMenu /Wallpaper -+ MissingSubmenuFunction Wallpaper-Browser +DestroyMenu /Wallpaper-All +AddToMenu /Wallpaper-All ++ MissingSubmenuFunction Wallpaper-Browser-All + "%22x22/categories/directory.png%FVWM-Crystal" Popup $[FVWM_SYSTEMDIR]/wallpapers Test (f $[FVWM_USERDIR]/wallpapers) + "%22x22/categories/directory.png%~/.fvwm-crystal/wallpapers" Popup $[FVWM_USERDIR]/wallpapers -Test (f $[HOME]/wallpapers) + "%22x22/categories/directory.png%~/wallpapers" Popup $[HOME]/wallpapers Test (f /usr/local/share/wallpapers) + "%22x22/categories/directory.png%/usr/local/share/wallpapers" Popup /usr/local/share/wallpapers Test (f /usr/share/wallpapers) + "%22x22/categories/directory.png%/usr/share/wallpapers" Popup /usr/share/wallpapers # Wallpapaer menu generator -DestroyFunc Wallpaper-Browser -AddToFunc Wallpaper-Browser I PipeRead 'for i in "$0/"*; do \ +DestroyFunc Wallpaper-Browser-All +AddToFunc Wallpaper-Browser-All I PipeRead 'for i in "$0/"*; do \ test -d "${i}" && continue; \ mkdir -p "$[WallpaperThumbnails]${i%/*}"; \ test -f "$[WallpaperThumbnails]${i}" -a "$[WallpaperThumbnails]${i}" -nt "${i}" || \ convert -quality 0 -sample 42 "${i}" "png:$[WallpaperThumbnails]${i}" 2>/dev/null & \ done; \ wait && fvwm-menu-directory --title "$[gt.Random]" --icon-title "" --icon-file __PIXMAP__ \ - --icon-dir "22x22/categories/directory.png" --dir "$0" --links --command-file "Wallpaper-Set \'\\"%f\\"\'" \ - --command-t="Wallpaper-Random $0" | sed -e "s#FuncFvwmMenuDirectory#Wallpaper-Browser#g" \ + --icon-dir "22x22/categories/directory.png" --dir "$0" --links --command-file "Wallpaper-Set-All \'\\"%f\\"\'" \ + --command-t="Wallpaper-Random-All $0" | sed -e "s#FuncFvwmMenuDirectory#Wallpaper-Browser-All#g" \ -e "s#__PIXMAP__\\(.*\\)\\\"\\(.*/\\)\\(.*\\)\\\"#$[WallpaperThumbnails]/\\2\\3\\1\\2\\3#g"' +DestroyMenu /Wallpaper-Current +AddToMenu /Wallpaper-Current ++ MissingSubmenuFunction Wallpaper-Browser-Current ++ "%22x22/categories/directory.png%FVWM-Crystal" Popup $[FVWM_SYSTEMDIR]/wallpapers +Test (f $[FVWM_USERDIR]/wallpapers) + "%22x22/categories/directory.png%~/.fvwm-crystal/wallpapers" Popup $[FVWM_USERDIR]/wallpapers +Test (f /usr/local/share/wallpapers) + "%22x22/categories/directory.png%/usr/local/share/wallpapers" Popup /usr/local/share/wallpapers +Test (f /usr/share/wallpapers) + "%22x22/categories/directory.png%/usr/share/wallpapers" Popup /usr/share/wallpapers + +# Wallpapaer menu generator +DestroyFunc Wallpaper-Browser-Current +AddToFunc Wallpaper-Browser-Current I PipeRead 'for i in "$0/"*; do \ + test -d "${i}" && continue; \ + mkdir -p "$[WallpaperThumbnails]${i%/*}"; \ + test -f "$[WallpaperThumbnails]${i}" -a "$[WallpaperThumbnails]${i}" -nt "${i}" || \ + convert -quality 0 -sample 42 "${i}" "png:$[WallpaperThumbnails]${i}" 2>/dev/null & \ + done; \ + wait && fvwm-menu-directory --title "$[gt.Random]" --icon-title "" --icon-file __PIXMAP__ \ + --icon-dir "22x22/categories/directory.png" --dir "$0" --links --command-file "Wallpaper-Set-Current \'\\"%f\\"\'" \ + --command-t="Wallpaper-Random-Current $0" | sed -e "s#FuncFvwmMenuDirectory#Wallpaper-Browser-Current#g" \ + -e "s#__PIXMAP__\\(.*\\)\\\"\\(.*/\\)\\(.*\\)\\\"#$[WallpaperThumbnails]/\\2\\3\\1\\2\\3#g"' + # vim:ft=fvwm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |