mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 03:49:44 +00:00
refactor(mouse-actions): use absolute paths
This commit is contained in:
parent
1c99f9d063
commit
e9f087deed
6 changed files with 42 additions and 72 deletions
|
|
@ -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 ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue