Tutorial

Tutorial: Remove Firefox Title Bar On Linux KDE – Alternate Methods

the problem…

One of the issues i had when i scrapped Windows and installed Linux Mint was that i missed how easy it was to hide the Firefox window title bar in order to gain that extra bit of vertical real estate under Windows. With Mint and the KDE desktop environment i found several options to accomplish a similar result, but i liked none of them and so off i went seeking a better alternative.

Most of the the options i found either advised to install the Hide Caption Titlebar Plus extension for Firefox, which works on Linux, more or less, or to apply a custom window style using the Window Actions and Behavior settings in KDE (System Settings > Workspace > Window Management on Mint 18.x). The problem with the former is that it is hugely bloated with options i don’t use nor want and it didn’t produce a very nice looking result, plus i prefer to do things without installing more Firefox extensions if possible. The problem with the latter option is that, while it is indeed trivial to remove the Firefox window title bar using the Window Management tool provided by KDE, this left me with a borderless window that couldn’t be resized when it wasn’t maximized.

the solutions…

By accident i stumbled upon what i personally think is a better solution while playing with the KDE Window Decorations utility in System Settings > Appearance > Application Style > Window Decorations settings and no additional software or configuration tweaks were needed.

System Settings - Application Style
click to enlarge

On the Theme tab of the Window Decorations utility, you’ll see the previews of whatever window themes you have installed. In Mint 17.x/18.x with KDE, i think the defaults are Breeze and Plastik.

Window Decorations - Theme
click to enlarge

For this to work, you have to be using the Breeze theme or another one that supports windows-specific overrides (the Plastik theme does not, nor do any of the custom themes i tried). Using Breeze as the example, if you click on the little tool icon on the lower-left of the theme preview, you’ll get a menu which opens the settings for the theme.

Window Decorations - Theme Settings
click to enlarge

On the Windows-Specific Overrides tab you can add a couple of window specific styles for a given window, or even all windows if you want. The only two options are to change the border size and hide the title bar. These options are not nearly as comprehensive as those found in the System Settings > Workspace > Windows Management > Window Rules utility, but the difference between the two is that, as previously mentioned, you lose the window border and thus the ability to resize the window with the mouse when removing the title bar using the Window Rules utility, while you retain the window border when using the Windows Decorations utility.

So to accomplish what we want, simply click that little tool icon on the window theme preview and switch to the Windows-Specific Overrides tab. From here, click Add and a utility to identify the window for which you want to remove the title bar will be displayed.

Breeze System Settings - Add

In this window you have two options; you can either set the Matching window property to Window Title or Window Class Name. I recommend you select the Window Class Name option (if you don’t, you’ll eventually figure out why i recommend this option). In the Regular expression to match field, enter Navigator Firefox (in the image below i use Navigator Waterfox because i use Waterfox). In the next section you can enable or disable the window border size option if you want, but most importantly you’ll want to select the Hide window title bar option, then click “OK” and “Apply” and you’re done with this part.

 

KDE: Window-Specific Overrides

The caveat with this method verses using an extension, is that we lose our browser window exit, restore and minimize window controls and so you’ll have to get used to exiting Firefox using another method such as a keyboard shortcut or a menu item, but what i prefer is to simply middle-click the task bar icon to close windows. This is easily accomplished by right-clicking any task bar icon and selecting the Task Manager Settings menu item, then setting the On middle-click option in the General section to “Close Window or Group”. Note that i personally do not group windows.

Task Manager Settings - Plasma
click to enlarge

Returning to Firefox, you may still have a bit of a problem in that you will need a way to drag the window so we can restore (un-maximize) it, resize it and move it around since our title bar is now gone. My solution was to simply add a bit of fixed space to the end of the tab bar (i set tabs to be on top). This is really only needed when you have enough tabs open so as to fill the space on the tab bar. I suppose there are a couple of ways to accomplish this, including a userChrome.css hack, however the easiest way is to put the browser in customize mode and drag one or more fixed-width spaces to wherever you want on the tab bar.

Mozilla Firefox - Add Static Space
click to enlarge

So hopefully you now have an easy way to exit, move and resize Firefox, along with a bit more screen real estate, and it can all be done without having to edit a single configuration file.

Leave a Reply

Your email address will not be published. Required fields are marked *