1
0
Fork 0

yabai: remove native tab hack

This commit is contained in:
Daniel Kempkens 2024-06-04 20:43:44 +02:00
parent 4b7f822626
commit f80ea32901
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
2 changed files with 2 additions and 36 deletions

View file

@ -10,7 +10,7 @@ let
"width=7.0" "width=7.0"
"hidpi=on" "hidpi=on"
"ax_focus=on" "ax_focus=on"
"blacklist=\"Dropover,LaunchBar\"" "blacklist='Dropover,LaunchBar'"
]; ];
in in
{ {

View file

@ -7,8 +7,6 @@ let
window_padding = 10; window_padding = 10;
native-tab-apps = [ "Finder" "TablePlus" ];
unmanaged-apps = [ unmanaged-apps = [
"Dash" "Dash"
"Dato" "Dato"
@ -43,29 +41,6 @@ let
${yabai-bin} -m config --space $space_index right_padding $padding ${yabai-bin} -m config --space $space_index right_padding $padding
${yabai-bin} -m config --space $space_index window_gap $padding ${yabai-bin} -m config --space $space_index window_gap $padding
''; '';
script-native-tab-fix = pkgs.writeShellScript "yabai-native-tab-fix.sh" ''
app_display=$(${yabai-bin} -m query --windows --window $YABAI_WINDOW_ID | ${jq-bin} '.display')
[ -z "$app_display" ] && app_display=$(${yabai-bin} -m query --displays --display mouse | ${jq-bin} '.index')
ql_windows=$(${yabai-bin} -m query --windows --display $app_display | ${jq-bin} 'map(select(.subrole == "Quick Look")) | length')
if [ $app_display -eq 1 ]; then
win_count=$(${yabai-bin} -m query --windows --display next | ${jq-bin} 'length')
[ -z "$win_count" ] && win_count=0
if [ $ql_windows -eq 0 ] && [ $win_count -gt 0 ]; then
${yabai-bin} -m display --focus next && yabai -m display --focus prev
fi
else
win_count=$(${yabai-bin} -m query --windows --display prev | ${jq-bin} 'length')
[ -z "$win_count" ] && win_count=0
if [ $ql_windows -eq 0 ] && [ $win_count -gt 0 ]; then
${yabai-bin} -m display --focus prev && yabai -m display --focus next
fi
fi
'';
in in
{ {
services.yabai = { services.yabai = {
@ -98,16 +73,7 @@ in
# Smart Gaps # Smart Gaps
yabai -m signal --add event=window_created action='${script-smart-padding}' yabai -m signal --add event=window_created action='${script-smart-padding}'
yabai -m signal --add event=window_destroyed action='${script-smart-padding}' yabai -m signal --add event=window_destroyed action='${script-smart-padding}'
'' + lib.strings.concatMapStrings '';
# Hacky workaround for https://github.com/koekeishiya/yabai/issues/68
(app: ''
# Native tab handling for ${app}
yabai -m signal --add event=window_created app="^${app}$" action='${script-native-tab-fix}'
yabai -m signal --add event=window_destroyed app="^${app}$" action='${script-native-tab-fix}'
yabai -m signal --add event=window_moved app="^${app}$" action='${script-native-tab-fix}'
yabai -m signal --add event=window_resized app="^${app}$" action='${script-native-tab-fix}'
'')
native-tab-apps;
}; };
services.skhd.skhdConfig = '' services.skhd.skhdConfig = ''