refactor(mouse-actions): use absolute paths

This commit is contained in:
toast 2025-11-09 21:26:22 +09:00
parent 1c99f9d063
commit e9f087deed
6 changed files with 42 additions and 72 deletions

View file

@ -1,9 +1,9 @@
{ pkgs, ... }:
let
script = pkgs.writeShellScriptBin "autoclick-action" ''
{
package = pkgs.writeShellScriptBin "autoclick-action" ''
if ! command -v ydotool >/dev/null 2>&1; then
notify-send -r 120000 "Autoclicker" "This tool requires ydotool to be installed on your system."
${pkgs.libnotify}/bin/notify-send -r 120000 "Autoclicker" "This tool requires ydotool to be installed on your system."
fi
AUTOCLICK_FILE="/run/user/$(id -u)/autoclick"
@ -15,11 +15,11 @@ let
current=$(cat "$AUTOCLICK_FILE")
if [ "$current" = "0" ]; then
echo "1" > "$AUTOCLICK_FILE"
notify-send -r 120000 "Autoclicker" "Stopped"
${pkgs.libnotify}/bin/notify-send -r 120000 "Autoclicker" "Stopped"
exit 0
else
echo "0" > "$AUTOCLICK_FILE"
notify-send -r 120000 "Autoclicker" "Started"
${pkgs.libnotify}/bin/notify-send -r 120000 "Autoclicker" "Started"
fi
while :; do
@ -31,10 +31,4 @@ let
fi
done
'';
in
{
package = pkgs.symlinkJoin {
name = "autoclick-action";
paths = [ script pkgs.libnotify ];
};
}