diff --git a/README.md b/README.md index d680bc5..665c05a 100644 --- a/README.md +++ b/README.md @@ -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 @@ -18,9 +19,9 @@ 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 @@ -28,9 +29,8 @@ 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 diff --git a/contents/code/main.js b/contents/code/main.js index 7cf17b5..4039bb7 100644 --- a/contents/code/main.js +++ b/contents/code/main.js @@ -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 } } diff --git a/metadata.json b/metadata.json index b8951d8..cfd5b97 100644 --- a/metadata.json +++ b/metadata.json @@ -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" }