diff --git a/home/modules/graphical/mouse-actions/actions/default.nix b/home/modules/graphical/mouse-actions/actions/default.nix index fbcbe28..51cad7b 100644 --- a/home/modules/graphical/mouse-actions/actions/default.nix +++ b/home/modules/graphical/mouse-actions/actions/default.nix @@ -4,4 +4,5 @@ autoclick = import ./autoclick.nix { inherit pkgs; }; deafen = import ./deafen.nix { inherit pkgs; }; sober-lag = import ./sober-lag.nix { inherit pkgs; }; + flick = import ./flick.nix { inherit pkgs; }; } diff --git a/home/modules/graphical/mouse-actions/actions/flick.nix b/home/modules/graphical/mouse-actions/actions/flick.nix new file mode 100644 index 0000000..daa23f6 --- /dev/null +++ b/home/modules/graphical/mouse-actions/actions/flick.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: + +let + script = pkgs.writeShellScriptBin "flick-action" '' + if ! command -v ydotool >/dev/null 2>&1; then + notify-send -r 120000 "Flick" "This tool requires ydotool to be installed on your system." + fi + ydotool mousemove -- 800 0 + sleep 0.03 + ydotool mousemove -- -800 0 + ''; +in +{ + package = pkgs.symlinkJoin { + name = "autoclick-action"; + paths = [ script pkgs.libnotify ]; + }; +} diff --git a/home/modules/graphical/mouse-actions/cycle.nix b/home/modules/graphical/mouse-actions/cycle.nix index d37c39b..1acd5d2 100644 --- a/home/modules/graphical/mouse-actions/cycle.nix +++ b/home/modules/graphical/mouse-actions/cycle.nix @@ -14,6 +14,7 @@ let case "$CURRENT_ACTION" in "deafen") NEW_ACTION="sober-lag" ;; "sober-lag") NEW_ACTION="autoclick" ;; + "autoclick") NEW_ACTION="flick" ;; *) NEW_ACTION="deafen" esac diff --git a/home/modules/graphical/mouse-actions/run.nix b/home/modules/graphical/mouse-actions/run.nix index 91263ec..d7ce8ad 100644 --- a/home/modules/graphical/mouse-actions/run.nix +++ b/home/modules/graphical/mouse-actions/run.nix @@ -20,6 +20,9 @@ let "autoclick") systemd-run --user ${actions.autoclick.package}/bin/autoclick-action ;; + "flick") + systemd-run --user ${actions.flick.package}/bin/flick-action + ;; esac ''; in