From: <dom...@us...> - 2011-01-29 20:33:35
|
Revision: 66 http://fvwm-crystal.svn.sourceforge.net/fvwm-crystal/?rev=66&view=rev Author: dominique_libre Date: 2011-01-29 20:33:29 +0000 (Sat, 29 Jan 2011) Log Message: ----------- Icon-Launcher: Added some comment; commented out all the code than can hang the function when some partition is not avaible. Modified Paths: -------------- ChangeLog fvwm/components/functions/Icon-Launcher Modified: ChangeLog =================================================================== --- ChangeLog 2011-01-29 20:29:13 UTC (rev 65) +++ ChangeLog 2011-01-29 20:33:29 UTC (rev 66) @@ -11,6 +11,8 @@ * Fullscreen: Added comment, cleanup * FvwmForm use the same font than the menus now * Icon-Amiga: changed the colorsets + * Icon-Launcher: Added some comment; commented out all the code than can hang the function + when some partition is not avaible. Samedi 1 janvier 2011 Dominique Michel * Wimdow-Raise-Move-Lover witll focus on a non overlapped window Modified: fvwm/components/functions/Icon-Launcher =================================================================== --- fvwm/components/functions/Icon-Launcher 2011-01-29 20:29:13 UTC (rev 65) +++ fvwm/components/functions/Icon-Launcher 2011-01-29 20:33:29 UTC (rev 66) @@ -1,4 +1,4 @@ -# Desktop icons for the mounted partition(s) and for home. +# Desktop icons for the mounted partition(s) and for $HOME. # Written by Dominique Michel <dom...@so...>, 2010 # for Fvwm-Crystal. # @@ -10,11 +10,10 @@ # You can also move the icons, but the moves will not survive a restart. # # Requirement: /etc/mtab, sed, Thunar, and Fvwm. -# In order to use it, add "Include components/functions/Icon-Launcher" -# into some recipe after the "Style * IconBox ..." command. - +# In order to use it, add "Test (x thunar) Include components/functions/Icon-Launcher" +# into some recipe after the "Include Icon-Amiga" command. Not tested with Icon-Thumbnails. +# # Todo: - preference setting for the action -# - style PipeRead 'echo "Style * IconBox $(($[vp.width]-36))x$(($[vp.height]-92))+18+46, IconFill top left, IconGrid 50 50"' @@ -31,6 +30,7 @@ # Launcher Home home.xpm DestroyFunc Launcher AddToFunc Launcher ++ I KillModule FvwmButtons $0 + I DestroyModuleConfig $0: * + I *$0: Font "xft:$[panel_font]" + I *$0: (1x1+0+0) @@ -44,39 +44,56 @@ DestroyFunc Change-Icon AddToFunc Change-Icon + I ThisWindow ($0) Schedule 10 Style $0 Icon $1.active.png -#+ I UpdateStyles DestroyFunc Restore-Icon AddToFunc Restore-Icon + I ThisWindow ($0) Style $0 Icon $1 -#+ I UpdateStyles +# Wrapper function +DestroyFunc Generate-Icons +AddToFunc Generate-Icons ++ I Style * NoIcon ++ I Make-Icons ++ I Style * !NoIcon + # which drives are mounted into the system DestroyFunc Make-Icons AddToFunc Make-Icons -+ I PipeRead "cat /etc/mtab|grep ^/dev|sed -e 's,/dev/.... \\(/[^ ]*\\).*,\\1,'|sort > /tmp/Icon-Drives" -# Make the icons +#+ I PipeRead "cat /etc/mtab|grep ^/dev|sed -e 's,/dev/.... \\(/[^ ]*\\).*,\\1,'|sort > /tmp/Icon-Drives" +# Root ++ I PipeRead 'Root="/"; echo "Launcher Root 48x48/categories/Boing_4.png"; \ + echo "All (Root) Layer 0 0"; \ + echo "Mouse (Root) 1 I $[Mod] Icon-Launch-CurrentDesk /"' +# echo "Mouse (Root) 2 I $[Mod] Generate-Icons /"' ++ I Wait Root # Home + I PipeRead 'LocalUser=`id -un`; echo "Launcher Home 48x48/categories/Home.png"; \ - echo "All (Home) Layer 0 2"; \ + echo "All (Home) Layer 0 0"; \ echo "Mouse (Home) 1 I $[Mod] Icon-Launch-CurrentDesk /home/`id -un`"' - ++ I Wait Home +# Make the icons # The drives -+ I Wait Home -+ I PipeRead 'i=2; m=$((((2*(($[panel_font_size]+56))))-32)); j=$m; while read line; do \ - if [[ "${line}" == "/" ]]; \ - then echo "Launcher ${line} 48x48/categories/Boing_4.png"; \ - else echo "Launcher ${line} 48x48/categories/Work_4.png"; \ - fi ; \ - echo "Mouse (${line}) 1 I $[Mod] Icon-Launch-CurrentDesk ${line}"; \ - echo "Wait ${line}"; \ - j=$(($i*$m)); i=$(($i+1)); \ -done </tmp/Icon-Drives' -+ I PipeRead "rm /tmp/Icon-Drives" +## If you want all the mounted partitions, uncomment the first 2 pipereads and comment +## the third one. Uncomment also the last PipeRead, and comment the # Root section. +## This will freeze fvwm at start/restart if not all those partitions are avaible. +#+ I Wait Home +#+ I PipeRead 'i=2; m=$((((2*(($[panel_font_size]+56))))-32)); j=$m; while read line; do \ +# if [[ "${line}" == "/" ]]; \ +# then echo "Launcher ${line} 48x48/categories/Boing_4.png"; \ +# else echo "Launcher ${line} 48x48/categories/Work_4.png"; \ +# fi ; \ +# echo "Mouse (${line}) 1 I $[Mod] Icon-Launch-CurrentDesk ${line}"; \ +# echo "Wait ${line}"; \ +# j=$(($i*$m)); i=$(($i+1)); \ +#done </tmp/Icon-Drives' +#+ I PipeRead "rm /tmp/Icon-Drives" +# Do something now ! # The partitions must be first -Style * NoIcon +#Style * NoIcon # Make the icons -Make-Icons +#Make-Icons # We want the other icons -Style * !NoIcon +#Style * !NoIcon +Generate-Icons +# vim:ft=fvwm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |