mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 19:45:40 +00:00
refactor: rename programs folder to modules
This commit is contained in:
parent
e4f3540862
commit
0ccc095d6e
40 changed files with 17 additions and 17 deletions
31
home/toast/modules/mouse-actions/run.nix
Normal file
31
home/toast/modules/mouse-actions/run.nix
Normal 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 ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue