Re: FVWM: FvwmScript and environment variables
On Sat, May 04, 2013 at 03:49:42PM -0400, Dan Espen wrote: Dominique Michel dominique.mic...@vtxnet.ch writes: Hi, I am writing a font selector for fvwm-crystal with FvwmScript. Most of it work, but I didn't succeeded to use environment variables. Also thing like Set $PanelFont = (GetOutput {echo $[panel_font]} 1 -1) I belive you could do something hackish like this if you don't want to patch for actual support. But you need to be a little more creative. First I belive GetOutput is excuting a shell command, so you may just need (GetOutput {echo $PANEL_FONT} 1 -1) this should work for the enviorment variables but not infostore (I'm hoping a new shell isn't spawned with a new enviorment). If this doesn't work my next thought is Use FvwmCommand with Echo (from fvwm) which can echo a string to your stderr ($HOME/.xsession-errors is common for this). Then parse the value from $HOME/.xsession-errors with grep/regex tools. This should work with either EnvVars or InfoStore since you can echo their values as well. The only issue I see with this portability as not everyone may have stderr of their Xserver redirected to $HOME/.xsession-errors jaimos
FvwmScript, UseGettext and LocalePath
I try to get UseGettext to work with FvwmScript and Fvwm-Crystal. From FvwmScript man page: UseGettext [locale_path] 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). In Fvwm-Crystal config, one of the first instruction is: LocalePath $[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+ If I put exactly the same path in my FvwmScript UseGettext $[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+ the script crash with a syntax error at that line: UseGettext! [/home/dom/.fvwm-crystal/scripts/FontSelector/FontSelector] Line 7: syntax error The beginning of the script: # FvwmScript Font Selector # A Font Selector for Fvwm-Crystal # Copyright Dominique Michel dominique_li...@users.sourceforge.net 2013 # Released under the GNU GPL license v2 or later # Header ̣{{{1 UseGettext $[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+ WindowLocaleTitle {FVWM-Crystal Font Selector} Is it something I can do, or is it a bug? This append with both 2.6.5 and the cvs. Best, Dominique -- We have the heroes we deserve.
Re: FvwmScript, UseGettext and LocalePath
Dominique Michel dominique.mic...@vtxnet.ch writes: I try to get UseGettext to work with FvwmScript and Fvwm-Crystal. From FvwmScript man page: UseGettext [locale_path] 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). In Fvwm-Crystal config, one of the first instruction is: LocalePath $[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+ If I put exactly the same path in my FvwmScript UseGettext $[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+ the script crash with a syntax error at that line: UseGettext! [/home/dom/.fvwm-crystal/scripts/FontSelector/FontSelector] Line 7: syntax error The beginning of the script: # FvwmScript Font Selector # A Font Selector for Fvwm-Crystal # Copyright Dominique Michel dominique_li...@users.sourceforge.net 2013 # Released under the GNU GPL license v2 or later # Header ̣{{{1 UseGettext $[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+ WindowLocaleTitle {FVWM-Crystal Font Selector} Is it something I can do, or is it a bug? See my other reply. I don't think FvwmScript is going to expand $[FVWM_SYSTEMDIR]. -- Dan Espen
Re: FvwmScript, UseGettext and LocalePath
Dan Espen wrote: Dominique Michel dominique.mic...@vtxnet.ch writes: I try to get UseGettext to work with FvwmScript and Fvwm-Crystal. From FvwmScript man page: UseGettext [locale_path] 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). In Fvwm-Crystal config, one of the first instruction is: LocalePath $[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+ If I put exactly the same path in my FvwmScript UseGettext $[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+ the script crash with a syntax error at that line: UseGettext! [/home/dom/.fvwm-crystal/scripts/FontSelector/FontSelector] Line 7: syntax error The beginning of the script: # FvwmScript Font Selector # A Font Selector for Fvwm-Crystal # Copyright Dominique Michel dominique_li...@users.sourceforge.net 2013 # Released under the GNU GPL license v2 or later # Header ̣{{{1 UseGettext $[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+ WindowLocaleTitle {FVWM-Crystal Font Selector} Is it something I can do, or is it a bug? See my other reply. I don't think FvwmScript is going to expand $[FVWM_SYSTEMDIR]. It does, but the string in FvwmScript have to be quoted in FvwmScript quotes: UseGettext {$FVWM_USERDIR/locale;fvwm-crystal:$FVWM_SYSTEMDIR/locale;fvwm-crystal:+} If this doesn't work the problem could be that fvwm-crystal doesn't export FVWM_USERDIR in the shell, too. It is not enough to set FVWM_USERDIR in the config. I have had the same problems and fixed it in the start up script. For crystal the following should be added in fvwm-crystal startup script: # Default path # if a variable 'configfile' is defined in the environment, its value is # preserved; otherwise, the scripts look for configuration in common places. configfile=$HOME/fvwm-crystal/$configname export FVWM_USERDIR=$HOME/fvwm-crystal export FNS_SYSTEMDIR=`dirname ${0}`/../share/fvwm-crystal Thomas
Re: FvwmScript, UseGettext and LocalePath
Ouch! Copy paste typo :S Thomas Funk wrote: It does, but the string in FvwmScript have to be quoted in FvwmScript quotes: UseGettext {$FVWM_USERDIR/locale;fvwm-crystal:$FVWM_SYSTEMDIR/locale;fvwm-crystal:+} Corrected: UseGettext {$[FVWM_USERDIR]/locale;fvwm-crystal:$[FVWM_SYSTEMDIR]/locale;fvwm-crystal:+} If this doesn't work the problem could be that fvwm-crystal doesn't export FVWM_USERDIR in the shell, too. It is not enough to set FVWM_USERDIR in the config. I have had the same problems and fixed it in the start up script. For crystal the following should be added in fvwm-crystal startup script: # Default path # if a variable 'configfile' is defined in the environment, its value is # preserved; otherwise, the scripts look for configuration in common places. configfile=$HOME/fvwm-crystal/$configname export FVWM_USERDIR=$HOME/fvwm-crystal export FNS_SYSTEMDIR=`dirname ${0}`/../share/fvwm-crystal And here now that from above: UseGettext {$FVWM_USERDIR/locale;fvwm-crystal:$FVWM_SYSTEMDIR/locale;fvwm-crystal:+} Sorry, Thomas