refactor: rename programs folder to modules

This commit is contained in:
lightly-toasted 2025-08-12 12:43:10 +09:00
parent e4f3540862
commit 0ccc095d6e
40 changed files with 17 additions and 17 deletions

View file

@ -0,0 +1,29 @@
{ pkgs }:
let
script = pkgs.writeShellScriptBin "cycle-mouse-action" ''
STATE_FILE="$HOME/.config/mouse-actions/state"
mkdir -p "$(dirname "$STATE_FILE")"
if [ -f "$STATE_FILE" ]; then
CURRENT_ACTION=$(cat "$STATE_FILE")
else
CURRENT_ACTION="deafen"
fi
case "$CURRENT_ACTION" in
"deafen") NEW_ACTION="sober-lag" ;;
"sober-lag") NEW_ACTION="autoclick" ;;
*) NEW_ACTION="deafen"
esac
echo "$NEW_ACTION" > "$STATE_FILE.tmp"
mv "$STATE_FILE.tmp" "$STATE_FILE"
'';
in
{
package = pkgs.symlinkJoin {
name = "cycle-mouse-action";
paths = [ script pkgs.libnotify ];
};
}