makes your windows stay on top, toggle it.

August 11th, 2007 mysurface Posted in fluxbox, Misc, wmctrl | Hits: 71905 | 5 Comments »

Do you wish to have a shortcut way to make your window stay on top and toggle it after without needing it anymore ? Any EWMH compatible Windows Manager(WM) may support it, WM such as GNOME (metacity), fluxbox, xfce, compiz, beryl etc.

You can find the option at Window Menu, where it usually appear as “On top” for compiz, “Always On Top” for Metacity. For Fluxbox, it appears in Layer.

Key bindings
To toggle ‘always on top’ with a shortcut key, you need to have some manual tweaking. I have tested 3 different windows manager(WM) installed in my box ( Fluxbox, Metacity, Compiz), below are the steps for each WM.

My favorite WM. Adding a key binding for Fluxbox is flexible, you just need to edit the file ~/.fluxbox/keys.
If you are using Fluxbox v1.0rc3 or above, then append the line below to the keys file.

Mod1 a :ToggleCmd {RaiseLayer} {LowerLayer}

Mod1 indicates Alt key, ToggleCmd used to implement key toggle , for more info regarding key bindings on Fluxbox, refers to fluxbox-wiki.
If you are reading the manual of Fluxbox, you may notice that RaiseLayer and LowerLayer was not included. It is a hidden magic code!

Anyway when you trigger it, the Layer state is not change. You can check the state at Fluxbox window layer menu, the state is not define after you trigger it. To workaround the problem, replace the line as below:

Mod1 a :ToggleCmd {MacroCmd {RaiseLayer} {RaiseLayer}} {MacroCmd {LowerLayer} {LowerLayer}}

Thanks to _mark for the line, now it behaves the way it suppose to be.

For those who are using older version of Fluxbox, you can make use of wmctrl.

Mod1 a :ExecCommand wmctrl -r :ACTIVE: -b toggle,above

For compiz, Enable Extra WM Actions. Check the properties, and insert ALT+A to Key field for Toggle Always-On-Top action.

Gnome( Metacity )
You need to edit the registry using gconf-editor. Goto apps -> metacity -> windows_keybindings, insert a value <Alt>a to toggle_above.


5 Responses to “makes your windows stay on top, toggle it.”

  1. Linux By Examples – We explain every GNU/Linux command line by examples…

    Commands, commands, commands!! I saw this site on delicious and the concept is great. They take Linux commands and show examples of the usage. How novel!…

  2. KDE via kwin:
    either search for “keyboard shortcuts” or navigate “Regional & Accessibility” -> “Keyboard Shortcuts” -> Shortcut Schemes -> “Keep Window Above Others.”

    Set your key there.

  3. I want to express my appreciation to you for rescuing me from this type of circumstance. Right after exploring throughout the the web and obtaining strategies which are not productive, I figured my entire life was done. Being alive without the approaches to the problems you’ve sorted out as a result of this posting is a critical case, and the ones which might have negatively affected my entire career if I hadn’t discovered your web page. Your good ability and kindness in touching a lot of stuff was useful. I’m not sure what I would have done if I had not come upon such a thing like this. I’m able to at this moment relish my future. Thanks a lot so much for the expert and effective help. I will not be reluctant to propose your web blog to anybody who will need tips on this problem.

  4. I own a somewhat fashionable pop star gab web site, and to remain in the know, I use market pulse tools.Your website has been firing up certain Alexa triggers, and I figured I’d check it out and check into if I could discoverwhat all of the buzz was about.

  5. […] (old) post claimed that For compiz, Enable Extra WM Actions. Check the properties, and insert ALT+A to Key […]

Leave a Reply