Subject: FVWM: toggle decor with key-shortcut (focused window)

From: calmar <[email-masked]>
Date: Fri, 13 Feb 2004 09:28:06 +0100

Hi,

actually I'm new to fvwm, so I would be happy when someone could
tell me where and how to find solutions to such questions too :)

How can I setup a key to toggle the decor of a window?

What I found out so far:

with

Style windowname !Borders
Styel windowname NoTitle 

I get a window without any `decoration.

I would set up a key like this:

Key D A 1 Style windowname !Borders, NoTitle

here are my problems:
I don't want a specific windowname, but the focused window,
I would like to toggle the state maybe, not just removing.

Thanks for any tips,

marco candrian

PS: in order to search the archives, it would be recommend to
load them into a mail program maybe?

-- 
  calmar 
           (o_         GNU/Linux is GREAT      
           //\                 
           V_/_        http://www.calmar.ws 

--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: "George \"Nephrite\" Potapov" <[email-masked]>
Date: Fri, 13 Feb 2004 12:09:20 +0300

> I would like to toggle the state maybe, not just removing.

I don't know about 2.4.* versions but in 2.5.8 you can use

Key D A 1 Current WindowStyle !Borders, NoTitle

to switch off decor for only one window (note the WindowStyle command which
appeared only in 2.5.8)

To toggle decor you should use more sophisticated approach... Setting states
maybe? They are present in stable version as well. Like this

DestroyFunc DecorOn
AddToFunc   DecorOn
+ I State 1 off
+ I Style Borders, Title

DestroyFunc DecorOff
AddToFunc   DecorOff
+ I State 1 on
+ I Style !Borders, NoTitle

DestroyFunc ToggleDecor
AddToFunc ToggleDecor
+ I Current (State 1) DecorOff
+ I TestRc (NoMatch) DecorOn

Here we use state 1 to remember the fact that we have previously removed
decor from window. 

Also, read the fvwm documentation - it's very well written and contains
everything you'd need.

-- 
George 'Nephrite' Potapov

---

From: calmar <[email-masked]>
Date: Fri, 13 Feb 2004 21:08:02 +0100

"George \"Nephrite\" Potapov" <[email-masked]> writes:

Hi George,
> + I TestRc (NoMatch) DecorOn
Thanks again for your kindly help!
while looking in the man pages, I happen to find the 'toggle'
thing instead of True/False (or off/on as you used above)

So I summarized your system above in one function to something
like this:

,----
| DestroyFunc ToggleDecor
| AddToFunc ToggleDecor
| + I State 1 toggle
| + I Current (State 1) WindowStyle !Borders, NoTitle
| + I TestRc (NoMatch) WindowStyle Borders, Title
`----

,---- 
| Key D A 1 ToggleDecor
`----

What seems to work too.

Thanks and Greetings
marco