KWin script that moves fullscreened window to a new virtual desktop, emulating macOS like maximize to new desktop.
The config panel
- Move window to a newly created virtual desktop when fullscreen/maximize.
- Move window back to original desktop when restored to normal size or closed.
- Configurable trigger:
fullscreen
ormaximize
orboth
. - Configurable new desktop position:
right most
ornext to current desktop
ornext to app
. - Window blacklist: windows that match the class name will not trigger the script.
Note:
The default behavior is triggered by window FULLSCREEN, not the normal maximize. Window fullscreen can be enabled by right clicking on the window decoration -> More Actions
-> Fullscreen
.
Web browsers also enters fullscreen mode when the web page requests so, like clicking on fullscreen button in videos. In Firefox or Chrome, pressing F11
also triggeres this.
Go to System Settings
-> Window Management
-> KWin Scripts
-> Get New Scripts...
And then search for kwin-maximize-to-new-desktop
.
Note: To get the configuration panel fully working, see this and this
Download the latest release from KDE store, and run
plasmapkg2 --install kwin-maxmize-to-new-desktop-0.2.0.tar.gz
Note: To get the configuration panel fully working, see this and this
Right click on the window decoration of the window of interest, then select
More actions
-> Special Window Settings
in the menu. In the "Window matching"
tab, there's a little utility called "Detect Window Properties" that can be used to reveal information of clicked window.
Due to a technical limitation of installation, the desktop file is not installed into correct place. More details here.
mkdir -p ~/.local/share/kservices5
ln -s ~/.local/share/kwin/scripts/max2NewVirtualDesktop/metadata.desktop ~/.local/share/kservices5/max2NewVirtualDesktop.desktop
You need to install an additional package called kdesignerplugin
(link),
which makes it possible to use KEditListWidget.
- For ArchLinux:
pacman -Syu kdesignerplugin
. - For Ubuntu and alike:
apt install kdesignerplugin
.
Log out and log in again.
Or you could try something like the following to restart kwin (the executable name may be different depending on your Linux distribution.)
kwin_x11 --replace >/dev/null 2>/dev/null &; disown
Fixed in efc212cbc38b8f5d10a30d28a034e21288519ea4.
The root cause is the clientRemoved signal I connected to is too late and only emits after cleanGrouping called on the client. Moving the client around and changing focus requires a not null group of the client in kwin. Therefore, changing to per window windowClosed signal works.
See CHANGELOG.md.
- I got the idea of triggering by maximize and other things from one of the fork by @lrasche.
- I also learned a lot about adding configuration UI from faho/kwin-tiling.