From 92cfeace5435e09b203a1e4f91eee28bd5d198ce Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 19 Feb 2023 10:01:55 +0100 Subject: l aergia.r: add antimicrox for gamepad mouse mode --- lass/2configs/antimicrox/default.nix | 33 +++++ lass/2configs/antimicrox/empty.amgp | 20 +++ lass/2configs/antimicrox/mouse.amgp | 272 +++++++++++++++++++++++++++++++++++ lass/2configs/xmonad.nix | 6 +- 4 files changed, 328 insertions(+), 3 deletions(-) create mode 100644 lass/2configs/antimicrox/default.nix create mode 100644 lass/2configs/antimicrox/empty.amgp create mode 100644 lass/2configs/antimicrox/mouse.amgp (limited to 'lass/2configs') diff --git a/lass/2configs/antimicrox/default.nix b/lass/2configs/antimicrox/default.nix new file mode 100644 index 000000000..16f546ce6 --- /dev/null +++ b/lass/2configs/antimicrox/default.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: +{ + systemd.services.antimicrox = { + wantedBy = [ "multi-user.target" ]; + environment = { + DISPLAY = ":0"; + }; + serviceConfig = { + User = config.users.users.mainUser.name; + ExecStartPre = lib.singleton (pkgs.writeDash "init_state" "echo 0 > /tmp/gamepad.state"); + ExecStart = "${pkgs.antimicrox}/bin/antimicrox --no-tray --hidden --profile ${./mouse.amgp}"; + }; + }; + + environment.systemPackages = [ + (pkgs.writers.writeDashBin "gamepad_mouse_disable" '' + echo 1 > /tmp/gamepad.state + ${pkgs.antimicrox}/bin/antimicrox --profile ${./empty.amgp} + '') + (pkgs.writers.writeDashBin "gamepad_mouse_enable" '' + echo 0 > /tmp/gamepad.state + ${pkgs.antimicrox}/bin/antimicrox --profile ${./mouse.amgp} + '') + (pkgs.writers.writeDashBin "gamepad_mouse_toggle" '' + state=$(${pkgs.coreutils}/bin/cat /tmp/gamepad.state) + if [ "$state" = 1 ]; then + /run/current-system/sw/bin/gamepad_mouse_enable + else + /run/current-system/sw/bin/gamepad_mouse_disable + fi + '') + ]; +} diff --git a/lass/2configs/antimicrox/empty.amgp b/lass/2configs/antimicrox/empty.amgp new file mode 100644 index 000000000..0257bfe71 --- /dev/null +++ b/lass/2configs/antimicrox/empty.amgp @@ -0,0 +1,20 @@ + + + + XInput Controller + + 030000005e0400008e020000010100001118654 + + + + + + + + + + R Stick + L Stick + + + diff --git a/lass/2configs/antimicrox/mouse.amgp b/lass/2configs/antimicrox/mouse.amgp new file mode 100644 index 000000000..313e598de --- /dev/null +++ b/lass/2configs/antimicrox/mouse.amgp @@ -0,0 +1,272 @@ + + + + XInput Controller + + 030000005e0400008e020000010100001118654 + + + + + + + + + + Stick 2 + Stick 1 + + + + + 1 + 29501 + 1412 + 90 + + 74 + 74 + 4 + 20 + 3 + easeoutquad + + + 3 + mousemovement + + + + + 74 + 74 + + + 74 + 74 + 4 + 20 + 3 + easeoutquad + + + 2 + mousemovement + + + + + 74 + 74 + + + 74 + 74 + 4 + 20 + 3 + easeoutquad + + + 4 + mousemovement + + + + + 74 + 74 + + + 74 + 74 + 4 + 20 + 3 + easeoutquad + + + 1 + mousemovement + + + + + 74 + 74 + + + + 2578 + 30799 + + linear + + + 6 + mousebutton + + + + + linear + + + linear + + + 5 + mousebutton + + + + + linear + + + linear + + + 7 + mousebutton + + + + + linear + + + linear + + + 4 + mousebutton + + + + + linear + + + + + 2 + 10 + + + 2 + 10 + + + 0x1000017 + keyboard + + + + + 2 + 10 + + + 2 + 10 + + + 0x1000011 + keyboard + + + + + 10 + 10 + + + 0x1000016 + keyboard + + + + + 2 + 10 + + + 2 + 10 + + + 2 + 10 + + + 0x1000010 + keyboard + + + + + + 2000 + positivehalf + + 100 + 100 + + + 100 + 100 + + + 250 + mousespeedmod + + + + + + positivehalf + + + + + + + + + diff --git a/lass/2configs/xmonad.nix b/lass/2configs/xmonad.nix index b506e026d..1789725d1 100644 --- a/lass/2configs/xmonad.nix +++ b/lass/2configs/xmonad.nix @@ -159,14 +159,14 @@ myKeyMap = ${pkgs.clipmenu}/bin/clipmenu ''}") - , ("M4-", windows copyToAll) - - , ("M4-", spawn "${pkgs.nm-dmenu}/bin/nm-dmenu") , ("M4-", spawn "${pkgs.writeDash "paste" '' ${pkgs.coreutils}/bin/sleep 0.4 ${pkgs.xclip}/bin/xclip -o | ${pkgs.xdotool}/bin/xdotool type -f - ''}") + , ("M4-", spawn "/run/current-system/sw/bin/gamepad_mouse_toggle") + , ("M4-", windows copyToAll) + , ("M4-", spawn "${pkgs.nm-dmenu}/bin/nm-dmenu") , ("M4-", spawn "${pkgs.acpilight}/bin/xbacklight -set 1") , ("M4-", spawn "${pkgs.acpilight}/bin/xbacklight -set 10") , ("M4-", spawn "${pkgs.acpilight}/bin/xbacklight -set 33") -- cgit v1.2.3