add linearmouse module
This commit is contained in:
parent
48b0aa2ef6
commit
ca4f1226b7
5 changed files with 50 additions and 18 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
../../modules/media-process.nix
|
../../modules/media-process.nix
|
||||||
../../modules/fonts.nix
|
../../modules/fonts.nix
|
||||||
../../modules/aerospace.nix
|
../../modules/aerospace.nix
|
||||||
|
../../modules/peripheral/home.nix
|
||||||
../../modules/env.nix
|
../../modules/env.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -229,6 +230,15 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
launchd.agents.linearmouse = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
ProgramArguments = [ "/Applications/LinearMouse.app/Contents/MacOS/LinearMouse" ];
|
||||||
|
RunAtLoad = true;
|
||||||
|
KeepAlive = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# File associations configuration (macOS equivalent of xdg.mimeApps)
|
# File associations configuration (macOS equivalent of xdg.mimeApps)
|
||||||
# Uses duti to set default applications for file types via Launch Services
|
# Uses duti to set default applications for file types via Launch Services
|
||||||
home.activation.setFileAssociations = config.lib.dag.entryAfter ["writeBoundary"] ''
|
home.activation.setFileAssociations = config.lib.dag.entryAfter ["writeBoundary"] ''
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/homebrew.nix
|
../../modules/homebrew.nix
|
||||||
|
../../modules/peripheral/system.nix
|
||||||
nix-homebrew.darwinModules.nix-homebrew
|
nix-homebrew.darwinModules.nix-homebrew
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -131,22 +132,4 @@
|
||||||
|
|
||||||
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Key remapping using hidutil via launchd agent
|
|
||||||
# This swaps Control and Caps Lock keys bidirectionally
|
|
||||||
launchd.user.agents.remap-keys = {
|
|
||||||
serviceConfig = {
|
|
||||||
ProgramArguments = [
|
|
||||||
"/usr/bin/hidutil"
|
|
||||||
"property"
|
|
||||||
"--set"
|
|
||||||
''{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x7000000E0},{"HIDKeyboardModifierMappingSrc":0x7000000E4,"HIDKeyboardModifierMappingDst":0x700000039}]}''
|
|
||||||
];
|
|
||||||
RunAtLoad = true;
|
|
||||||
KeepAlive = false;
|
|
||||||
Label = "org.nixos.remap-keys";
|
|
||||||
StandardErrorPath = "/tmp/remap-keys.err";
|
|
||||||
StandardOutPath = "/tmp/remap-keys.out";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
"aerospace"
|
"aerospace"
|
||||||
"hiddenbar"
|
"hiddenbar"
|
||||||
"keycastr"
|
"keycastr"
|
||||||
|
"linearmouse"
|
||||||
"localsend"
|
"localsend"
|
||||||
"maccy"
|
"maccy"
|
||||||
"snipaste"
|
"snipaste"
|
||||||
|
|
|
||||||
17
modules/peripheral/home.nix
Normal file
17
modules/peripheral/home.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
home.file.".config/linearmouse/linearmouse.json".text = builtins.toJSON {
|
||||||
|
"$schema" = "https://app.linearmouse.org/schema/0.10.0";
|
||||||
|
schemes = [{
|
||||||
|
"if" = {
|
||||||
|
device.category = "mouse";
|
||||||
|
};
|
||||||
|
scrolling.reverse.vertical = true;
|
||||||
|
pointer = {
|
||||||
|
acceleration = 0;
|
||||||
|
speed = 0.6;
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
}
|
||||||
21
modules/peripheral/system.nix
Normal file
21
modules/peripheral/system.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Key remapping using hidutil via launchd agent
|
||||||
|
# Swaps Caps Lock -> Left Control, Right Control -> Caps Lock
|
||||||
|
launchd.user.agents.remap-keys = {
|
||||||
|
serviceConfig = {
|
||||||
|
ProgramArguments = [
|
||||||
|
"/usr/bin/hidutil"
|
||||||
|
"property"
|
||||||
|
"--set"
|
||||||
|
''{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x7000000E0},{"HIDKeyboardModifierMappingSrc":0x7000000E4,"HIDKeyboardModifierMappingDst":0x700000039}]}''
|
||||||
|
];
|
||||||
|
RunAtLoad = true;
|
||||||
|
KeepAlive = false;
|
||||||
|
Label = "org.nixos.remap-keys";
|
||||||
|
StandardErrorPath = "/tmp/remap-keys.err";
|
||||||
|
StandardOutPath = "/tmp/remap-keys.out";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue