Sticky Window Snapping

KWin Scripts

Source i (link to git-repo or to original if based on someone elses unmodified work):

https://github.com/Flupp/sticky-window-snapping

Original
34
Become a Fan
8.8

Description:
KWin script to let snapped window edges stick together when one window is resized.

The script provides an easy to use configuration dialog, which can be reached via “systemsettings”. (However, note section “Bugs and Workarounds”.)

When windows stick accidentally, you can release them by shaking the mouse while still resizing. The exact behavior is configurable. This feature can also be disabled.

Additionally, the script registers two global shortcuts: one for enabling/disabling the script permanently, and one for enabling/disabling the script only for the next resize. By default, no key combinations are assigned. You can change this using `systemsettings` (or `kcmshell6 keys`); the shortcuts are associated with the component “KWin”. Their names are prefixed by “KWin Script: Sticky Window Snapping”.

Bugs and Workarounds

  • If the configuration dialog is not reachable via “systemsettings”, then try running the following included script and restart “systemsettings”:
    ~/.local/share/kwin/scripts/sticky-window-snapping/backwards-compatibility/metadata-backwards-compatibility-fix.bash
  • If the script does not work, the options under the “Fine Tuning” tab in the configuration dialog might help.

Known issues

  • There is no optical feedback when a shortcut is pressed. I do not know how to initiate a KNotify notification from a KWin script. There is the function “callDBus”, but I do not know if or how it can be used for that purpose. KNotify provides the method “event” via D-Bus, but it expects arguments of types for which I do not know how to produce values with JavaScript.
  • Currently, not only snapped window edges are considered as connected, but even edges which are only on the same row/column are considered as connected. I have not decided yet if this is a bug or a feature.
Last changelog:

2.0.1

fixed:
• fix unsticking on rapid resize


Ratings & Comments

104 Comments

supaballz

10 Hands down, the best kwin script ever made. Been wanting something like this ever since tiling was softly broken in 5.27. I love you.

gleycon

10 May this plasmoid never die!

gleycon

Will this app have a version for plasma 6? My Garuda forced entry to plasma 6. But this add-on is more important to me than plasma 6. Now I'm unable to use it... 😐

Flupp

I already tried to achieve Plasma 6 compatibility some weeks ago, however, I was not able to complete my endeavors yet. I’ll definitely try again but I cannot say when and of course I cannot give any guarantees for success. Sorry for the inconvenience.

gleycon

My great developer friend. Your complement has been helpful to me for years! I would love to have it working again. Thank you very much if you do this. Don't let this wonderful work be forgotten in the past.

Flupp

Thank you very much for these kind words. If you feel bold, you can try the development branch https://github.com/Flupp/sticky-window-snapping/tree/dev and install the script via “kpackagetool6 --type=KWin/Script --install package”. If you do not know what I am talking about, then it is probably safer to wait for the next release.

gleycon

Oops, I understand. But I prefer to wait for the official launch. hahaha I really don't know how to handle these things. :)

Flupp

FYI – just in case you did not notice: There is a Plasma-6-compatible version now. :)

bicyclingrevolution

I've been using this for a long time, and it's still working for me on Plasma 5.27. I just updated it to 1.0.1. Had to use the recommended commands to get the Configure button to show up, but definitely worth it. I do wish it was optional whether borders of windows that aren't touching but just happen to be on the same plane are resized together. I want to disable that, but at least now I can have it ignore borders on the edge of the screen, which should nearly eliminate the annoyance of resizing windows that I don't intend to.

ben2talk

1 1 ugh - can't use with plasma 5.27, too old. Was great. Archive this - it's ancient.

Flupp

There is a newer version now. Feel free to give it a try. Nevertheless, I just tried version 1.0.1 of the script (which has been the current version at the time of your comment AFAICT) with Plasma 5.27 and did not notice any issues besides the missing configuration dialog as mentioned in “Bugs and Workarounds”. Are you sure you used the current version? Sometimes the various versions appear in a strange order. If you still have issues, I’d appreciate a detailed bug report: https://github.com/Flupp/sticky-window-snapping/issues

Flupp

There is a newer version now. Feel free to give it a try. Nevertheless, I just tried version 1.0.1 of the script (which has been the current version at the time of your comment AFAICT) with Plasma 5.27 and did not notice any issues besides the missing configuration dialog as mentioned in “Bugs and Workarounds”. Are you sure you used the current version? Sometimes the various versions appear in a strange order. If you still have issues, I’d appreciate a detailed bug report: https://github.com/Flupp/sticky-window-snapping/issues

Flupp

There is a newer version now. Feel free to give it a try. Nevertheless, I just tried version 1.0.1 of the script (which has been the current version at the time of your comment AFAICT) with Plasma 5.27 and did not notice any issues besides the missing configuration dialog as mentioned in “Bugs and Workarounds”. Are you sure you used the current version? Sometimes the various versions appear in a strange order. If you still have issues, I’d appreciate a detailed bug report on the GitHub project.

Flupp

There is a newer version now. Feel free to give it a try. Nevertheless, I just tried version 1.0.1 of the script (which has been the current version at the time of your comment AFAICT) with Plasma 5.27 and did not notice any issues besides the missing configuration dialog as mentioned in “Bugs and Workarounds”. Are you sure you used the current version? Sometimes the various versions appear in a strange order. If you still have issues, I’d appreciate a detailed bug report: https://github.com/Flupp/sticky-window-snapping/issues

sstt

10 10 the best

saulgoodman

10 A must have! Better than windows snapping!!

datamaskinen

Hi, I am a long time user of snapping windows and love it but it is one feature that i miss and i am trying to get it from another kwin script but it does not work that good together .... then i tough that what the hell why not ask you to fork it and integrate it as a feature in you script... the kwin.script is called 'window gaps' https://store.kde.org/p/1619642

Flupp

The threshold and offset options on the “Fine Tuning” configuration tab were introduced hoping for better compatibility. Unfortunately, after trying with the current version of Window Gaps (on Plasma 5.27.10), I noticed that the two scripts still don’t seem to play well together, and I do not know what else can be done about that. Sorry for the inconvenience.

Flupp

The threshold and offset options on the “Fine Tuning” configuration tab were introduced hoping for better compatibility. Unfortunately, after trying with the current version of Window Gaps (on Plasma 5.27.10), I noticed that the two scripts still don’t seem to play well together, and I do not know what else can be done about that. Sorry for the inconvenience.

Flupp

The threshold and offset options on the “Fine Tuning” configuration tab were introduced hoping for better compatibility. Unfortunately, after trying with the current version of Window Gaps (on Plasma 5.27.10), I noticed that the two scripts still don’t seem to play well together, and I do not know what else can be done about that. Sorry for the inconvenience.

Flupp

The threshold and offset options on the “Fine Tuning” configuration tab were introduced hoping for better compatibility. Unfortunately, after trying with the current version of Window Gaps (on Plasma 5.27.10), I noticed that the two scripts still don’t seem to play well together, and I do not know what else can be done about that. Sorry for the inconvenience.

xanderthunder

10 10 the best

jayarmstrong

10 10 the best

jayarmstrong

One problem: it resizes my windows vertically when I only want to resize them horizontally. This unsnaps all the windows i have from the top or bottom of the display, when I only intended to resize one or two windows. This is because the 'corner detection' area extends too far toward the middle of the windows (it seems to split at 30% top, 30% middle, 30% bottom). This wouldn't be as noticeable on small screens but on a large 4k monitor, my cursor can be five inches from the bottom of the window but still be detected as a 'corner' resize. Please adjust the thresholds to a sane amount of pixels or make it configurable for the user. Thank you!!

jayarmstrong

I should mention this is while using the ALT or META drag to resize windows (default KDE feature).

Pling
0 Affiliates
Details
license GPLv2 only
version 2.0.1
updated
added
downloads 24h 31
mediaviews 24h 0
pageviews 24h 8

Other KWin Scripts:

Grid-Tiling-Kwin
lingtjien
last update date: 11 months ago

Score 7.1

Quick Tile 2
tsoernes
last update date: 11 months ago

Score 5.8

UltrawideWindows
nopaste
last update date: 1 year ago

Score 8.8

KWin dynamic workspaces
d86leader
last update date: 2 months ago

Score 7.5

Toggle Window Visibility
arnek01
last update date: 9 months ago

Score 5.0

kwin-rectangle
acristoffers
last update date: 9 months ago

Score 6.9



System Tags