koekeishiya / yabai

A tiling window manager for macOS based on binary space partitioning
MIT License
22.48k stars 630 forks source link

Can't move app windows to other workspaces #2296

Closed Ospeto closed 1 month ago

Ospeto commented 1 month ago

As i mention in title , i can't move apps to other workspace with skhd shortcuts. I have to do it manually with mission control. Switching spaces work fine but can't move the app windows. It worked before but i notice this happens after updating to Mac OS Sonoma 14.5. This is my yabai and skhd configs. I disabled SIP. I don't think anything wrong with configs file either cuz i copy someone's config and still getting that bug.

Yabai config

!/usr/bin/env sh

Unload the macOS WindowManager process

launchctl unload -F /System/Library/LaunchAgents/com.apple.WindowManager.plist > /dev/null 2>&1 & yabai -m config menubar_opacity 0.0 sudo yabai --load-sa yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa" yabai -m signal --add event=window_focused action="sketchybar --trigger window_focus" yabai -m signal --add event=display_added action="sleep 2 && $HOME/.config/yabai/create_spaces.sh" yabai -m signal --add event=display_removed action="sleep 1 && $HOME/.config/yabai/create_spaces.sh" yabai -m signal --add event=window_created action="sketchybar --trigger windows_on_spaces" yabai -m signal --add event=window_destroyed action="sketchybar --trigger windows_on_spaces"

$HOME/.config/yabai/create_spaces.sh

yabai -m config external_bar all:49:0 \ window_border on \ mouse_follows_focus off \ focus_follows_mouse autofocus \ window_zoom_persist off \ window_placement second_child \ window_topmost off \ window_shadow float \ window_opacity on \ window_opacity_duration 0.15 \ active_window_opacity 1 \ normal_window_opacity 0.99 \ window_border_width 2 \ window_border_hidpi off \ window_border_radius 11 \ window_animation_duration 0.1 \ active_window_border_color 0xffe1e3e4 \ normal_window_border_color 0xff2a2f38 \ insert_feedback_color 0xff9dd274 \ split_ratio 0.50 \ auto_balance off \ mouse_modifier alt \ mouse_action1 move \ mouse_action2 resize \ mouse_drop_action swap \ \ top_padding 10 \ bottom_padding 10 \ left_padding 10 \ right_padding 10 \ window_gap 10

for _ in $(yabai -m query --spaces | jq '.[].index | select(. > 6)'); do yabai -m space --destroy 7 done

function setup_space { local idx="$1" local name="$2" local space= echo "setup space $idx : $name"

space=$(yabai -m query --spaces --space "$idx") if [ -z "$space" ]; then yabai -m space --create fi

yabai -m space "$idx" --label "$name" }

setup_space 1 Browser setup_space 2 Chat setup_space 3 Home setup_space 4 Multimedia setup_space 5 Work

yabai -m rule --add app="^iTerm2$" space=^3 yabai -m rule --add app="^Arc$" space=^1 yabai -m rule --add app="^Viber$" space=^2 yabai -m rule --add app="^Telegram$" space=^2 yabai -m rule --add app="^Final Cut Pro$" space=^5

Exclude problematic apps from being managed:

yabai -m rule --add app="^(LuLu|Vimac|Calculator|Software Update|Dictionary|VLC|System Preferences|System Settings|zoom.us|Photo Booth|Archive Utility|Python|LibreOffice|App Store|Steam|Alfred|Activity Monitor)$" manage=off yabai -m rule --add label="Finder" app="^Finder$" title="(Co(py|nnect)|Move|Info|Pref)" manage=off yabai -m rule --add label="Safari" app="^Safari$" title="^(General|(Tab|Password|Website|Extension)s|AutoFill|Se(arch|curity)|Privacy|Advance)$" manage=off yabai -m rule --add label="About This Mac" app="System Information" title="About This Mac" manage=off yabai -m rule --add label="Select file to save to" app="^Inkscape$" title="Select file to save to" manage=off yabai -m rule --add label="Viber" app="^Viber$" title = "Viber" space = ^2 manage=on yabai -m rule --add label="Telegram" app="^Telegram$" title= "Telegram" space = ^2 manage=on

yabai -m config layout bsp

echo "yabai configuration loaded.."


SKHD config

Changing Window Focus

change window focus within space

alt - j : yabai -m window --focus south alt - k : yabai -m window --focus north alt - h : yabai -m window --focus west alt - l : yabai -m window --focus east

change focus between external displays

alt - s : yabai -m display --focus west alt - g : yabai -m display --focus east

Modifying the Layout

rotate layout clockwise

shift + alt - r : yabai -m space --rotate 270 alt - r : yabai -m space --rotate 90

flip along y-axis

shift + alt - y : yabai -m space --mirror y-axis

flip along x-axis

shift + alt - x : yabai -m space --mirror x-axis

toggle window float

alt - w : yabai -m window --toggle float --grid 4:4:1:1:2:2

Modifying Window Size

maximize a window

alt - f : yabai -m window --toggle zoom-fullscreen

balance out tree of windows (risize to occupy same area)

alt - e : yabai -m space --balance

toggle padding and gap

alt - g : yabai -m space --toggle padding; yabai -m space --toggle gap

Moving Windows around

swap windows

shift + alt - j : yabai -m window --swap south shift + alt - k : yabai -m window --swap north shift + alt - h : yabai -m window --swap west shift + alt - l : yabai -m window --swap east

move window and split

ctrl + alt - j : yabai -m window --warp south ctrl + alt - k : yabai -m window --warp north ctrl + alt - h : yabai -m window --warp west ctrl + alt - l : yabai -m window --warp east

create desktop, move window and follow focus - uses jq for parsing json (brew install jq)

alt - t : yabai -m space --focus recent

shift + alt - n : yabai -m window --space next ; yabai -m space --focus next shift + alt - p : yabai -m window --space prev ; yabai -m space --focus prev

move space

alt - n : yabai -m space --focus next alt - p : yabai -m space --focus prev

move window to space

shift + alt - 1 : yabai -m window --space 1; yabai -m space --focus 1 shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2 shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3 shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4 shift + alt - 5 : yabai -m window --space 5; yabai -m space --focus 5

focus space

alt - 1 : yabai -m space --focus 1 alt - 2 : yabai -m space --focus 2 alt - 3 : yabai -m space --focus 3 alt - 4 : yabai -m space --focus 4 alt - 5 : yabai -m space --focus 5

Resize windows

ctrl + shift - h : yabai -m window --resize left:-50:0; \ yabai -m window --resize right:-50:0 ctrl + shift - j : yabai -m window --resize bottom:0:50; \ yabai -m window --resize top:0:50 ctrl + shift - k : yabai -m window --resize top:0:-50; \ yabai -m window --resize bottom:0:-50 ctrl + shift - l : yabai -m window --resize right:50:0; \ yabai -m window --resize left:50:0

-- start/stop yabai --

ctrl + alt - s : yabai --start-service ctrl + alt - q : yabai --stop-service ctrl + alt - r : yabai --restart-service

richardxgao commented 1 month ago

Did you upgrade to v7.1.1? https://github.com/koekeishiya/yabai/blob/master/CHANGELOG.md#711---2024-05-18. The fix for this issue is included in that release. And then follow https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#updating-to-the-latest-release?

Ospeto commented 1 month ago

its working after upgrading v7.1.1 thanks.