Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This KWin script provides user definable shortcuts that let you move all your
windows to a specific screen. If you want to quickly move all windows from one
screen to another this is for you.

Updated by Al Williams for KDE6

## Motive

Expand All @@ -18,19 +19,18 @@ providing shortcuts for moving all windows to a specific screen.
## Installation

First clone this repo and run the following command in the root directory of the
repo.
repo (note that KWin has two capital letters and, yes, it matters).

plasmapkg2 --type kwinscript -i .
kpackagetool6 --type KWin/Script -i .

After that open KWin Scripts (System Settings -> Window Management ->
KWin Scripts) and enable "Move All Windows to Screen". This won't yet enable
any shortcuts, you can define your own key bindings. See Setup for details.

If you need to update the script to a new version pull the repo again and run:

plasmapkg2 --type kwinscript -r .
plasmapkg2 --type kwinscript -i .

kpackagetool6 --type KWin/Script -r moveallwindowstoscreen
kpackagetool6 --type KWin/Script -i .

## Setup

Expand Down
5 changes: 3 additions & 2 deletions contents/code/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ function isRelevant(client) {
}

function moveAllWindowsToScreen(screen) {
var allClients = workspace.clientList();
if (screen>workspace.screens.length-1) return;
var allClients = workspace.windowList(); // was clientList in v5
var relevantClients = allClients.filter(function(client) {
return isRelevant(client);
});

for (var i = 0; i < relevantClients.length; ++i) {
var client = relevantClients[i];
workspace.sendClientToScreen(client, screen);
workspace.sendClientToScreen(client, workspace.screens[screen]); // was just screen number in v5
}
}

Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
},
"X-KDE-PluginKeyword": "moveallwindowstoscreen",
"X-Plasma-API": "javascript",
"X-Plasma-MainScript": "code/main.js"
"X-Plasma-MainScript": "code/main.js",
"KPackageStructure": "KWin/Script"
}