#keyboard #cli #macos #karabiner #keymapping

app karamapper

用于创建karabiner-elements键映射的工具

1 个不稳定版本

0.1.0 2024年8月11日

169硬件支持 中排名

Download history 64/week @ 2024-08-05 46/week @ 2024-08-12

110 每月下载量

MIT 许可证

53KB
1.5K SLoC

karamapper

karamapper允许轻松配置karabiner-elements键映射器。它为可以映射命令的层提供了一等支持。它的目的是不取代常规配置,而是特别简化层的配置。karamapper不会暴露karabiner的全部功能。如果只需要层,则可以独立使用,或与常规karabiner配置结合使用。

[!警告] 这是一项正在进行中的工作。该包尚不稳定。

示例配置

[baselayer]
caps_lock = { remap = "left_command+left_shift+left_option+left_control"}

[layers]
layer1 = "l+left_command+left_shift+left_option+left_control"
layer2 = "v+left_command+left_shift+left_option+left_control"
layer3 = "m+left_command+left_shift+left_option+left_control"

[layer1]
escape = { move_layer= "baselayer" }
o = { command = "Open -a '1Password.app'", next_layer= "baselayer" }
b = { command = "Open -a 'Brave Browser.app'", next_layer= "baselayer" }
z = { command = "Open -a 'Zed.app'", next_layer= "baselayer" }
g = { command = "Open -a 'ChatGPT.app'", next_layer= "baselayer" }
k = { command = "Open -a 'kitty.app'", next_layer= "baselayer" }
s = { command = "Open -a 'Slack.app'", next_layer= "baselayer" }
n = { command = "Open -a 'Notion.app'", next_layer= "baselayer" }
w = { command = "Open -a 'Warp.app'", next_layer= "baselayer" }
m = { command = "Open -a 'WhatsApp.app'", next_layer= "baselayer" }

[layer2]
escape = { move_layer= "baselayer" }
m = { remap = "m+left_command", next_layer= "baselayer", description="Minimize Window" }
t = { remap ="spacebar+left_option+left_shift", description = "Toggle Window Layout" }
h = { remap = "k+left_shift+left_option", description = "Move Foucs left"}
l = { remap = "j+left_shift+left_option", description = "Move Foucs Right"}
y = { remap = "p+left_shift+left_option", description = "Move Foucs Left Screen"}
o = { remap = "n+left_shift+left_option", description = "Move Foucs Right Screen"}

[layer3]
escape = { move_layer= "baselayer" }
key1 = { remap = "key1+left_control+left_shift+left_option+left_control", next_layer= "baselayer", description = "Move to Space 1" }
key2 = { remap = "key2+left_control+left_shift+left_option+left_control", next_layer= "baselayer", description = "Move to Space 2"

CLI界面

paramapper create mapping.toml --method replace # Replaces the configuration in $HOME/.config/karabiner/karabiner.json
paramapper create mapping.toml --method extend # Extends the configuration in $HOME/.config/karabiner/karabiner.json
paramapper create mapping.toml --method stdout # Prints the configuration to stdout

安装

cargo install karamapper

待办事项

  • 实现扩展配置方法
  • 添加针对特定配置文件的目标选项
  • 添加备份选项

依赖项

~2–11MB
~97K SLoC