nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
6.62k stars 106 forks source link

Built-in method for resizing or moving the window under the cursor #206

Open frantic1048 opened 5 months ago

frantic1048 commented 5 months ago

Currently, AeroSpace does not offer a built-in method for resizing or moving the window under the cursor. I have attempted the following methods:

  1. defaults write -g NSWindowShouldDragOnGesture YES: This does not work on macOS 14.4.1 (Sonoma). Additionally, this method does not allow customization of the default modifier key (ctrl + cmd).

  2. Running Yabai with only mouse features (Yabai has built-in support for resizing and moving windows with modifier+mouse). I understand this might seem a bit ridiculous. It did not work: the windows can be moved or resized by Yabai, but it seems that AeroSpace forces them to remain in their original positions.

      # set mouse interaction modifier key
      yabai -m config mouse_modifier cmd
    
      # set modifier + left-click drag to move window
      yabai -m config mouse_action1 move
    
      # set modifier + right-click drag to resize window
      yabai -m config mouse_action2 resize
    
      # disable Yabai window management
      yabai -m rule --add app=".*" manage=off
  3. Trying other tools just for resizing or moving windows, such as easy-move-resize, it works when AeroSpace is not running. However, when AeroSpace is active, it behaves similarly to the Yabai case.

Will it be possible to add this feature to AeroSpace?

BTW, as a lost child from i3wm/swaywm to macOS, AeroSpace gives me the most similar experience to i3wm/swaywm. Thanks for your amazing work! :kissing_heart:

nikitabobko commented 5 months ago

I agree that it'd be nice to have it

For extensibility purposes, I've been thinking about implementing the "grab and move" and "grab and resize" as separate commands

Brainstorming:

[mode.main.binding]
alt-leftMouse = 'grab-and-move --release-on keyup'
alt-rightMouse = 'grab-and-resize --release-on keyup'

It'd allow cool things like:

[mode.main.binding]
alt-g = 'grab-and-move --release-on alt-g' # Press alt-g once to "grab" window. Press alt-g the second time to release it