Re: FVWM: How to make window appear on multiple (but not all) desktops?

Dominik Vogt <[email protected]>
Newsgroups gmane.comp.window-managers.fvwm
Message-ID <[email protected]>
On Wed, Feb 26, 2020 at 03:16:12PM -0500, Stephen Talley wrote:
> In my FVWM configuration, I can use either Sticky:
>
>     # Show window on all desktops
>     Style *Emulator* Sticky
>
> ???or StartsOnDesk:
>
>     # Show window on desktop 3 only
>     Style *Emulator* StartsOnDesk 3
>
> But how can I make a window appear on, say, desktops 3 and 4, but not 0, 1, or 2?

Fvwm does not manage desk objects.  The desk a window is present
on is just a property of the window, so there is no direct way to
do that.  However, you can do some scripting:

-- snip --
addtofunc custom_gotodesk
+ I setenv _desk $0
+ I test (envmatch _desk 1) all (xeyes) stick on
+ I test (envmatch _desk 2) all (xeyes) stick on
+ I test (envmatch _desk 3) all (xclock) stick on
+ I test (envmatch _desk 4) all (xclock) stick on
+ I GotoDesk 0 $0
+ I All (xeyes) stick off
+ I All (xclock) stick off
+ I unsetenv _desk
-- snip --

Call this function instead of GotoDesk with

  custom_gotodesk <desknum>

--

This won't work if you click on the pager to switch desks because
the GotoPage command is hard coded there.  In that case, FvwmEvent
helps:

-- snip --
*FvwmEvent: new_desk deskchange
Module FvwmEvent

addtofunc deskchange
+ I echo dc $[desk.n]
+ I setenv _desk $[desk.n]
+ I test (envmatch _desk 1) all (xeyes) movetodesk
+ I test (envmatch _desk 2) all (xeyes) movetodesk
+ I test (envmatch _desk 3) all (xclock) movetodesk
+ I test (envmatch _desk 4) all (xclock) movetodesk
+ I unsetenv _desk
-- snip --

You'll probably want to put the module execution in the
initfunction/restartfunction.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.