The KWin Button Applet
March 24, 2010
I like to save screen estate, and in the latest iteration of my workspace layout, I have eliminated another 20px vertical space. I noticed that I’m mostly working in maximized windows. Their titlebar is nearly empty due to my wide notebook screen. What a waste!
Solution: Move the panel to the top and make it cover the titlebar of the maximized window.
Problem: The panel is bigger than the titlebar, and therefore covering the toolbar.
Solution: Make the titlebar bigger (Oxygen windeco allows to make the buttons bigger), then make the panel size match the titlebar size.
Next problem: There are buttons in the titlebar which I might need.
Immediate solution: Resize the panel to not cover these buttons. But that does not work because I’m regularly changing my screen resolution when wiring up my notebook to a projector.
Slightly harder solution: Implement the titlebar buttons as a Plasma applet. (Sounds harder than it is, thanks to libtaskmanager from kdebase-workspace.) Because this is something others might find useful, I’ve shared these 200 lines of code.
- Aaron Seigo points out that plasma-netbook comes with a quite similar applet called “Current Application Control”, which combines all buttons into one, together with the title of the current application.
- Christian adds that KWin has built-in support for removing the decoration from maximized windows automatically, although this option is not presented in the GUI. To activate this option, set “BorderlessMaximizedWindows=true” in the “[Windows]” section of your kwinrc (usually found at .kde/share/config/kwinrc or .kde4/share/config/kwinrc in your home directory). Then fire up KRunner and run “kwin –replace” to restart KWin.
- Luboš Luňák announces the immediate availability of an openSUSE build service package for the kwinbuttonapplet. I have added this information to the kde-look page.
Thanks to all commenters!