mirror of
https://github.com/thegeneralist01/config.git
synced 2026-07-22 03:15:27 +02:00
Compare commits
4 commits
9e366fe80b
...
bb70a4f405
| Author | SHA1 | Date | |
|---|---|---|---|
| bb70a4f405 | |||
| 26f0f6867f | |||
| 21d4ba3eb5 | |||
| 5d22e55d6b |
2 changed files with 192 additions and 13 deletions
|
|
@ -1,8 +1,14 @@
|
||||||
{ inputs, lib, os, ... }:
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
os,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
isDarwin = os == "darwin";
|
isDarwin = os == "darwin";
|
||||||
isLinux = os == "linux";
|
isLinux = os == "linux";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports =
|
imports =
|
||||||
lib.optional isDarwin inputs.home-manager.darwinModules.home-manager
|
lib.optional isDarwin inputs.home-manager.darwinModules.home-manager
|
||||||
++ lib.optional isLinux inputs.home-manager.nixosModules.home-manager;
|
++ lib.optional isLinux inputs.home-manager.nixosModules.home-manager;
|
||||||
|
|
@ -13,7 +19,12 @@ in {
|
||||||
backupFileExtension = lib.mkDefault "home.bak";
|
backupFileExtension = lib.mkDefault "home.bak";
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.sharedModules = [{
|
home-manager.sharedModules = [
|
||||||
programs.home-manager.enable = true;
|
{
|
||||||
}];
|
programs = {
|
||||||
|
home-manager.enable = true;
|
||||||
|
man.generateCaches = isLinux;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ let
|
||||||
is_keyboard = true;
|
is_keyboard = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Swap the G213's Windows/Alt modifiers.
|
# Swap the G213's Windows/Alt modifiers and map Application to Fn.
|
||||||
logitechG213SimpleModifications = [
|
logitechG213SimpleModifications = [
|
||||||
{
|
{
|
||||||
from.key_code = "left_command";
|
from.key_code = "left_command";
|
||||||
|
|
@ -96,6 +96,10 @@ let
|
||||||
from.key_code = "left_option";
|
from.key_code = "left_option";
|
||||||
to = [ { key_code = "left_command"; } ];
|
to = [ { key_code = "left_command"; } ];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
from.key_code = "application";
|
||||||
|
to = [ { apple_vendor_top_case_key_code = "keyboard_fn"; } ];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
logitechMouseIdentifiers = {
|
logitechMouseIdentifiers = {
|
||||||
|
|
@ -104,12 +108,8 @@ let
|
||||||
is_pointing_device = true;
|
is_pointing_device = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Middle click sends Fn; side buttons navigate back and forward.
|
# Side buttons navigate back and forward.
|
||||||
logitechMouseSimpleModifications = [
|
logitechMouseSimpleModifications = [
|
||||||
{
|
|
||||||
from.pointing_button = "button3";
|
|
||||||
to = [ { apple_vendor_top_case_key_code = "keyboard_fn"; } ];
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
from.pointing_button = "button4";
|
from.pointing_button = "button4";
|
||||||
to = [
|
to = [
|
||||||
|
|
@ -133,6 +133,172 @@ let
|
||||||
complex_modifications = {
|
complex_modifications = {
|
||||||
name = "Complex Modifications";
|
name = "Complex Modifications";
|
||||||
rules = [
|
rules = [
|
||||||
|
{
|
||||||
|
description = "Logitech mouse Button3 sends Fn, or middle click with Hyper, Shift, Button1, or Button2";
|
||||||
|
manipulators = [
|
||||||
|
# Keep the forwarded button as the only `to` event so Karabiner
|
||||||
|
# preserves its down state. A variable in the same `to` sequence
|
||||||
|
# either releases the button immediately or resets too early, so
|
||||||
|
# detect Button3 through `to_if_other_key_pressed` instead.
|
||||||
|
{
|
||||||
|
from.pointing_button = "button1";
|
||||||
|
to = [ { from_event = true; } ];
|
||||||
|
to_if_other_key_pressed = [
|
||||||
|
{
|
||||||
|
other_keys = [
|
||||||
|
{
|
||||||
|
pointing_button = "button3";
|
||||||
|
modifiers.optional = [ "any" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
to = [
|
||||||
|
{
|
||||||
|
set_variable = {
|
||||||
|
name = "logitech_mouse_button1_held";
|
||||||
|
value = 1;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
to_after_key_up = [
|
||||||
|
{
|
||||||
|
set_variable = {
|
||||||
|
name = "logitech_mouse_button1_held";
|
||||||
|
value = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
conditions = [
|
||||||
|
{
|
||||||
|
type = "device_if";
|
||||||
|
identifiers = [ logitechMouseIdentifiers ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = "basic";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
from.pointing_button = "button2";
|
||||||
|
to = [ { from_event = true; } ];
|
||||||
|
to_if_other_key_pressed = [
|
||||||
|
{
|
||||||
|
other_keys = [
|
||||||
|
{
|
||||||
|
pointing_button = "button3";
|
||||||
|
modifiers.optional = [ "any" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
to = [
|
||||||
|
{
|
||||||
|
set_variable = {
|
||||||
|
name = "logitech_mouse_button2_held";
|
||||||
|
value = 1;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
to_after_key_up = [
|
||||||
|
{
|
||||||
|
set_variable = {
|
||||||
|
name = "logitech_mouse_button2_held";
|
||||||
|
value = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
conditions = [
|
||||||
|
{
|
||||||
|
type = "device_if";
|
||||||
|
identifiers = [ logitechMouseIdentifiers ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = "basic";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
from = {
|
||||||
|
pointing_button = "button3";
|
||||||
|
modifiers.optional = [ "any" ];
|
||||||
|
};
|
||||||
|
to = [ { pointing_button = "button3"; } ];
|
||||||
|
conditions = [
|
||||||
|
{
|
||||||
|
type = "device_if";
|
||||||
|
identifiers = [ logitechMouseIdentifiers ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "variable_if";
|
||||||
|
name = "logitech_mouse_button1_held";
|
||||||
|
value = 1;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = "basic";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
from = {
|
||||||
|
pointing_button = "button3";
|
||||||
|
modifiers.mandatory = hyperModifiers;
|
||||||
|
};
|
||||||
|
to = [ { pointing_button = "button3"; } ];
|
||||||
|
conditions = [
|
||||||
|
{
|
||||||
|
type = "device_if";
|
||||||
|
identifiers = [ logitechMouseIdentifiers ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = "basic";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
from = {
|
||||||
|
pointing_button = "button3";
|
||||||
|
modifiers = {
|
||||||
|
mandatory = [ "shift" ];
|
||||||
|
optional = [ "any" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
to = [ { pointing_button = "button3"; } ];
|
||||||
|
conditions = [
|
||||||
|
{
|
||||||
|
type = "device_if";
|
||||||
|
identifiers = [ logitechMouseIdentifiers ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = "basic";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
from = {
|
||||||
|
pointing_button = "button3";
|
||||||
|
modifiers.optional = [ "any" ];
|
||||||
|
};
|
||||||
|
to = [ { pointing_button = "button3"; } ];
|
||||||
|
conditions = [
|
||||||
|
{
|
||||||
|
type = "device_if";
|
||||||
|
identifiers = [ logitechMouseIdentifiers ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "variable_if";
|
||||||
|
name = "logitech_mouse_button2_held";
|
||||||
|
value = 1;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = "basic";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
from = {
|
||||||
|
pointing_button = "button3";
|
||||||
|
modifiers.optional = [ "any" ];
|
||||||
|
};
|
||||||
|
to = [ { apple_vendor_top_case_key_code = "keyboard_fn"; } ];
|
||||||
|
conditions = [
|
||||||
|
{
|
||||||
|
type = "device_if";
|
||||||
|
identifiers = [ logitechMouseIdentifiers ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = "basic";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
# {
|
# {
|
||||||
# description = "Change numbers to symbols and vice versa";
|
# description = "Change numbers to symbols and vice versa";
|
||||||
# manipulators = manipulators;
|
# manipulators = manipulators;
|
||||||
|
|
@ -143,7 +309,9 @@ let
|
||||||
{
|
{
|
||||||
from = {
|
from = {
|
||||||
key_code = "caps_lock";
|
key_code = "caps_lock";
|
||||||
modifiers = { optional = [ "any" ]; };
|
modifiers = {
|
||||||
|
optional = [ "any" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
to = [
|
to = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue