feat(teidesu): added karabiner config

This commit is contained in:
alina 🌸 2024-05-01 21:51:02 +03:00
parent 27ad995aa7
commit ae1a4cf34d
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
3 changed files with 152 additions and 0 deletions

View file

@ -0,0 +1,138 @@
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "caps_lock to russian <-> english",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^com\\.apple\\.keylayout\\.RussianWin$"
}
],
"type": "input_source_if"
}
],
"from": {
"key_code": "caps_lock"
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.US$"
}
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^com\\.apple\\.keylayout\\.US$"
}
],
"type": "input_source_if"
}
],
"from": {
"key_code": "caps_lock"
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.RussianWin$"
}
}
],
"type": "basic"
}
]
},
{
"description": "New Alacritty Window",
"manipulators": [
{
"from": {
"key_code": "return_or_enter",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"shell_command": "osascript /Users/teidesu/.config/new-alacritty-window.scpt"
}
],
"type": "basic"
}
]
}
]
},
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [
{
"from": {
"apple_vendor_top_case_key_code": "keyboard_fn"
},
"to": [
{
"key_code": "right_option"
}
]
},
{
"from": {
"key_code": "left_option"
},
"to": [
{
"apple_vendor_top_case_key_code": "keyboard_fn"
}
]
},
{
"from": {
"key_code": "right_option"
},
"to": [
{
"apple_vendor_top_case_key_code": "keyboard_fn"
}
]
}
],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": false,
"mouse_key_xy_scale": 100
}
}
]
}

View file

@ -0,0 +1,12 @@
on count_windows_on_current_space(process_name)
tell application "System Events"
tell process process_name
return count of windows
end tell
end tell
end count_windows_on_current_space
if application "Alacritty" is running and count_windows_on_current_space("Alacritty") = 0 then
do shell script "/Applications/Alacritty.app/Contents/MacOS/alacritty msg create-window"
end if
activate application "Alacritty"

View file

@ -41,5 +41,7 @@
];
home.file.".config/alacritty/alacritty.toml".source = ./assets/alacritty.toml;
home.file.".config/new-alacritty-window.scpt".source = ./assets/new-alacritty-window.scpt; # todo: reference this directly from store
home.file.".config/karabiner/karabiner.json".source = ./assets/karabiner.json;
};
}