Skip to content

KWin script for KDE Plasma which suggests other window thumbnails on snap

License

Notifications You must be signed in to change notification settings

emvaized/kde-snap-assist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KDE Snap Assist

KDE Store GitHub Release

Note

⚠️ Only Plasma 5 is supported for now! Plasma 6 port is being worked on

This KWin script for KDE Plasma suggests other window thumbnails on snap. It tries to replicate the famous Windows 10/11 feature of the same name.

Assist can be shown by dragging a window to the screen edge, as well as via default keyboard shortcuts (super + arrows). You can select the window with mouse, as well as with arrow keys + Enter. To dismiss the assist, hit Escape key, press the close button or click anywhere on the empty area. Script also supports quarter and triple tiling: you can switch layouts with the Tab key or using the button in corner.

Ideas, suggestions, bugs reports and contributions to the project are welcome!

Support

This project is in need of your support! If you enjoy it and want to keep it going on, please consider supporting by making a small donation using one of the services below!

Support on Ko-fi    Donate using Liberapay    Donate Bitcoin

Screenshot

screenshot_snapassist

Manual Installation

In order to install this script manually from GitHub, you'd need to:

  • Delete current version of script and re-login to KDE Plasma
  • Download the code as .zip (green "Code" button > "Download as ZIP"), and rename file to .kwinscript extension
  • Use the "Install from file" button in System settings > Windows manager > KWin scripts
  • Re-login to Plasma again (or restart KWin) to make sure the script is installed

There is also experimental 2.0-dev version, which you could help to test!

Snap Groups

Since version 1.4, there are also experimental snap group features:

  • Minimize/restore snapped windows together (demo)
  • Raise snapped windows together (demo)
  • On close snapped window, try to fill the area (demo)
  • Try to fit snapped window in group behind (demo)

When you enable any of these options in the script settings, it will start tracking windows snapped via the script. Group of snapped windows is remembered once you fill the layout using the assist. Window is no longer considered snapped once it was closed or moved manually using the mouse (sometimes you need to do it twice to break it from the group). Snap groups are not persistent, and should be recreated after each reboot.

Compatibility notes

Compatibility with Window Gap

  • Since version 1.2, there's an option "Snap detect tolerance" in the script settings, which basically defines how much window's size and position can differ to still be detected as "snapped" by the script. If you use some external scripts which constantly modify windows size and position, you may want to set it to 15px or 25px, so that Snap Assist could detect your snaps.

Compatibility with Exquisite

  • Most of default layouts are supported out the box. You may also like to enable "Hide after tiling a window" in Exquisite's settings for the smoothest workflow. Over time, support for custom layouts will expand, possibly with ability to edit them.

Compatibility with Sticky Window Snapping

  • Fully compatible. Highly recommended to be used in conjunction with Snap Assist!

Compatibility with diagonal keyboard shortcuts

  • Version 1.4 introduces an option "Delay before showing the assist", which gives some time to execute 'diagonal' shortcuts (super + + ) before Assist gets shown. The default value is 100ms.

Troubleshooting

  • To apply the new settings, you may need to re-enable the script or restart KWin. The same is recommended if you switch from one version of the script to another
  • Assist will not show if you have no other windows matching the conditions set in the script settings. For example, by default the script does not show windows from other screens — so, if you have only one window on the current screen, assist will not show
  • Script settings button is not visible, or complains that "Plugin doesn't provide configuration file in the expected location" — this is a known KWin's bug, not related to the script. Make sure your system is up-to-date, as it seems to be fixed now. If it doesn't help, you can also try to install the script manually
  • KWin crashes after sleep — it was reported here that you may need to install pygdbmi library to fix the crash after sleep