Hi there, On 05 Feb 2005 at 13:51:26 +0100, Uwe Pross wrote:
> I wrote a small and very very straight forward patch for > FvwmScript module so that a previously (or higher) given > colorset is not overwritten by a color definition. Take a > look at the attached script and both screenshots. For the moment I use PipeRead "echo SetEnv FvwmScriptBg `echo $[bg.cs1] | sed 's/rgb:/#/;s+../++g;s+..$++'`" PipeRead "echo SetEnv FvwmScriptFg `echo $[fg.cs1] | sed 's/rgb:/#/;s+../++g;s+..$++'`" PipeRead "echo SetEnv FvwmScriptSh `echo $[shadow.cs1] | sed 's/rgb:/#/;s+../++g;s+..$++'`" PipeRead "echo SetEnv FvwmScriptHi `echo $[hilight.cs1] | sed 's/rgb:/#/;s+../++g;s+..$++'`" *FvwmScript: DefaultFore $[FvwmScriptFg] *FvwmScript: DefaultBack $[FvwmScriptBg] *FvwmScript: DefaultHilight $[FvwmScriptHi] *FvwmScript: DefaultShadow $[FvwmScriptSh] which gives the same result ;-) Both the patch and the workaround do not work if not "plain" colorsets are used. Colorset support seems to be very limited in FvwmScript. Using Colorset 10 fg $[fg.cs1], bg $[bg.cs1], HGradient 128 red yellow and the attached script one gets the attached screenshot (which is quite ugly). Cheers, Uwe -- ,_, For personal reply/mail put "fvwm" (O,O) in the subject. ( ) Otherwise your mail is discarded by a filter. =-"-"-= http://www.tu-chemnitz.de/~uwp
FvwmScript_Colorset.gif
Description: GIF image
#-*-shell-script-*- #--------------------------------------------------------------------- #- File : cable_modem.FvwmScript #- Date : Mon May 3 20:52:04 2004 #- Author : Uwe Pross #--------------------------------------------------------------------- WindowTitle {CableModemFvwmScript} # This option sets the window title. WindowSize 60 40 # This option sets window size. width and height are numerical value. # WindowPosition x y # This option sets window position. x and y are numerical value. # ForeColor {color} # This option sets the default foreground color for all widgets. # BackColor $[bg.cs1] # This option sets the default background color for all widgets. # HilightColor {color} # This option sets the default hilight color for all widgets. # ShadowColor {color} # This option sets the default shadow color for all widgets. Colorset 10 # This option sets the default colorset for all widgets. Font -*-fixed-medium-*-*-*-10-*-*-*-*-*-*-* # Font $[DEFAULT_FONT] # This option sets the default font color for all widgets. # UseGettext [locale_path] # Enable the use of the gettext mechanism which is used by the # WindowLocaleTitle, LocaleTitle, ChangeLocaleTitle instructions and the # Gettext function. If no argument is given, the default FvwmScript # locale catalog is used. This catalog is under the locale fvwm # installation direc- tory and the text domain is FvwmScript # (install_prefix/share/locale/*/LC_MESSAGES/FvwmScript.mo). You can # reset this catalog or add some catalogs exactly in the same way than # with the LocalePath fvwm command (see the fvwm manual page). This # instruction should be placed before the WindowLocaleTitle instruction. # WindowLocaleTitle string # This option sets the window title, but use the locale catalog(s) defined with UseGettext. #--------------------------------------------------------------------- # INITIALISATION # This part contains instructions which will be executed at the startup. Init Begin Set $interval = 1 End #--------------------------------------------------------------------- # PERIODIC TASKS # This part of the script contains instructions that are periodicly. PeriodicTasks Begin If (RemainderOfDiv (GetTime) $interval)==0 Then Begin # show that we are dooing something ChangeValue 3 1 If $interval < 1000 Then Begin Set $interval = (Mult $interval 2) End Set $ip = (GetOutput {/sbin/ifconfig eth0 | grep 'inet addr:' | sed 's/.*inet addr:\([0-9\.][0-9\.]*\).*/\1/'} 1 -1) ChangeTitle 5 $ip If $ip=={} Then Begin # cable modem is not connected ChangeValue 2 0 ChangeValue 3 0 ChangeValue 4 1 End Else Begin # cable modem is connected ChangeValue 2 1 ChangeValue 3 0 ChangeValue 4 0 End End End #--------------------------------------------------------------------- # Widgets #--------------------------------------------------------------------- # Title string Widget 1 Property Size 60 10 Type ItemDraw Title {Internet} Position 0 0 Flags NoReliefString Center Main Case message of SingleClic : Begin End End Widget 2 Property Type RadioButton # Title {On} ForeColor {green1} Position 5 15 Flags NoReliefString Left Main Case message of SingleClic : Begin Do {Exec /usr/bin/sudo /etc/init.d/cable_modem restart} Set $interval=2 ChangeValue 2 0 ChangeValue 3 1 ChangeValue 4 0 End End Widget 3 Property Type RadioButton Position 20 15 # Title {processing} ForeColor {yellow} Flags NoReliefString Left Main Case message of SingleClic : Begin Set $interval=2 ChangeValue 2 0 ChangeValue 3 1 ChangeValue 4 0 End End Widget 4 Property Type RadioButton Position 35 15 # Title {Off} ForeColor {red} Flags NoReliefString Left Main Case message of SingleClic : Begin Do {Exec /usr/bin/sudo /etc/init.d/cable_modem stop} Set $interval=2 ChangeValue 2 0 ChangeValue 3 1 ChangeValue 4 0 End End Widget 5 Property Type ItemDraw Title {---.---.---.---} Position 0 30 Font -*-fixed-medium-*-*-*-6-*-*-*-*-*-*-* Flags NoReliefString Center Main Case message of SingleClic : Begin Do { Exec printf } $ip {| xclip -i} # Set $interval=1 End End #--------------------------------------------------------------------- # end of file