Re: FVWM: How to place a window in more than 1 desk

From: Thomas Adam <thomas_at_edulinux.homeunix.org>
Date: Thu, 17 Feb 2005 12:55:57 +0000

On Thu, Feb 17, 2005 at 02:10:31PM +0530, Srivathsa Rao U wrote:
> Hi,
> I am using fvwm 2.5.10. I need a window to occupy some of my
> desktops which I specify.. How can do it. With the "Stick" a window
> will occupied in all the desks, but I need it in some of my desks not
> in all.
>
> Eg: Assume I have desks from 1 to 7, And I want a perticular terminal
> to be occupied into desks 3,4,5 . If I stick option terminal will
> occupy all the desks from 1 to 7.

You can use FvwmEvent to do this. I.e. you can get FvwmEvent to listen
for a "change of desk" command, hence:

DestroyModuleConfig FvwmEvent-cd: *
*FvwmEvent-cd: Cmd Function
*FvwmEvent-cd: new_desk FvwmFuncTestDesk

Then you can define the function 'FvwmFuncTestDesk' to be something
like:

DestroyFunc FvwmFuncTestDesk
AddToFunc FvwmFuncTestDesk
+ I PipeRead 'test $[desk.n] -eq 3 || test $[desk.n] -eq 4 || \
    test $[desk.n] -eq 5 && echo "Function ChangeStyle" || echo \
    "RestoreStyle"'

AddToFunc RestoreStyle
+ I All (CurrentDesk AcceptsFocus) ThisWindow \
  ("some_window_name") WindowStyle !Sticky
+ I UpdateStyles

DestroyFunc ChangeStyle
AddToFunc ChangeStyle
+ I All (CurrentDesk AcceptsFocus) ThisWindow \
  ("some_window_name") WindowStyle Sticky
+ I UpdateStyles


Here what is happening, is that FvwmFuncTestDesk tests to see which desk
number we're on. If it matches either 3, 4, or 5, then the function
'ChangeStyle' is run.

ChangeStyle then looks for all the windows on the current desk and for a
window called "some_window_name" (you'll have to change this). If it
matches, it then toggles the window to sticky.

RestoreStyle works in much the same way, but negates the expression so
that for any other desk you change to, the window is never made sticky.

There are a few things you should note -- the window you're wanting to
match should be a unique name, otherwise you might get unexpected
results.

To kick the whole thing off, you will have to ensure that you place the
following line in your 'StartFunction' definition:

+ I Module FvwmEvent FvwmEvent-cd

I haven't tested this, so let me know if it works.

HTH,

-- Thomas Adam

-- 
I know nothing, and understand even less.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Thu Feb 17 2005 - 06:57:07 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:57 BST