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.


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
  • There's only "Always on top". – roadmr Feb 8 '12 at 1:33
  • 1
    That'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? – Sparky1 Feb 8 '12 at 21:52
  • I've updated my answer – Sergey Feb 8 '12 at 23:57
  • @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. – Sparky1 Feb 10 '12 at 1:31
  • @Sparky1 How did you achieve the result when launching your application from the command line? – dtmland Mar 2 '17 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.

enter image description here

  • This only applies if the OP is using the Compiz window manager. – Thomas Boxley Feb 9 '12 at 3:43
  • Agreed. OP didn't state what desktop (s)he's running. – James Feb 9 '12 at 22:45

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.