diff --git a/modules/services/gamemode/default.nix b/modules/services/gamemode/default.nix index fcabab6..e5bda01 100644 --- a/modules/services/gamemode/default.nix +++ b/modules/services/gamemode/default.nix @@ -29,17 +29,14 @@ in { }; custom = let - razerBrightnessStartScript = pkgs.writeShellScriptBin "razer-brightness-start.sh" '' - ${pkgs.razer-cli}/bin/razer-cli -d "Razer BlackWidow Ultimate 2013" -b 1 - ${pkgs.razer-cli}/bin/razer-cli -d "Razer Tartarus V2" -b 50 - ''; - razerBrightnessStopScript = pkgs.writeShellScriptBin "razer-brightness-stop.sh" '' - ${pkgs.razer-cli}/bin/razer-cli -d "Razer BlackWidow Ultimate 2013" -b 0 - ${pkgs.razer-cli}/bin/razer-cli -d "Razer Tartarus V2" -b 0 + switchScript = groupName: pkgs.writeShellScript "switch-input-group.sh" '' + ${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SwitchInputMethodGroup string:'${groupName}' ''; + pauseFcitx = switchScript "Group 2"; + resumeFcitx = switchScript "Group 1"; in { - start = ''${razerBrightnessStartScript}/bin/razer-brightness-start.sh''; - end = ''${razerBrightnessStopScript}/bin/razer-brightness-stop.sh''; + start = ''${pauseFcitx}''; + end = ''${resumeFcitx}''; }; }; };