diff --git a/users/teidesu/assets/karabiner/karabiner.json b/users/teidesu/assets/karabiner/karabiner.json index fdda43b..d77182e 100644 --- a/users/teidesu/assets/karabiner/karabiner.json +++ b/users/teidesu/assets/karabiner/karabiner.json @@ -69,7 +69,7 @@ ] }, { - "description": "New Brave tab", + "description": "New browser tab", "manipulators": [ { "from": { @@ -83,12 +83,121 @@ }, "to": [ { - "shell_command": "osascript /Users/teidesu/.config/karabiner/new-ff-tab.scpt" + "shell_command": "osascript ~/.config/karabiner/new-ff-tab.scpt" } ], "type": "basic" } ] + }, + { + "description": "aerospace cmd-tab", + "manipulators": [ + { + "from": { + "key_code": "tab", + "modifiers": { + "mandatory": [ + "command" + ] + } + }, + "to": [ + { + "shell_command": "~/.local/bin/aerospace focus --boundaries-action wrap-around-the-workspace right" + } + ], + "type": "basic" + } + ] + }, + { + "description": "open terminal", + "manipulators": [ + { + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "option", + "command" + ] + } + }, + "to": [ + { + "shell_command": "/bin/bash ~/.config/karabiner/open-terminal.sh" + } + ], + "type": "basic" + } + ] + }, + { + "description": "some fixes", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "shift", + "command" + ] + } + }, + "to": [ + { + "shell_command": "/Applications/Snipaste.app/Contents/MacOS/Snipaste snip" + } + ], + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "product_id": 591, + "vendor_id": 1452 + }, + { + "product_id": 49284, + "vendor_id": 1133 + } + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "fn", + "command", + "option" + ] + } + }, + "to": [ + { + "shell_command": "osascript -e 'tell application \"System Events\" to keystroke \"q\" using {control down, command down}'" + } + ], + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "product_id": 591, + "vendor_id": 1452 + } + ] + } + ] + } + ] } ] }, @@ -97,38 +206,127 @@ "delay_milliseconds_before_open_device": 1000 }, "selected": true, - "simple_modifications": [ + "devices": [ { - "from": { - "apple_vendor_top_case_key_code": "keyboard_fn" + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 0, + "vendor_id": 0 }, - "to": [ + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [ { - "key_code": "right_option" + "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" + } + ] } - ] + ], + "treat_as_built_in_keyboard": false }, { - "from": { - "key_code": "left_option" + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 591, + "vendor_id": 1452 }, - "to": [ + "ignore": false, + "manipulate_caps_lock_led": true, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [ { - "apple_vendor_top_case_key_code": "keyboard_fn" + "from": { + "key_code": "left_control" + }, + "to": [ + { + "key_code": "left_option" + } + ] + }, + { + "from": { + "key_code": "left_option" + }, + "to": [ + { + "key_code": "left_control" + } + ] } - ] + ], + "treat_as_built_in_keyboard": false }, { - "from": { - "key_code": "right_option" + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "game_pad_swap_sticks": false, + "identifiers": { + "is_game_pad": false, + "is_keyboard": true, + "is_pointing_device": true, + "product_id": 49284, + "vendor_id": 1133 }, - "to": [ - { - "apple_vendor_top_case_key_code": "keyboard_fn" - } - ] + "ignore": false, + "manipulate_caps_lock_led": false, + "mouse_flip_horizontal_wheel": false, + "mouse_flip_vertical_wheel": false, + "mouse_flip_x": false, + "mouse_flip_y": false, + "mouse_swap_wheels": false, + "mouse_swap_xy": false, + "simple_modifications": [], + "treat_as_built_in_keyboard": false } ], + "simple_modifications": [], "virtual_hid_keyboard": { "country_code": 0, "indicate_sticky_modifier_keys_state": false, diff --git a/users/teidesu/assets/karabiner/open-terminal.sh b/users/teidesu/assets/karabiner/open-terminal.sh new file mode 100644 index 0000000..df54025 --- /dev/null +++ b/users/teidesu/assets/karabiner/open-terminal.sh @@ -0,0 +1,11 @@ +set -eauo pipefail +export PATH="$PATH:$HOME/.local/bin" +list=$(aerospace list-windows --monitor all --app-bundle-id com.raphaelamorim.rio) + +if ! [ -z "$list" ]; then + window_id=$(echo "$list" | awk '{print $1}') + aerospace move-node-to-workspace --window-id "$window_id" "$(aerospace list-workspaces --focused)" + aerospace focus --window-id "$window_id" +else + open -a /Applications/Rio.app +fi \ No newline at end of file diff --git a/users/teidesu/assets/linearmouse/linearmouse.json b/users/teidesu/assets/linearmouse/linearmouse.json new file mode 100644 index 0000000..ffcd5bc --- /dev/null +++ b/users/teidesu/assets/linearmouse/linearmouse.json @@ -0,0 +1,37 @@ +{ + "schemes" : [ + { + "if" : { + "device" : { + "vendorID" : "0x46d", + "serialNumber" : "086738673038", + "category" : "mouse", + "productID" : "0xc084", + "productName" : "G102 Prodigy Gaming Mouse" + } + }, + "buttons" : { + "switchPrimaryButtonAndSecondaryButtons" : false + }, + "scrolling" : { + "distance" : { + "vertical" : "auto" + }, + "reverse" : { + "vertical" : true + }, + "acceleration" : { + "vertical" : 1.5 + }, + "speed" : { + "vertical" : 20 + } + }, + "pointer" : { + "acceleration" : 1, + "disableAcceleration" : true + } + } + ], + "$schema" : "https:\/\/schema.linearmouse.app\/0.10.0" + } \ No newline at end of file diff --git a/users/teidesu/darwin.nix b/users/teidesu/darwin.nix index a0b9472..0417bc8 100644 --- a/users/teidesu/darwin.nix +++ b/users/teidesu/darwin.nix @@ -60,5 +60,9 @@ source = ./assets/atuin; recursive = true; }; + home.file.".config/linearmouse" = { + source = ./assets/linearmouse; + recursive = true; + }; }; } \ No newline at end of file