This is a Kwin script that allows you to create a desktop regions by grid selection, then lets you quickly snap the window to that position.
- Copy
package
folder to the following directory and rename toktile
:
~/.local/share/kwin/scripts/
- Log out and back in
- Go to
System Settings -> Window Management -> KWin Scripts
- Click "Install from File..."
- Select
kTile.kwinscript
from this repo
- Go to
System Settings -> Window Management -> KWin Scripts
- Select the kTile script and hit
Apply
:
By default the script uses Ctrl + .
to bring up the main window, to change this see the configuration section below.
In the main window you can click the ➕ button in the top right to add a new region then hover over the new region to see the edit and delete options.
In edit mode you can then drag select to draw the size/position you want and also set the grid and gap you need.
Once you're done hit the ✔️ button to save.
Most of the configuration is done through the graphical interface however due to Kwin limitations shortcuts have to be predefined but can be updated in System Settings -> Shortcuts -> KWin
.
Note that I've added a visibility button (main window top right) to toggle numbers on each region block to easily connect it with the Kwin shortcuts.
If you're using this script on KDE Neon or Kubuntu you will need to install the following package:
sudo pkcon install qml-module-qtquick-localstorage
sudo apt-get install qml-module-qtquick-localstorage
- This application is written 100% in QML.
- A core part of this script relies on QML Local Storage to allow using custom UI to save settings. I would love to have the settings interated into KDE's configuration window but currently that doesnt seem possible as it only accpets basic form controls through XML.
As this is my first time writing a Kwin script and using QML I realize there is a lot for me to refactor here. Any feedback would be much appreciated by creating a new issue.
-
save custom grid size -
bug with sqlite not reindexing table -
allow gap resize - close with escape
- close by clicking outside window
- quick full screen drag selection
This would not be possible with out inspiration from Moom and Exquisite, so many many thanks to both of these great apps.