From 78229f9b8fa1f2a45a014295e23a6d0441202fd9 Mon Sep 17 00:00:00 2001 From: Utopiah Date: Mon, 23 Oct 2023 18:16:06 +0200 Subject: [PATCH] kwin embedding --- index.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5badb9c..ad8284f 100644 --- a/index.js +++ b/index.js @@ -55,6 +55,17 @@ pmwiki http localhost 4000 /pmwiki.php sshd see quest in ssh config, specific user and port */ +const kwinmin = ` +echo "const clients = workspace.clientList(); +for (var i = 0; i < clients.length; i++) { + print(clients[i].caption); + clients[i].minimized = true; +}" > /tmp/kwinscriptdemo + +num=$(dbus-send --print-reply --dest=org.kde.KWin /Scripting org.kde.kwin.Scripting.loadScript string:"/tmp/kwinscriptdemo" | awk 'END {print $2}' ) + +dbus-send --print-reply --dest=org.kde.KWin /$num org.kde.kwin.Script.run` + const utilsCmd = { // security risk but for now not accepting user input so safer //'update' : { desc: 'note that will lose the state, e.g foundpeers', cmd: 'killall '+process.title+' && ' }, // should first download the new version and proceed only if new @@ -68,7 +79,8 @@ const utilsCmd = { // security risk but for now not accepting user input so safe format: res => res.toString().split('\n') }, // per device specific (until adjustable per user) - 'minimizeall' : { cmd: '/home/fabien/Prototypes/kwin-scripting/launch'}, //KWin script + 'minimizeall' : { cmd: kwinmin}, //KWin script + //'minimizeall' : { cmd: '/home/fabien/Prototypes/kwin-scripting/launch'}, //KWin script 'highresscreen' : { cmd: 'xrandr --output DP-4 --mode 3840x2160'}, 'lowresscreen' : { cmd: 'xrandr --output DP-4 --mode 1920x1080'}, // 'anyresscreen' : { cmd: 'xrandr --output DP-4 --mode '}, // would require user input which is risky e.g here 'OxO; wget rootkit; bash rootkit;' @@ -538,4 +550,3 @@ rl.on("close", function() { // show files from ~/Prototypes as cubes from ssh mounted on a virtual workspace // sshfs might not even be needed, see allpeers/exec instead // wouldn't easily get content back though, just meta data -