mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 15:45:39 +00:00
feat: refactor home-manager configuration for multi-host support
This commit is contained in:
parent
f20c875a48
commit
6d1fd47bea
47 changed files with 51 additions and 14 deletions
29
home/modules/graphical/mouse-actions/cycle.nix
Normal file
29
home/modules/graphical/mouse-actions/cycle.nix
Normal 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 ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue