feat: add mouse actions

Refs: 302185f6a873209ea51a26b314faa24c45cd03ac
This commit is contained in:
lightly-toasted 2025-08-11 11:45:21 +09:00
parent b88d00fe40
commit 45a49b1529
12 changed files with 186 additions and 6 deletions

View file

@ -0,0 +1,31 @@
{ pkgs, actions }:
let
script = pkgs.writeShellScriptBin "run-mouse-action" ''
STATE_FILE="$HOME/.config/mouse-actions/state"
if [ ! -f "$STATE_FILE" ]; then
exit 0
fi
ACTION_NAME=$(<"$STATE_FILE")
case "$ACTION_NAME" in
"deafen")
systemd-run --user ${actions.deafen.package}/bin/deafen-action
;;
"sober-lag")
systemd-run --user ${actions.sober-lag.package}/bin/sober-lag-action
;;
"autoclick")
systemd-run --user ${actions.autoclick.package}/bin/autoclick-action
;;
esac
'';
in
{
package = pkgs.symlinkJoin {
name = "run-mouse-action";
paths = [ script pkgs.systemd ];
};
}