FvwmAuto(1)
β¨ NAME β¨
Okay bestie, meet FvwmAuto π¦, the fvwm auto-raise module! This is the page for FvwmAuto(1), filed under the Fvwm Modules section π
FvwmAuto is the fvwm auto-raise module, and it's honestly iconic π
β¨ SYNOPSIS β¨
Module FvwmAuto Timeout [-passid] [-menter|-menterleave|-mfocus] [EnterCommand [LeaveCommand]]
FvwmAuto can only be invoked by fvwm π Running it from the command line will not work, so don't even try, bestie π
β¨ DESCRIPTION β¨
FvwmAuto is most often used to automatically raise focused windows β¨ It's the main character of window management, no cap π
β¨ INVOCATION β¨
The correct syntax is:
Module FvwmAuto Timeout [-passid] [-menter|-menterleave|-mfocus] [EnterCommand [LeaveCommand]]
Here's how you'd add it to a menu π
AddToMenu Modules
+ "Auto Raise (300 ms)" Module FvwmAuto 300
+ "Auto Raise/Lower" Module FvwmAuto 300 "Silent Raise" "Silent Lower"
Okay so the vibe check on the arguments goes like this π§
Timeoutβ this one is required, no skipping! It's how long a window has to keep the keyboard input focus before your command runs. It's measured in milliseconds, and literally any integer greater than zero is valid πΈ
If you pass the literal option -passid, FvwmAuto tacks the window id of the window you just entered or left onto the command it sends to fvwm π«Ά This pairs nicely with the WindowId command of fvwm.
The -menter, -menterleave and -mfocus options decide what FvwmAuto reacts to, and you can only pick one of them, so choose wisely bestie π
-mfocusβ FvwmAuto raises whichever window has the focus β¨-menterβ FvwmAuto raises the window under the pointer the moment the pointer enters it. The LeaveCommand runs on whichever window was under the pointer before it hopped into the new one. When the pointer leaves a window and lands on the root window, the EnterCommand also runs, just without a window to act on π¦-menterleaveβ it's basically-menter, but the LeaveCommand also runs if the pointer slides out of a window without entering a new one π
Those last two modes are super useful for windows that don't accept the focus π
Heads up, bestie: -menterleave mode can interfere with popup windows of some applications. The zoom menu of Ghostview is one example. Please do not come complaining to us about it, because it's a bug in Ghostview π
EnterCommand and LeaveCommand are both optional π§ EnterCommand runs Timeout milliseconds after a window gets the input focus, and LeaveCommand runs Timeout milliseconds after the window loses it. Always put the Silent keyword in front of the command itself, okay? If you forget, FvwmAuto will prepend Silent on its own, but please don't rely on that π Without that prefix, fvwm might ask you to pick a window to act on if the window died before fvwm processed the command FvwmAuto sent. This can happen with popup menus, for example.
"Silent Raise" is the default for EnterCommand, but any fvwm function is allowed π₯ I personally would not use "Close" or "Destroy" with a low timeout, though. The LeaveCommand is handy for keeping a tidy desktop π§ Go ahead and experiment with these:
Module FvwmAuto 0 Nop "Silent Lower"
Module FvwmAuto 0 Nop "Silent Iconify"
Here's an example of auto raising windows with ClickToFocus π
Style * ClickToFocus
FvwmAuto 0 -menter "Silent Raise"
And here's an example of auto raising and lowering only some windows π First, start FvwmAuto like this:
FvwmAuto 0 -passid -menter \
"Silent selective_raiselower raise" \
"Silent selective_raiselower lower"
Then put this in your .fvwm2rc:
AddToFunc selective_raiselower
+ I WindowId $1 (FvwmIconMan) $0
+ I WindowId $1 (FvwmButtons) $0
+ I WindowId $1 (xclock) $0
...
Now for the more complex example, where three FvwmAuto's are running at the same time πΈ
DestroyFunc RestoreIconified
AddToFunc RestoreIconified
+ I Current (Iconic) Iconify false
DestroyFunc RegisterFocus
AddToFunc RegisterFocus
+ I Exec date +"%T $n focused" >>/tmp/focus-stats.txt
DestroyFunc RegisterUnfocus
AddToFunc RegisterUnfocus
+ I Exec date +"%T $n unfocused" >>/tmp/focus-stats.txt
KillModule FvwmAuto
Module FvwmAuto 250 Raise Nop
Module FvwmAuto 800 RestoreIconified Nop
Module FvwmAuto 0 RegisterFocus RegisterUnfocus
β¨ NOTES β¨
Bestie, there's some special Raise/Lower support in FvwmAuto π¦ It was added to improve the Raise/Lower callbacks, since most FvwmAuto setups are auto-raising or auto-lowering anyway. This improvement includes locking on M_RAISE_WINDOW and M_LOWER_WINDOW packets, and not raising or lowering windows that were explicitly raised. The special support only turns on when either EnterCommand or LeaveCommand contains the substring "Raise" or "Lower". So if FvwmAuto isn't doing what you expect, you can turn that special support on or off just by renaming those commands π₯
Using FvwmAuto together with EdgeCommand can be even more powerful π There's a short example in the fvwm man page.
β¨ AUTHOR β¨
FvwmAuto just appeared one day, and nobody knows how π§ FvwmAuto was simply rewritten in 09/96, and nobody knows by whom π
That's the whole page, bestie! Sourced from 3rd Berkeley Distribution, version 2.7.0, dated 19 October 2022 π Stay iconic, and go raise some windows πβ¨
π¦ where this page comes from
- alpine 3.24: fvwm-doc 2.7.0-r3 Β· GPL-2.0-or-later
- fedora 43: fvwm 2.7.0-15.fc43 Β· GPL-2.0-or-later
- fedora 44: fvwm 2.7.0-16.fc44 Β· GPL-2.0-or-later
- nixos 26.05: fvwm 2.7.0
- nixpkgs unstable: fvwm 2.7.0
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 Β· GPL-2.0-or-later
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms