mirror of
https://gitlab.com/arnekeller/kwin-toggle-window.git
synced 2024-11-21 23:44:57 +00:00
Compare commits
2 Commits
f0b84cec2b
...
ef832c797f
Author | SHA1 | Date | |
---|---|---|---|
|
ef832c797f | ||
|
1e64cf4a4d |
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-FileCopyrightText: 2021 Arne Keller <arne.keller@posteo.de>
|
SPDX-FileCopyrightText: 2024 Arne Keller <arne.keller@posteo.de>
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -12,13 +12,13 @@ function isRelevant(client) {
|
|||||||
|
|
||||||
function toggleWindow() {
|
function toggleWindow() {
|
||||||
assertTrue(windowName != null, "ToggleWindow failed to load windowName from config!");
|
assertTrue(windowName != null, "ToggleWindow failed to load windowName from config!");
|
||||||
var allClients = workspace.clientList();
|
var allClients = workspace.windowList();
|
||||||
for (var i = 0; i < allClients.length; ++i) {
|
for (var i = 0; i < allClients.length; i++) {
|
||||||
if (isRelevant(allClients[i])) {
|
if (isRelevant(allClients[i])) {
|
||||||
var prevMini = allClients[i].minimized;
|
var prevMini = allClients[i].minimized;
|
||||||
allClients[i].minimized = !prevMini;
|
allClients[i].minimized = !prevMini;
|
||||||
if (prevMini) {
|
if (prevMini) {
|
||||||
workspace.activeClient = allClients[i];
|
workspace.activeWindow = allClients[i];
|
||||||
}
|
}
|
||||||
break; // only toggle one window
|
break; // only toggle one window
|
||||||
}
|
}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Name=Toggle Window
|
|
||||||
Comment=Changes minimization state of one window
|
|
||||||
Icon=preferences-system-windows-move
|
|
||||||
Type=Service
|
|
||||||
|
|
||||||
X-KDE-ServiceTypes=KWin/Script
|
|
||||||
X-Plasma-API=javascript
|
|
||||||
X-Plasma-MainScript=code/main.js
|
|
||||||
|
|
||||||
X-KDE-PluginInfo-Author=Arne Keller
|
|
||||||
X-KDE-PluginInfo-Email=arne.keller@posteo.de
|
|
||||||
X-KDE-PluginInfo-Name=togglewindow
|
|
||||||
X-KDE-PluginInfo-Version=0.1
|
|
||||||
X-KDE-PluginInfo-EnabledByDefault=true
|
|
||||||
X-KDE-PluginInfo-License=GPL-3.0
|
|
||||||
X-KDE-PluginInfo-Category=Windows and Tasks
|
|
21
metadata.json
Normal file
21
metadata.json
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"KPlugin": {
|
||||||
|
"Name": "Toggle Window Visibility",
|
||||||
|
"Description": "Changes minimization state of one window",
|
||||||
|
"Icon": "preferences-system-windows-move",
|
||||||
|
|
||||||
|
"Authors": [
|
||||||
|
{
|
||||||
|
"Email": "arne.keller@posteo.de",
|
||||||
|
"Name": "Arne Keller"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Id": "togglewindow",
|
||||||
|
"Version": "0.1.2",
|
||||||
|
"License": "GPLv3",
|
||||||
|
"Website": "https://www.opencode.net/arnek01/kwin-toggle-window/"
|
||||||
|
},
|
||||||
|
"X-Plasma-API": "javascript",
|
||||||
|
"X-Plasma-MainScript": "code/main.js",
|
||||||
|
"KPackageStructure": "KWin/Script"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user