koekeishiya / skhd

Simple hotkey daemon for macOS
MIT License
6.29k stars 209 forks source link

Can't do either fullscreen in bsp #310

Closed Ciel-MC closed 1 year ago

Ciel-MC commented 1 year ago

When I run the command yabai -m window --toggle (zoom|native)-fullscreen, it works fine in the terminal, but not when dispatched with skhd, there it just prints cannot apply grid layout to a managed window. for any tiling window, and I have no idea why that might be because other things like toggle splits work.

M1 Pro Ventura 13.6

tjex commented 1 year ago

can you post your full yabai and skhd conf? Or link a gist? I can toggle native full screen from skhd:

https://github.com/tjex/dotfiles/blob/mac/.config/skhd/skhdrc

Ciel-MC commented 1 year ago

can you post your full yabai and skhd conf? Or link a gist?

I can toggle native full screen from skhd:

https://github.com/tjex/dotfiles/blob/mac/.config/skhd/skhdrc

I'll check when I have time, but I doubt it's the config's problem? Since the exact same command works in terminal but not when run by skhd.

tjex commented 1 year ago

Maybe, maybe not. Considering anyone helping doesn't have access to your machine, we have to pick through the haystack to find the needle. Config files / logs / output are our way into the system from afar. With them it can be possible to diagnose problems arising from honest and simple mistakes. And considering how little effort it takes to share a config, it's a worthy task.

-> Also, because I'm on 13.5 and it works fine for me.

Ciel-MC commented 1 year ago

.yabairc

# Tell yabai SIP is partially disabled and can inject into Dock.app
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
sudo yabai --load-sa

# Enable tiling
yabai -m config layout bsp
yabai -m config mouse_follows_focus on
yabai -m config focus_follows_mouse autofocus
yabai -m config window_topmost on

yabai -m rule --add app="^System Preferences$" manage=off
yabai -m rule --add app="^Finder$" manage=off
yabai -m rule --add app="^Dash$" manage=off
yabai -m rule --add app="^Slay the spire$" manage=off

skhdrc

# focus window
# alt - h : yabai -m window --focus west
#ctrl - h: yabai -m window --focus west
ctrl - h [
    "kitty" ~
    *: yabai -m window --focus west
]
#ctrl - j: yabai -m window --focus south
ctrl - j [
    "kitty" ~
    *: yabai -m window --focus south
]
#ctrl - k: yabai -m window --focus north
ctrl - k [
    "kitty" ~
    *: yabai -m window --focus north
]
#ctrl - l: yabai -m window --focus east
ctrl - l [
    "kitty" ~
    *: yabai -m window --focus east
]

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

# move managed window
# shift + cmd - h : yabai -m window --warp east

# balance size of windows
# shift + alt - 0 : yabai -m space --balance

# make floating window fill screen
# shift + alt - up     : yabai -m window --grid 1:1:0:0:1:1
ctrl - f: yabai -m window --grid 1:1:0:0:1:1

# make floating window fill left-half of screen
# shift + alt - left   : yabai -m window --grid 1:2:0:0:1:1

# create desktop, move window and follow focus - uses jq for parsing json (brew install jq)
# shift + cmd - n : yabai -m space --create && \
#                   set index="$(yabai -m query --spaces --display | jq 'map(select(."is-native-fullscreen" == false))[-1].index')" && \
#                   yabai -m window --space "$index" && \
#                   yabai -m space --focus "$index"

# fast focus desktop
# cmd + alt - x : yabai -m space --focus recent
# cmd + alt - 1 : yabai -m space --focus 1
# ctrl - 1 : yabai -m space --focus 1
# ctrl - 2 : yabai -m space --focus 2
# ctrl - 3 : yabai -m space --focus 3
# ctrl - 4 : yabai -m space --focus 4
# ctrl - 5 : yabai -m space --focus 5
# ctrl - 6 : yabai -m space --focus 6
# ctrl - 7 : yabai -m space --focus 7
# ctrl - 8 : yabai -m space --focus 8
# ctrl - 9 : yabai -m space --focus 9

# send window to desktop and follow focus
# shift + cmd - z : yabai -m window --space next; yabai -m space --focus next
# shift + cmd - 2 : yabai -m window --space  2; yabai -m space --focus 2
shift + ctrl - 1 : yabai -m window --space 1
shift + ctrl - 2 : yabai -m window --space 2
shift + ctrl - 3 : yabai -m window --space 3
shift + ctrl - 4 : yabai -m window --space 4
shift + ctrl - 5 : yabai -m window --space 5
shift + ctrl - 6 : yabai -m window --space 6
shift + ctrl - 7 : yabai -m window --space 7
shift + ctrl - 8 : yabai -m window --space 8
shift + ctrl - 9 : yabai -m window --space 9

# focus monitor
# ctrl + alt - z  : yabai -m display --focus prev
# ctrl + alt - 3  : yabai -m display --focus 3

# send window to monitor and follow focus
# ctrl + cmd - c  : yabai -m window --display next; yabai -m display --focus next
# ctrl + cmd - 1  : yabai -m window --display 1; yabai -m display --focus 1

# move floating window
# shift + ctrl - a : yabai -m window --move rel:-20:0
# shift + ctrl - s : yabai -m window --move rel:0:20
# alt + ctrl - h : yabai -m window --move rel:-20:0
# alt + ctrl - j : yabai -m window --move rel:0:-20
# alt + ctrl - k : yabai -m window --move rel:0:20
# alt + ctrl - l : yabai -m window --move rel:20:0

# increase window size
# shift + alt - a : yabai -m window --resize left:-20:0
# shift + alt - w : yabai -m window --resize top:0:-20
#ctrl + alt + h : yabai -m window --resize -20:0
#ctrl + alt + j : yabai -m window --resize 0:-20
#ctrl + alt + k : yabai -m window --resize 0:20
#ctrl + alt + l : yabai -m window --resize 20:0

# decrease window size
# shift + cmd - s : yabai -m window --resize bottom:0:-20
# shift + cmd - w : yabai -m window --resize top:0:20

# set insertion point in focused container
# ctrl + alt - h : yabai -m window --insert west

# toggle window zoom
# alt - d : yabai -m window --toggle zoom-parent
# ctrl - f : yabai -m window --toggle zoom-fullscreen
ctrl - f : yabai -m window --toggle native-fullscreen

# toggle window split type
# alt - e : yabai -m window --toggle split
ctrl - s : yabai -m window --toggle split

# float / unfloat window and center on screen
ctrl - v : yabai -m window --toggle float --grid 4:4:1:1:2:2

# toggle sticky(+float), topmost, picture-in-picture
# alt - p : yabai -m window --toggle sticky --toggle topmost --toggle pip

# Open terminal
cmd - return : kitty -1 -d ~
# Open Firefox
cmd - 0x2A : /Applications/Firefox.app/Contents/MacOS/firefox # backslash

# Add lock mode when pressing ctrl + ` to pass thru any key
:: passthrough
# : yabai -m config active_window_border_color 0xff24ccaa
ctrl - 0x32 ; passthrough

passthrough < ctrl - 0x32 ; default
tjex commented 1 year ago

So it looks like you've mapped ctrl -f twice. I guess this is it :~)

Ciel-MC commented 1 year ago

So it looks like you've mapped ctrl -f twice. I guess this is it :~)

I feel so dumb rn. I guess it was perhaps a part of the default config? Anyway, that worked, thanks lol.

tjex commented 1 year ago

no worries. We're all caught multiple times by such things! 👍