diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-24 23:48:47 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-24 23:48:47 +1000 |
| commit | 57e3989185b8209a11d79bac477479019d515180 (patch) | |
| tree | 27e94dcaef9f41bb8f294eab1a91a27ce4da03d0 /services/GameMode.qml | |
| parent | plugin: sub namespace modules (diff) | |
| download | caelestia-shell-57e3989185b8209a11d79bac477479019d515180.tar.gz caelestia-shell-57e3989185b8209a11d79bac477479019d515180.tar.bz2 caelestia-shell-57e3989185b8209a11d79bac477479019d515180.zip | |
plugin: add hypr extras (#690)
* move machine
* works
* prevent duplicate refreshes
* use instead of hyprctl proc
Diffstat (limited to 'services/GameMode.qml')
| -rw-r--r-- | services/GameMode.qml | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/services/GameMode.qml b/services/GameMode.qml index 6771d59..edd741c 100644 --- a/services/GameMode.qml +++ b/services/GameMode.qml @@ -1,5 +1,6 @@ pragma Singleton +import qs.services import qs.config import Caelestia import Quickshell @@ -12,7 +13,7 @@ Singleton { property alias enabled: props.enabled function setDynamicConfs(): void { - Quickshell.execDetached(["hyprctl", "--batch", "keyword animations:enabled 0;keyword decoration:shadow:enabled 0;keyword decoration:blur:enabled 0;keyword general:gaps_in 0;keyword general:gaps_out 0;keyword general:border_size 1;keyword decoration:rounding 0;keyword general:allow_tearing 1"]); + Hypr.message("[[BATCH]]keyword animations:enabled 0;keyword decoration:shadow:enabled 0;keyword decoration:blur:enabled 0;keyword general:gaps_in 0;keyword general:gaps_out 0;keyword general:border_size 1;keyword decoration:rounding 0;keyword general:allow_tearing 1"); } onEnabledChanged: { @@ -21,7 +22,7 @@ Singleton { if (Config.utilities.toasts.gameModeChanged) Toaster.toast(qsTr("Game mode enabled"), qsTr("Disabled Hyprland animations, blur, gaps and shadows"), "gamepad"); } else { - Quickshell.execDetached(["hyprctl", "reload"]); + Hypr.message("reload"); if (Config.utilities.toasts.gameModeChanged) Toaster.toast(qsTr("Game mode disabled"), qsTr("Hyprland settings restored"), "gamepad"); } @@ -30,7 +31,7 @@ Singleton { PersistentProperties { id: props - property bool enabled + property bool enabled: Hypr.options["animations:enabled"] === 0 reloadableId: "gameMode" } @@ -44,14 +45,6 @@ Singleton { } } - Process { - running: true - command: ["hyprctl", "getoption", "animations:enabled", "-j"] - stdout: StdioCollector { - onStreamFinished: props.enabled = JSON.parse(text).int === 0 - } - } - IpcHandler { target: "gameMode" |