Window movement deserves its own subcommand

Issue #5 resolved
Jon Sagotsky created an issue
# move windows
  dkcmd win resize {x=-20,y=+20,y=-20,x=+20}

# resize windows
  dkcmd win resize {w=-20,h=+20,h=-20,w=+20}

This is a snippet from the sample sxhkdrc. The second command makes sense to me. The first one sounds like it’s moving a floating window, but it actually moves a windows position around in the stack. This is really confusing and led to a lot of head scratching.

dkcmd win move {up,down} would be a bit easier to understand and set up keybinds for, even if it does the same stuff under the hood.

Comments (5)

  1. Nate Maia repo owner

    I think you're right, I originally had multiple commands to do each action but it was more compact and simplified only having one in the end.

    If the window is floating then x,y coords will move the window like you'd expect, however if the window is tiled then x is ignored but if y is specified the window will move in the stack based on the direction.

    At first glance this seems confusing but there's a good reason - this way we only need one keybind that both moves floating windows and changes stack position of tiled ones.

    In the end I really do agree with you but I've yet to find a better solution. Currently dk's binds can be setup in a very short amount of config (sxhkd) which is fairly important to me but also keeps it from being overwhelming for new users (looking at you i3, awesome, etc.)

  2. Nate Maia repo owner

    Ok I've added a new/old command win mvstack that allows only moving tiled windows up/down the stack. e.g.

    dkcmd win [CLIENT] mvstack {up,down}
    

    This isn't really a replacement for win resize as it only works on tiled windows.

    I've updated the docs to reflect the new additions as well as some of the other issue fixes.

  3. Log in to comment