From 43af16801fcbb7056a51ed5fd6539c74ff5c0379 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 12 Sep 2025 14:21:21 +0200 Subject: ... --- accounts/gkleen@sif/shell/quickshell/UnixIPC.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'accounts/gkleen@sif/shell/quickshell/UnixIPC.qml') diff --git a/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml b/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml index 742ef4f5..e7b7b673 100644 --- a/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml +++ b/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml @@ -1,7 +1,9 @@ import Quickshell import Quickshell.Io import Quickshell.Services.Pipewire +import Quickshell.Services.Mpris import qs.Services +import Custom as Custom Scope { id: root @@ -19,6 +21,14 @@ Scope { root.onCommandVolume(command.Volume); else if (command.Brightness) root.onCommandBrightness(command.Brightness); + else if (command.LockSession) + Custom.Systemd.lockSession(); + else if (command.Suspend) + Custom.Systemd.suspend(); + else if (command.Hibernate) + Custom.Systemd.hibernate(); + else if (command.Mpris) + root.onCommandMpris(command.Mpris); else console.warn("UnixIPC: Command not handled:", JSON.stringify(command)); } catch (e) { @@ -56,4 +66,12 @@ Scope { if (command === "down") Brightness.currBrightness -= 0.02 } + + function onCommandMpris(command) { + if (command.PauseAll) + Array.from(MprisProxy.players).forEach(player => { + if (player.canPause && player.isPlaying) + player.pause(); + }); + } } -- cgit v1.2.3