Transparency at startup

This is for users who want to use RootTransparent for transparency. Also when running a compositor for X11 (Picom, Compton, etc.). Doesn’t activate by default, and requires a few additional command lines.

Add these two lines in default Fvwm configs, “1: Functions” section, after InitBackground function, line number 90.

Test (x fvwm-root) Exec exec fvwm-root -r ~/.fvwm/.BGdefault
Test (x fvwm3-root) Exec exec fvwm-root -r ~/.fvwm/.BGdefault

Attach these two lines to SetBG function after line number 128 (not at the end). This activates transparency immediately when changing the wallpaper.

+ I Test (x fvwm-root) Exec exec fvwm-root -r ~/.fvwm/.BGdefault
+ I Test (x fvwm3-root) Exec exec fvwm-root -r ~/.fvwm/.BGdefault

The lines MUST be in the right place, check this.

DestroyFunc SetBG
AddToFunc   SetBG
+ I Test (f $[FVWM_USERDIR]/images/background/$0) \
    Exec exec fvwm-root $[FVWM_USERDIR]/images/background/$0
+ I TestRc (Match) Exec exec ln -fs images/background/$0 \
    $[FVWM_USERDIR]/.BGdefault

+ I Test (x fvwm-root) Exec exec fvwm-root -r ~/.fvwm/.BGdefault
+ I Test (x fvwm3-root) Exec exec fvwm-root -r ~/.fvwm/.BGdefault

+ I TestRc (Match) Break
+ I Test (!f $[FVWM_DATADIR]/default-config/images/background/$0) Break
+ I Exec exec fvwm-root $[FVWM_DATADIR]/default-config/images/background/$0
+ I Exec exec ln -fs $[FVWM_DATADIR]/default-config/images/background/$0 \
    $[FVWM_USERDIR]/.BGdefault

Sample colorset code:
ColorSet 15 RootTransparent Buffer, Tint #4a516a 50, fg white, bg black

1 Like

That how it works. Can also be made a read script, without default config change?

There seems to be some contradictory statements with this function.

I can see you’re trying to cater for both fvwm2 and fvwm3. Some downstream package maintainers of fvwm, use --program-transform-name at ./configure time to change the name – I know some use fvwm3-root, others just leave it alone.

+ I Test (x fvwm-root) Exec exec fvwm-root -r ~/.fvwm/.BGdefault
+ I Test (x fvwm3-root) Exec exec fvwm-root -r ~/.fvwm/.BGdefault

+ I TestRc (Match) Break

This will always break from the function which means the following lines won’t ever be run:

+ I TestRc (Match) Break
+ I Test (!f $[FVWM_DATADIR]/default-config/images/background/$0) Break
+ I Exec exec fvwm-root $[FVWM_DATADIR]/default-config/images/background/$0
+ I Exec exec ln -fs $[FVWM_DATADIR]/default-config/images/background/$0 \
    $[FVWM_USERDIR]/.BGdefault

So I’m not quite sure what the intent of this function is, but it needs looking at.

I don’t see contradiction, but BUG. @rasat did not add new command but correct fvwm-root option -r (–retain-pixmap), which is missing. Check Fvwm manpage

This option should also be used for the RootTransparent colorset option, refer to the COLORSETS section of fvwm.

Adding -r is ok, but still some more fix for wallpaper to appear on startup. @rasat two lines after InitBackground is ok until fixed.