Skip to content

KWin script for flexibly resizing and moving the current window on the current screen in KDE Plasma

Notifications You must be signed in to change notification settings

ChaoticManifold/kde-plasma-resize-move-window

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Flexibly resize and move the current window in KDE Plasma using KWin scripting

This is a very simple but flexible and easy to modify KWin script (see contents/code/main.js). By default it defines the following shortcuts/keybindings which work like the screen edge snap zones:

  • Meta+D: snap the current window to the left third of the current monitor
  • Meta+Shift+D: snap the current window to the left two thirds of the current monitor
  • Meta+G: snap the current window to the right third of the current monitor
  • Meta+Shift+G: snap the current window to the right third of the current monitor
  • Meta+F: snap the current window to the center third of the current monitor
  • Meta+Shift+F: snap the current window to the center quarter of the current monitor

I use this functionality often with 27” monitor. The edge snap zone which makes 50% screen width windows which are often too large or too small and thirds are often more reasonable.

Installation

  1. Clone this repo somewhere.
  2. Modify and add additional keybindings to the script file:contents/code/main.js. For testing different inputs, copy the function into plasma-interactiveconsole --kwin.
  3. Run kpackagetool5 --type=KWin/Script -i . inside the directory to install the script. (It should be possible to install this script from the KWin Scripts in system settings, but I have never got this to work.) You may need to restart KWin for this to take effect.

Known Bugs

  • Using this with no windows in focus or with an empty desktop can sometimes resize the kde desktop background
  • Focus doesn’t follow the mouse correctly after snapping a window, this can be annoying when there are mutliple windows to arrange

About

KWin script for flexibly resizing and moving the current window on the current screen in KDE Plasma

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%