Sticky Window Snapping Original

Kwin Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): https://github.com/Flupp/sticky-window-snapping

21
8 .8
Description:

[p]KWin script to let snapped window edges stick together when one window is resized.[/p][p]The script provides an easy to use configuration dialog, which can be reached via “systemsettings”. (However, note section “Bugs and Workarounds”.)[/p][p]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. The default shortcut keys are Meta+Shift+S and Ctrl+Shift+S, respectively. You can change them using “systemsettings” (or “kcmshell4 keys”); they are associated with the component “KWin”. Their names are prefixed by “KWin Script: Sticky Window Snapping”.[/p]

Bugs and Workarounds

  • If the configuration dialog is not reachable via “systemsettings”, then try the following command and restart “systemsettings”: ln --relative --symbolic ~/.local/share/kwin/scripts/sticky-window-snapping/metadata.desktop ~/.local/share/kservices5/kwin-script-sticky-window-snapping.desktop
  • If the script does not work, increasing the threshold 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, if this is a bug or a feature, yet.
Last changelog:

v1.0 1 year ago

new:

  • configuration dialog
  • configurable transparency of unaffected windows
  • configurable threshold defining a maximal distance to consider edges as snapped
  • option to ignore maximized windows
  • option to ignore window edges that touch an edge of the screen
  • restore affected minimized windows temporarily
changed:
  • highlight a snapped window only when its size is changed
  • also consider windows that are on all desktops
  • delay transparency changes until first resize step to prevent flickering
  • do not restrict a window to the client area (typically the screen size) if it already exceeds it
fixed:
  • crash on resize when a snapped window disappears

10

m0ji

1 month ago

10 10 the best

Report

aliases01

3 months ago

Nice script. But the location of the kservices5 folder seems to have moved. I used the following command to get the button to open the configuration window (replace username with your own):

sudo ln --symbolic /home//.local/share/kwin/scripts/sticky-window-snapping/metadata.desktop /usr/share/kservices5/kwin-script-sticky-window-snapping.desktop

It's a bit dirty und i guess it will cause problems if the users home folder is removed but at least it works.

Report

aliases01

3 months ago

It seems that I somehow missed the comment from datamaskinen and can't figure out how to remove my own comment...
Use the solution described there, it's way cleaner.

Report

azarilh

6 months ago

With this script, on Kubuntu 20.04, the blur region is bigger than it should on GTK3 apps like Firefox.
https://bugs.kde.org/show_bug.cgi?id=422202

Report

C

Flupp

6 months ago

The bug report you are referring to talks about the Force Blur KWin script. Where does Sticky Window Snapping come into play?

Report

azarilh

5 months ago

Bwahahahahahah! My silliness is over 9000! How could i not notice!? xD

Report

10

patrolez

7 months ago

10 10 the best. Much more intuitive than known to me tilling managers.

Report

9

gcjuan

7 months ago

9 9 excellent As lots of comments say, it should be a default in Plasma, very usefull!

Report

10

vit-skalicky

7 months ago

10 10 the best

Should be in plasma by default. Even windows has something similar (but less powerful)

Report

datamaskinen

1 year ago

if you have problem with adding the link just create the folder first and then run the linking...

mkdir ~/.local/share/kservices5

ln --relative --symbolic ~/.local/share/kwin/scripts/sticky-window-snapping/metadata.desktop ~/.local/share/kservices5/kwin-script-sticky-window-snapping.desktop

Report

10

alex1701c

1 year ago

10 10 the best

Report

10

kaetir

1 year ago

10 must have

Report

10

pyro226

1 year ago

10 KDE should ship with this

Report

10

eptin

1 year ago

This feature should be part of kde-plasma by default

Report

10

eptin

1 year ago

10 10 the best

Report

9

roachsinai

1 year ago

9 +

Report

9

duncanyoyo1

1 year ago

9 +

Report

9

jontheburger

1 year ago

9 +

Report

9

molecule-eye

1 year ago

Ctrl + shift + S is already reserved for "save as". It gets hijacked by the script. I would change the default to something else.

Report

C

Flupp

1 year ago

Thank you for the hint! However, it’s hard to find a sensible key combination that is not already used by another application. Any suggestions are welcome! (preferably via https://github.com/Flupp/sticky-window-snapping/issues/9)

Report

9

molecule-eye

1 year ago

I can't get the settings dialog to show. Is there a config file somewhere for adjusting things like opacity?

Report

C

Flupp

1 year ago

Have you tried the workaround given in the description?

• If the configuration dialog is not reachable via “systemsettings”, then try the following command and restart “systemsettings”:

ln --relative --symbolic ~/.local/share/kwin/scripts/sticky-window-snapping/metadata.desktop ~/.local/share/kservices5/kwin-script-sticky-window-snapping.desktop

Report

9

molecule-eye

1 year ago

9 + This is awesome and should be incorporated into kwin and maintained upstream!

Report

9

chickenff

1 year ago

9 fantastic

Report

leggettc18

2 years ago

Maybe I'm just missing something, but it seems like there's no area between the windows where I can click and drag to resize. It works if I alt + right-click and move the mouse to resize, the snapped windows also resize appropriately, but I can't manage to click in between them...

Report

v1.0 1 year ago

new:

  • configuration dialog
  • configurable transparency of unaffected windows
  • configurable threshold defining a maximal distance to consider edges as snapped
  • option to ignore maximized windows
  • option to ignore window edges that touch an edge of the screen
  • restore affected minimized windows temporarily
changed:
  • highlight a snapped window only when its size is changed
  • also consider windows that are on all desktops
  • delay transparency changes until first resize step to prevent flickering
  • do not restrict a window to the client area (typically the screen size) if it already exceeds it
fixed:
  • crash on resize when a snapped window disappears

v0.2.1 1 year ago

  • fixed resizing for windows spanning multiple screens

v0.2 1 year ago

  • maximized windows are ignored now
  • shaded windows are ignored now
  • windows on other screens are ignored now
  • changed behavior when windows get very small while resizing

v0.1 1 year ago

  • initial release

12345678910
277
product-maker m0ji Oct 27 2020 10 the best
10 the best
product-maker patrolez Apr 27 2020 10 the best
10 the best. Much more intuitive than known to me tilling managers.
product-maker gcjuan Apr 14 2020 9 excellent
9 excellent As lots of comments say, it should be a default in Plasma, very usefull!
product-maker vit-skalicky Apr 09 2020 10 the best
10 the best Should be in plasma by default. Even windows has something similar (but less powerful)
product-maker alex1701c Jul 06 2019 10 the best
10 the best
product-maker kaetir Jun 09 2019 10 the best
must have
product-maker pyro226 May 26 2019 10 the best
KDE should ship with this
product-maker eptin May 19 2019 10 the best
10 the best
product-maker roachsinai Apr 02 2019 9 excellent
+
product-maker duncanyoyo1 Feb 27 2019 9 excellent
+
product-maker jontheburger Feb 17 2019 9 excellent
+
product-maker molecule-eye Feb 08 2019 9 excellent
+ This is awesome and should be incorporated into kwin and maintained upstream!
product-maker chickenff Dec 11 2018 9 excellent
fantastic
product-maker moonchild19 Nov 21 2018 9 excellent
+Very useful!!
product-maker brazzmonkey Nov 08 2018 9 excellent
Rendering seems to lag a little, but the extra functionality is awesome. This should be offered in KWin by default.
product-maker kuriot Oct 07 2018 9 excellent
+
product-maker L0sted Jun 29 2018 9 excellent
+
product-maker sh4nks Jan 04 2018 9 excellent
product-maker KIMW Jun 16 2017 9 excellent
product-maker Zren May 01 2017 9 excellent
product-maker chips Sep 04 2016 9 excellent
product-maker qtnerd Aug 14 2016 9 excellent
product-maker lboklin Jan 03 2016 9 excellent
product-maker mirkogennari Oct 07 2015 9 excellent
product-maker mcaceres Oct 03 2014 9 excellent
product-maker jospoortvliet_double Sep 23 2014 9 excellent
product-maker SeaJey Oct 31 2013 9 excellent
product-maker jaitrum Oct 31 2013 9 excellent
product-maker deabru Oct 30 2013 9 excellent
product-maker saabzero Jun 27 2013 9 excellent
product-maker Henri Apr 15 2013 9 excellent
product-maker Contrast Mar 09 2013 9 excellent
product-maker Hmpf Mar 09 2013 9 excellent
product-maker herrbatka Mar 09 2013 9 excellent
Be the first to comment
aliases01
Aug 05 2020
artdev
Jul 08 2020
csaratakij
May 24 2020
loissmoon
Dec 30 2019
juliedparker
Dec 13 2019
alex1701c
Jul 06 2019
jontheburger
Feb 17 2019
m0ji
Feb 06 2019
chickenff
Dec 11 2018
brazzmonkey
Nov 08 2018
cat0
Oct 23 2018
kuriot
Oct 07 2018
yannux
Sep 20 2018
slm33
Jul 03 2018
diVinae
May 28 2018
nchyfw
May 27 2018
Warmuser
Apr 23 2018
KVAnton-WEB
Mar 10 2018
lboklin
Jan 03 2016
jaitrum
Oct 31 2013
deabru
Oct 30 2013
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
GPLv2 only
version
1.0
updated May 27 2018
added Mar 09 2013
downloads 24h
38
mediaviews 24h 0
pageviews 24h 25