mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 15:45:39 +00:00
feat(mouse-actions): add flick action
This commit is contained in:
parent
b394df67f4
commit
d4e0c6c62b
4 changed files with 23 additions and 0 deletions
|
@ -4,4 +4,5 @@
|
||||||
autoclick = import ./autoclick.nix { inherit pkgs; };
|
autoclick = import ./autoclick.nix { inherit pkgs; };
|
||||||
deafen = import ./deafen.nix { inherit pkgs; };
|
deafen = import ./deafen.nix { inherit pkgs; };
|
||||||
sober-lag = import ./sober-lag.nix { inherit pkgs; };
|
sober-lag = import ./sober-lag.nix { inherit pkgs; };
|
||||||
|
flick = import ./flick.nix { inherit pkgs; };
|
||||||
}
|
}
|
||||||
|
|
18
home/modules/graphical/mouse-actions/actions/flick.nix
Normal file
18
home/modules/graphical/mouse-actions/actions/flick.nix
Normal 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 ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -14,6 +14,7 @@ let
|
||||||
case "$CURRENT_ACTION" in
|
case "$CURRENT_ACTION" in
|
||||||
"deafen") NEW_ACTION="sober-lag" ;;
|
"deafen") NEW_ACTION="sober-lag" ;;
|
||||||
"sober-lag") NEW_ACTION="autoclick" ;;
|
"sober-lag") NEW_ACTION="autoclick" ;;
|
||||||
|
"autoclick") NEW_ACTION="flick" ;;
|
||||||
*) NEW_ACTION="deafen"
|
*) NEW_ACTION="deafen"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@ let
|
||||||
"autoclick")
|
"autoclick")
|
||||||
systemd-run --user ${actions.autoclick.package}/bin/autoclick-action
|
systemd-run --user ${actions.autoclick.package}/bin/autoclick-action
|
||||||
;;
|
;;
|
||||||
|
"flick")
|
||||||
|
systemd-run --user ${actions.flick.package}/bin/flick-action
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue