From: <dom...@us...> - 2010-12-31 16:58:53
|
Revision: 43 http://fvwm-crystal.svn.sourceforge.net/fvwm-crystal/?rev=43&view=rev Author: dominique_libre Date: 2010-12-31 16:58:46 +0000 (Fri, 31 Dec 2010) Log Message: ----------- Icon_launcher initial commit. Work for me but certainly not portable at that time. Dont know how I will release it (or not). Modified Paths: -------------- ChangeLog Added Paths: ----------- fvwm/components/functions/Icon-Launcher Modified: ChangeLog =================================================================== --- ChangeLog 2010-12-31 16:35:35 UTC (rev 42) +++ ChangeLog 2010-12-31 16:58:46 UTC (rev 43) @@ -3,6 +3,9 @@ Vendredi 31 décembre 2011 Dominique Michel * Added font support from font preference in FvwmIdent * Some cleanup in the Focus policies + * Icon-Launcher initial commit. Very experimental. Don't know if it will be + released here or in the contrib directory. + Work for me but certainly not portable at that time. Mercredi 23 décembre 2010 Dominique Michel * New Amiga focus policy : click to focus without raise, Added: fvwm/components/functions/Icon-Launcher =================================================================== --- fvwm/components/functions/Icon-Launcher (rev 0) +++ fvwm/components/functions/Icon-Launcher 2010-12-31 16:58:46 UTC (rev 43) @@ -0,0 +1,82 @@ +# Desktop icons for the mounted partition(s) and for home. +# Written by Dominique Michel <dom...@so...>, 2010 +# for Fvwm-Crystal. +# +# From Fvwm FAQ, 7.13 with huge modifications and added functions. +# This file will scan /etc/mtab, find the mounted drive(s) or partition(s), +# and create the icons on the desktop corresponding to your home directory and +# to the drives. At that time, the only action associated to the icons +# is to launch Thunar into the corresponding mount point. +# 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. + +# 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"' + +DestroyFunc Icon-Launch-CurrentDesk +AddToFunc Icon-Launch-CurrentDesk ++ C X thunar $0 ++ M Move ++ C FlipFocus ++ C Raise + +# FvwmButtons icon launcher. It start iconic +# Syntax: Launcher name icon +# Examples: +# Launcher Home home.xpm +DestroyFunc Launcher +AddToFunc Launcher ++ I DestroyModuleConfig $0: * ++ I *$0: Font "xft:$[panel_font]" ++ I *$0: (1x1+0+0) ++ I Style $0 UseStyle * ++ I Style $0 Icon $1, StartIconic, !Handles, VariablePosition, BorderWidth 0, \ + !Borders, ParentalRelativity ++ I All ($0) Layer 0 2 ++ I Module FvwmButtons $0 ++ I Module FvwmAuto 10 -menter "Change-Icon $0 $1" "Restore-Icon $0 $1" + +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 + +# 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 +# Home ++ I PipeRead 'LocalUser=`id -un`; echo "Launcher Home 48x48/categories/Home.png"; \ + echo "All (Home) Layer 0 2"; \ + echo "Mouse (Home) 1 I $[Mod] Icon-Launch-CurrentDesk /home/`id -un`"' + +# 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" + +# The partitions must be first +Style * NoIcon +# Make the icons +Make-Icons +# We want the other icons +Style * !NoIcon This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |