use more hyprland dispatch exec instead of a process for simple stuff

This commit is contained in:
end-4
2025-04-27 23:22:27 +02:00
parent 9b0d769598
commit ab9b17a188
6 changed files with 17 additions and 48 deletions
@@ -1,29 +1,25 @@
import "root:/modules/common"
import "root:/modules/common/widgets"
import "../"
import Quickshell.Io
import Quickshell
import Quickshell.Io
import Quickshell.Hyprland
QuickToggleButton {
property bool enabled: false
buttonIcon: "gamepad"
toggled: enabled
onClicked: {
enabled = !enabled
if (enabled) {
gameModeOn.running = true
// gameModeOn.running = true
Hyprland.dispatch(`exec 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"`)
} else {
gameModeOff.running = true
Hyprland.dispatch("exec hyprctl reload")
}
}
Process {
id: gameModeOn
command: ['bash', '-c', `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"`]
}
Process {
id: gameModeOff
command: ['bash', '-c', `hyprctl reload`]
}
StyledToolTip {
content: qsTr("Game mode")
}