gamemode: "Pause" fcitx while gaming

This commit is contained in:
PapaTutuWawa 2023-02-22 13:35:28 +01:00
parent 111b999b0a
commit d5262b0a7f

View File

@ -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}'';
};
};
};