kTile
kTile copied to clipboard
kTile
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.


Installation
Option 1:
- Copy
packagefolder to the following directory and rename toktile:
~/.local/share/kwin/scripts/
- Log out and back in
Option 2:
- Go to
System Settings -> Window Management -> KWin Scripts - Click "Install from File..."
- Select
kTile.kwinscriptfrom this repo
Enable Script:
- Go to
System Settings -> Window Management -> KWin Scripts - Select the kTile script and hit
Apply:

Usage
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.
Configuration
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.

Known Issues
If you're using this script on KDE Neon or Kubuntu you will need to install the following package:
KDE Neon
sudo pkcon install qml-module-qtquick-localstorage
Kubuntu
sudo apt-get install qml-module-qtquick-localstorage
Technical Notes
- 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.
TODO:
- [x] ~~save custom grid size~~
- [x] ~~bug with sqlite not reindexing table~~
- [x] ~~allow gap resize~~
- [ ] close with escape
- [ ] close by clicking outside window
- [ ] quick full screen drag selection
Special Thanks
This would not be possible with out inspiration from Moom and Exquisite, so many many thanks to both of these great apps.