Is it possible to remap the close button to minimize a window just like the minimize button does?

I would like to keep all three buttons but prevent windows from closing. When the close button is clicked I want to minimize it to the dock.

So I am trying to achieve something similar to OS X.


I think that‘s impossible without source code changes to each affected application. It may be possible to hook onto the event management functions of the window management library (X-Windows) to intercept the close button event to change the behaviour of all local applications without recompilation. (That would be a hideous hack though.)

However you can hide the close button from the window border purely through configuration if you remove the close item from the value tied to the org.gnome.desktop.wm.preferences.button-layout key: You can use

  • the graphical Dconf Editor or

  • a command-line Dconf/GSettings editor.

    gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize'

Thanks, pomsky!

  • Yup, it's possible in GNOME 3, gsettings set org.gnome.desktop.wm.preferences button-layout : does the trick.
    – pomsky
    Oct 10 '18 at 21:38
  • @pomsky: Thanks and acknowledged in my answer! Oct 10 '18 at 21:55
  • @pomsky Thanks! I will leave this question unanswered. Something might pop-up. Something like AllTray
    – sstevan
    Oct 12 '18 at 19:06

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.