Skip to content

Commit

Permalink
Fix Karabiner is not auto focused
Browse files Browse the repository at this point in the history
  • Loading branch information
tshu-w committed Oct 11, 2024
1 parent 4c8afed commit a1a1dba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/yabai/yabairc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ yabai -m rule --add app="Emacs" space=main
yabai -m rule --add app="Safari|Firefox" space=submain
yabai -m rule --add app="^System Preferences|System Information$" manage=off sub-layer=below
yabai -m rule --add title="Copy|Bin|About This Mac|Info|Open" manage=off sub-layer=below
yabai -m rule --add app="Bitwarden|Dash|Surge" manage=off sub-layer=below
yabai -m rule --add app="Bitwarden|Dash|Surge|Karabiner-Elements" manage=off sub-layer=below
yabai -m rule --add app="QQ|WeChat|Telegram|Music|Discord|Lark|Feishu|Slack|TencentMeeting|WeCom" space=misc manage=off sub-layer=below

# signals
Expand All @@ -56,6 +56,8 @@ yabai -m signal --add event=application_activated app!="$chinese_app_regex" acti
yabai -m signal --add event=window_destroyed action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"
yabai -m signal --add event=application_terminated action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"

yabai -m signal --add event=window_created app="Karabiner-Elements" action='yabai -m window --focus $YABAI_WINDOW_ID'

float_script="if [ \$(yabai -m query --windows --window | jq '.\"can-resize\" == false and .\"is-floating\" == false') = 'true' ]; then
yabai -m window --toggle float;
fi"
Expand Down

0 comments on commit a1a1dba

Please sign in to comment.