feat(mouse-actions): add flick action

This commit is contained in:
lightly-toasted 2025-10-04 12:30:09 +09:00
parent b394df67f4
commit d4e0c6c62b
4 changed files with 23 additions and 0 deletions

View file

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

View file

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

View file

@ -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

View file

@ -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