From ebb243f2a9749807a74ccf8bb9a56ccb986f8ae1 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 8 Feb 2025 14:09:50 +0100 Subject: [PATCH] game mode toggle: fix reversed button appearance --- .config/ags/modules/sideright/quicktoggles.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.config/ags/modules/sideright/quicktoggles.js b/.config/ags/modules/sideright/quicktoggles.js index 8bd79b1c..f7f309a3 100644 --- a/.config/ags/modules/sideright/quicktoggles.js +++ b/.config/ags/modules/sideright/quicktoggles.js @@ -212,14 +212,13 @@ export const ModuleGameMode = async (props = {}) => { onClicked: (button) => { Hyprland.messageAsync('j/getoption animations:enabled') .then((output) => { - const value = JSON.parse(output)["int"]; - if (value == 1) { + const enabled = JSON.parse(output)["int"] === 1; + if (enabled) { execAsync(['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" & hyprctl reload`]).catch(print); - button.toggleClassName('sidebar-button-active', false); } else { execAsync(['bash', '-c', `hyprctl --batch "keyword animations:enabled 1; keyword general:allow_tearing 0" & hyprctl reload`]).catch(print); - button.toggleClassName('sidebar-button-active', true); } + button.toggleClassName('sidebar-button-active', enabled); }) }, child: MaterialIcon('gamepad', 'norm'),