How can I force one window to always remain at the back of the window stack? I want to run FireFox pinned to the desktop and prevent other windows from ever ending up behind it.
2 Answers
Does right-clicking on the window title and selecting "Keep below others" from the dropdown menu solves your problem? I do not have access to a Unity environment at the moment, but as I remember the option always was there.
UPDATE: Ok, after some checking I've found that the option is present in KDE, XFCE and LXDE (Kubuntu, Xubuntu and Lubuntu, respectively), but is disabled/hidden in Gnome, even in older versions.
Also, it seems that GTK does have the required functionality, so it's just a matter of Gnome developers' preference not to expose "unnecessary" or rarely-used settings ("settings kill kittens", as they say). There may or may not be a hidden key somewhere which enables the menu item.
UPDATE 2: I was going to propose you to write a small program which finds a window using, say, gtk_get_window_at_pointer API call and sets it as "always on bottom" with gdk_window_set_keep_below API call (in case you don't mind some programming), but it appears everything has been written for us already: there's a program called Devil's Pie (and also GDevilsPie) which are available in Ubuntu repositories. The program allows you to write some rules which match open windows and perform some actions on them (move to a specific workspace, maximize, minimize etc.)
Here's the documentation
Here's an aricle discussing specifically how to implement "below others" functionality using Devil's Pie or another program called wmctrl
To prevent link rot:
As an example, the first snippet below will toggle the full screen state of whichever window is selected with the mouse. The second example does almost exactly what we want, it toggles the always on bottom state of the active window.
wmctrl -r :SELECT: -b toggle,fullscreen wmctrl -r :ACTIVE: -b toggle,below
-
-
1That's great thanks very much. Is there a way launch firefox via the command line so that it always uses the "Keep Below Others" Setting?– Sparky1Feb 8, 2012 at 21:52
-
-
@Sergey: Thanks to you, I have this working with XFCE and Devis's Pie. Thanks for the detail you've given in answering my question. It's hugely appreciated. It didn't occur to me to try and use wmctrl for this. I'll try this next.– Sparky1Feb 10, 2012 at 1:31
-
@Sparky1 How did you achieve the result when launching your application from the command line?– dtmlandMar 2, 2017 at 16:45
Install CompizConfig Settings Manager if you haven't already
sudo apt-get install compizconfig-settings-manager
Run it by searching for ccsm in Dash
Go to the Window Rules plugin in Compiz. Under the Matches tab, add class=Firefox to the Below entry.