forked from Shinonome/dots-hyprland
game mode toggle: fix reversed button appearance
This commit is contained in:
@@ -212,14 +212,13 @@ export const ModuleGameMode = async (props = {}) => {
|
|||||||
onClicked: (button) => {
|
onClicked: (button) => {
|
||||||
Hyprland.messageAsync('j/getoption animations:enabled')
|
Hyprland.messageAsync('j/getoption animations:enabled')
|
||||||
.then((output) => {
|
.then((output) => {
|
||||||
const value = JSON.parse(output)["int"];
|
const enabled = JSON.parse(output)["int"] === 1;
|
||||||
if (value == 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);
|
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 {
|
} else {
|
||||||
execAsync(['bash', '-c', `hyprctl --batch "keyword animations:enabled 1; keyword general:allow_tearing 0" & hyprctl reload`]).catch(print);
|
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'),
|
child: MaterialIcon('gamepad', 'norm'),
|
||||||
|
|||||||
Reference in New Issue
Block a user