feat(hyprland): add "game mode" toggle
This mode turns off most animations and hides the UI to save resources.
This commit is contained in:
parent
2d5b25daa3
commit
0edf02262a
2 changed files with 26 additions and 0 deletions
|
|
@ -138,6 +138,9 @@ in {
|
||||||
# Workspace manipulation
|
# Workspace manipulation
|
||||||
"$mod, N, global, ${shell}:newworkspace"
|
"$mod, N, global, ${shell}:newworkspace"
|
||||||
"$mod Shift, N, global, ${shell}:movetonewworkspace"
|
"$mod Shift, N, global, ${shell}:movetonewworkspace"
|
||||||
|
|
||||||
|
# Game Mode
|
||||||
|
"$mod, F1, exec, ${scripts}/gamemode"
|
||||||
] ++
|
] ++
|
||||||
builtins.concatMap (n:
|
builtins.concatMap (n:
|
||||||
let
|
let
|
||||||
|
|
|
||||||
23
home-manager/wayland/scripts/gamemode
Executable file
23
home-manager/wayland/scripts/gamemode
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
|
||||||
|
if [ "$HYPRGAMEMODE" = 1 ] ; then
|
||||||
|
hyprctl --batch "\
|
||||||
|
keyword animations:enabled 0;\
|
||||||
|
keyword animation borderangle,0; \
|
||||||
|
keyword decoration:shadow:enabled 0;\
|
||||||
|
keyword decoration:blur:enabled 0;\
|
||||||
|
keyword decoration:fullscreen_opacity 1;\
|
||||||
|
keyword general:gaps_in 0;\
|
||||||
|
keyword general:gaps_out 0;\
|
||||||
|
keyword general:border_size 0;\
|
||||||
|
keyword decoration:rounding 0"
|
||||||
|
hyprctl dispatch global "quickshell:hidden"
|
||||||
|
hyprctl notify 1 2000 "rgb(73daca)" "Gamemode [ON]"
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
hyprctl notify 1 2000 "rgb(f7768e)" "Gamemode [OFF]"
|
||||||
|
hyprctl dispatch global "quickshell:hiddenoff"
|
||||||
|
hyprctl reload
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
Loading…
Add table
Add a link
Reference in a new issue