On Wed, Jan 21, 2015 at 12:27:49PM +0100, Lucio Chiappetti wrote:
> 1) I want to keep (e.g. in the lower left corner of my screen) a text
>    label with the desktop number or name
> 
>    After some experiments, I think the best is to use FvwmButtons

Yes.

>    I define a transparent color set
>    Colorset 10 Transparent,Fore White
> 
>    then for each desktop I define a FvwmButtons like this (only I
>    call them 0,1,2 ...)
> 
>    Style MyDesk0 StartsOnDesk 0, SkipMapping,NoTitle,WindowListSkip,
>                  !Borders,!Handles,ParentalRelativity,StickyAcrossPages,
>                  !StickyAcrossDesks,StaysOnBottom
>    DestroyModuleConfig MyDesk0*
>    *MyDesk0: (Title "desk 0", Action Nop)
>    *MyDesk0: Colorset 10
> 
>    Module FvwmButtons -g -0-0 MyDesk0
> 
>    Each one has hardcoded the desk number (or potentially name).
>    I hoped I could use $[desk.n] as a dynamic content. but I found with
>    some disappointment that it is the current desk at the moment the
>    button or menu or whatever is created.
> 
>    Is there any smarter solution (with a single fvwmbutton or other
>    widget for all desks, which displays the current desk number as soon
>    as one moves to it ?)

This is why you use FvwmEvent and the SendToModule directive:

        DestroyModuleConfig FE-UpdateDeskNum
        *FE-UpdateDeskNum: new_desk NewFunc

        AddToFunc StartFunction I Module FvwmEvent FE-UpdateDeskNum

        DestroyFunc NewFunc
        AddToFunc   NewFunc
        + I SendToModule MyDesk0 ChangeButton desklabel Title $0

The above assumes you have in your FvwmButtons configuration a suitable
button with the id of "desklabel", something like:

        *MyDesk0: (1x1, Id desklabel, Title "...")

> 2) I want to keep the current date on the screen (and time as well, but
>    time is no problem)

There's numerous FvwmScript examples doing this; see fvwm-themes and
friends.

-- Thomas Adam

Reply via email to