I’ve got a nice Samsung 27″ 2K monitor at my home office. The one and only pain I have got with the resolution and size of the monitor is that most programs don’t need that much of horizontal space and become mostly useless and horrible to use. For instance your web browser very rarely needs to be that wide if you’re not staring at a dashboard or a video or something. Usually I want the browser to be a little more than half of the width of the screen and in the center if I’m doing web surfing etc.
KDE Plasma 5.12 doesn’t come with the required functionality to get the window resized to half of the screen and positioned in the center so I needed to dig in to KWin scripting and do it myself. I now have three shortcuts that let me:
- resize the current window to 1/2 of screen width and center it
- grow it horizontally by 40 px
- shrink it horizontally by 40 px
This is super useful – one button to get the size where it functions nicely 99 % of time and then a few pushes more to grow/shrink it if needed.
You may find my KWin script as a git repository that may be installed into your Plasma system with one command right here over at Github. The script itself is very simple and might even give you nice pointers on how to achieve something similar with the KWin’s scripting facilities. More details on KWin scripting (and Plasma UI manipulation) may be found from the official documentation.