From 6d9e4ad2fa092f7ef0956164423dd2e84ffefadd Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 17 Jul 2025 20:23:03 +0700 Subject: [PATCH] more quickshell.execdetached instead of hyprland dispatch trick --- .config/quickshell/ii/modules/bar/UtilButtons.qml | 6 +++--- .config/quickshell/ii/modules/session/Session.qml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.config/quickshell/ii/modules/bar/UtilButtons.qml b/.config/quickshell/ii/modules/bar/UtilButtons.qml index 706ba6f6b..2db3e96df 100644 --- a/.config/quickshell/ii/modules/bar/UtilButtons.qml +++ b/.config/quickshell/ii/modules/bar/UtilButtons.qml @@ -24,7 +24,7 @@ Item { visible: Config.options.bar.utilButtons.showScreenSnip sourceComponent: CircleUtilButton { Layout.alignment: Qt.AlignVCenter - onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent") + onClicked: Quickshell.execDetached(["qs", "-p", Quickshell.configPath("screenshot.qml")]) MaterialSymbol { horizontalAlignment: Qt.AlignHCenter fill: 1 @@ -40,7 +40,7 @@ Item { visible: Config.options.bar.utilButtons.showColorPicker sourceComponent: CircleUtilButton { Layout.alignment: Qt.AlignVCenter - onClicked: Hyprland.dispatch("exec hyprpicker -a") + onClicked: Quickshell.execDetached(["hyprpicker", "-a"]) MaterialSymbol { horizontalAlignment: Qt.AlignHCenter fill: 1 @@ -72,7 +72,7 @@ Item { visible: Config.options.bar.utilButtons.showMicToggle sourceComponent: CircleUtilButton { Layout.alignment: Qt.AlignVCenter - onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle") + onClicked: Quickshell.execDetached(["wpctl", "set-mute", "@DEFAULT_SOURCE@", "toggle"]) MaterialSymbol { horizontalAlignment: Qt.AlignHCenter fill: 0 diff --git a/.config/quickshell/ii/modules/session/Session.qml b/.config/quickshell/ii/modules/session/Session.qml index b6f030f9a..8b98e7f93 100644 --- a/.config/quickshell/ii/modules/session/Session.qml +++ b/.config/quickshell/ii/modules/session/Session.qml @@ -93,7 +93,7 @@ Scope { focus: sessionRoot.visible buttonIcon: "lock" buttonText: Translation.tr("Lock") - onClicked: { Hyprland.dispatch("exec loginctl lock-session"); sessionRoot.hide() } + onClicked: { Quickshell.execDetached(["loginctl", "lock-session"]); sessionRoot.hide() } onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } KeyNavigation.right: sessionSleep KeyNavigation.down: sessionHibernate @@ -102,7 +102,7 @@ Scope { id: sessionSleep buttonIcon: "dark_mode" buttonText: Translation.tr("Sleep") - onClicked: { Hyprland.dispatch("exec systemctl suspend || loginctl suspend"); sessionRoot.hide() } + onClicked: { Quickshell.execDetached(["bash", "-c", "systemctl suspend || loginctl suspend"]); sessionRoot.hide() } onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } KeyNavigation.left: sessionLock KeyNavigation.right: sessionLogout @@ -112,7 +112,7 @@ Scope { id: sessionLogout buttonIcon: "logout" buttonText: Translation.tr("Logout") - onClicked: { Hyprland.dispatch("exec pkill Hyprland"); sessionRoot.hide() } + onClicked: { Quickshell.execDetached(["pkill", "Hyprland"]); sessionRoot.hide() } onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } KeyNavigation.left: sessionSleep KeyNavigation.right: sessionTaskManager