Re: FvwmScript, UseGettext and LocalePath

2013-05-06 Thread Dominique Michel
Le Sun, 5 May 2013 18:24:39 +0200,
Dominique Michel dominique.mic...@vtxnet.ch a écrit :

 Le Sun, 05 May 2013 14:56:53 +0200,
 Thomas Funk t.f...@web.de a écrit :
 
  Dominique Michel wrote:


  https://sourceforge.net/p/fvwm-crystal/code/HEAD/tree/fvwm/scripts/FontSelector/FontSelector
  A little remark to your script
  
  to reduce code you can use for loops to assign your font to the
  widgets: For $Widget=1 To 6 Do

It look like my script have another and much bigger problem. It was
working fine yesterday, but it just crash at startup today. It I move
the ChangeTitle and ShowWidget stuffs from Init to the Periodic
section, I cannot reproduce this bug, even after restarting the machine.

That also seam to imply that Fvwm must have some kind of internal cache
that keep stuff from a previous run of this script. How can I be sure
this cache is cleaned without to restart the machine?

Dominique


-- 
We have the heroes we deserve.



Re: FvwmScript, UseGettext and LocalePath

2013-05-06 Thread Dominique Michel
Le Mon, 06 May 2013 09:43:07 -0400,
Dan Espen des...@verizon.net a écrit :

 Dominique Michel dominique.mic...@vtxnet.ch writes:
 
  Le Sun, 5 May 2013 18:24:39 +0200,
  Dominique Michel dominique.mic...@vtxnet.ch a écrit :
 
  Le Sun, 05 May 2013 14:56:53 +0200,
  Thomas Funk t.f...@web.de a écrit :
  
   Dominique Michel wrote:
 
 
   https://sourceforge.net/p/fvwm-crystal/code/HEAD/tree/fvwm/scripts/FontSelector/FontSelector
   A little remark to your script
   
   to reduce code you can use for loops to assign your font to the
   widgets: For $Widget=1 To 6 Do
 
  It look like my script have another and much bigger problem. It was
  working fine yesterday, but it just crash at startup today. It I
  move the ChangeTitle and ShowWidget stuffs from Init to the Periodic
  section, I cannot reproduce this bug, even after restarting the
  machine.
 
  That also seam to imply that Fvwm must have some kind of internal
  cache that keep stuff from a previous run of this script. How can I
  be sure this cache is cleaned without to restart the machine?
 
 I don't think there is any cache.
 If you have a crash, you need to examine the core file.
 

That's very strange because I cannot reproduce it any more. And I don't
find any core file. I must set ulimit -c to something else than 0.

Also, I was doing a system update yesterday, and I did purged the old
files only now. This should not be a problem, but who knows exactly
what can append into such complex systems...

Another pointer is I didn't get any report of such a crash, and the last
time it was a problem with Fvwm-Crystal, a few peoples was very fast to
report it. I think I will wait and see.

Dominique

-- 
We have the heroes we deserve.



Re: FvwmScript, UseGettext and LocalePath

2013-05-05 Thread Dominique Michel
Le Sun, 05 May 2013 01:35:32 +0200,
Thomas Funk t.f...@web.de a écrit :

 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:+}

Great, that work fine.

My Font statement was confusing me:

Fontxft:$[panel_font]:size=16:$[panel_font_style]

It is  instead of {}. With that, widgets like ItemDraw or CheckBox
are OK. With all other statements I try, they get shortened and the
text cam get cut in those widgets.

Another strange font issue is, whatever I try, only the font size is
applied correctly with that statement, as well with the Font in the
Init section. But Font changes are applied integrally into in further
sections.

https://sourceforge.net/p/fvwm-crystal/code/HEAD/tree/fvwm/scripts/FontSelector/FontSelector

Dominique



-- 
We have the heroes we deserve.



Re: FvwmScript, UseGettext and LocalePath

2013-05-05 Thread Thomas Funk

Dominique Michel wrote:
 Le Sun, 05 May 2013 01:35:32 +0200,
 Thomas Funk t.f...@web.de a écrit :

 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:+}


 Great, that work fine.
You're welcome ^^

 My Font statement was confusing me:

 Fontxft:$[panel_font]:size=16:$[panel_font_style]

 It is  instead of {}. With that, widgets like ItemDraw or CheckBox
 are OK. With all other statements I try, they get shortened and the
 text cam get cut in those widgets.
It is interesting that this works in the header :)

 Another strange font issue is, whatever I try, only the font size is
 applied correctly with that statement, as well with the Font in the
 Init section. But Font changes are applied integrally into in further
 sections.
I accustom oneself to use a temporarily variable for each command I
assigned to GetOutup because then I can see whether the command is correct.
For checking your problem do this:
Set $Cmd = {echo \$[panel_font]}
Do {echo Cmd panel_font: }$Cmd
Set $PanelFont = (GetOutput $Cmd 1 -1)
Set $Cmd = {echo \$[panel_font_size]}
Do {echo Cmd panel_font_size: }$Cmd
Set $PanelFontSize = (GetOutput $Cmd 1 -1)
Set $Cmd = {echo \$[panel_font_style]}
Do {echo Cmd panel_font_style: }$Cmd
Set $PanelFontStyle = (GetOutput $Cmd 1 -1)
Set $SelectorFont = {xft:}$PanelFont{:pixelsize=16:}$PanelFontStyle
Do {echo SelectorFont: }$SelectorFont

So you can see in .xsession-errors if your command looks fine.


 
https://sourceforge.net/p/fvwm-crystal/code/HEAD/tree/fvwm/scripts/FontSelector/FontSelector

A little remark to your script

to reduce code you can use for loops to assign your font to the widgets:
For $Widget=1 To 6 Do
ChangeFont $Widget $SelectorFont
For $Widget=12 To 16 Do
ChangeFont $Widget $SelectorFont
Set $step = 10
Set $Widget = 20
While $step  80 Do
Begin
ChangeFont $Widget $SelectorFont
Set $Widget = (Add $Widget $step)
End
ChangeFont 71 $SelectorFont
ChangeFont 100 $SelectorFont
ChangeFont 101 $SelectorFont
ChangeFont 102 $SelectorFont
ChangeFont 121 $SelectorFont
ChangeFont 122 $SelectorFont




Re: FvwmScript, UseGettext and LocalePath

2013-05-05 Thread Dominique Michel
Le Sun, 05 May 2013 14:56:53 +0200,
Thomas Funk t.f...@web.de a écrit :

 Dominique Michel wrote:
   Le Sun, 05 May 2013 01:35:32 +0200,
   Thomas Funk t.f...@web.de a écrit :
  
   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:+}
  
   Great, that work fine.
 You're welcome ^^
 
   My Font statement was confusing me:
  
   Fontxft:$[panel_font]:size=16:$[panel_font_style]
  
   It is  instead of {}. With that, widgets like ItemDraw or
   CheckBox are OK. With all other statements I try, they get
   shortened and the text cam get cut in those widgets.
 It is interesting that this works in the header :)
 
   Another strange font issue is, whatever I try, only the font size
   is applied correctly with that statement, as well with the Font in
   the Init section. But Font changes are applied integrally into in
   further sections.
 I accustom oneself to use a temporarily variable for each command I
 assigned to GetOutup because then I can see whether the command is
 correct. For checking your problem do this:
 Set $Cmd = {echo \$[panel_font]}
 Do {echo Cmd panel_font: }$Cmd
 Set $PanelFont = (GetOutput $Cmd 1 -1)
 Set $Cmd = {echo \$[panel_font_size]}
 Do {echo Cmd panel_font_size: }$Cmd
 Set $PanelFontSize = (GetOutput $Cmd 1 -1)
 Set $Cmd = {echo \$[panel_font_style]}
 Do {echo Cmd panel_font_style: }$Cmd
 Set $PanelFontStyle = (GetOutput $Cmd 1 -1)
 Set $SelectorFont = {xft:}$PanelFont{:pixelsize=16:}$PanelFontStyle
 Do {echo SelectorFont: }$SelectorFont
 
 So you can see in .xsession-errors if your command looks fine.

It is what I have done. I removed them for the repository.

 
  
   
 https://sourceforge.net/p/fvwm-crystal/code/HEAD/tree/fvwm/scripts/FontSelector/FontSelector
 A little remark to your script
 
 to reduce code you can use for loops to assign your font to the
 widgets: For $Widget=1 To 6 Do
  ChangeFont $Widget $SelectorFont
 For $Widget=12 To 16 Do
  ChangeFont $Widget $SelectorFont
 Set $step = 10
 Set $Widget = 20
 While $step  80 Do
 Begin
  ChangeFont $Widget $SelectorFont
  Set $Widget = (Add $Widget $step)
 End
 ChangeFont 71 $SelectorFont
 ChangeFont 100 $SelectorFont
 ChangeFont 101 $SelectorFont
 ChangeFont 102 $SelectorFont
 ChangeFont 121 $SelectorFont
 ChangeFont 122 $SelectorFont
 
 

Thanks for the tip. It will be for the next release.

Best,
Dominique

-- 
We have the heroes we deserve.



FvwmScript, UseGettext and LocalePath

2013-05-04 Thread Dominique Michel
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

2013-05-04 Thread Dan Espen
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

2013-05-04 Thread Thomas Funk

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

2013-05-04 Thread Thomas Funk

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