outfoxxed / hy3

Hyprland plugin for an i3 / sway like manual tiling layout
GNU General Public License v3.0
459 stars 41 forks source link

Behavior of hy3:movewindow on floating windows #85

Open aacebedo opened 6 months ago

aacebedo commented 6 months ago

I am trying to get a single bind to be able to move a floating window with moveactive and to move a tiled window with hy3:movewindow.

It is possible with sway, but I don't find a way to filter correctly the bind with hyprland. Is there any way to do that ?

postsolar commented 6 months ago

73 maybe?

aacebedo commented 6 months ago

Seems those commits have been reverted. Is there a new version incoming?

postsolar commented 6 months ago

In the meanwhile, I use a script for this:

The script ```sh #! /usr/bin/env zsh direction=$1 delta=10 active=($(hyprctl activewindow -j | jq -r '.address + "\n" + (.floating | tostring)')) address=$active[1] floating=$active[2] # if the first argument to a dispatcher is a negative number, # hyprctl parses it as an argument to itself, not to the dispatcher. # since a move left would require arguments `-px px,...`, this # has to be handled via a different dispatcher handleMoveLeft () { curr=($(hyprctl activewindow -j | jq -r '(.at[0] | tostring) + "\n" + (.at[1] | tostring)')) y=$curr[2] x=$(( curr[1] - $delta )) hyprctl dispatch movewindowpixel "exact $x $y,address:$address" exit 0 } if $floating; then case $direction in l|left) handleMoveLeft ;; r|right) resizeparams="$delta 0" ;; u|up) resizeparams="0 -$delta" ;; d|down) resizeparams="0 $delta" ;; esac hyprctl dispatch movewindowpixel "$resizeparams,address:$address" else hyprctl dispatch hy3:movewindow $direction,once,visible fi ``` And the following bindings: ```hyprlang binde = $mod SHIFT, left , exec, $scripts/move-floating-or-tiled-win.zsh left binde = $mod SHIFT, down , exec, $scripts/move-floating-or-tiled-win.zsh down binde = $mod SHIFT, up , exec, $scripts/move-floating-or-tiled-win.zsh up binde = $mod SHIFT, right, exec, $scripts/move-floating-or-tiled-win.zsh right ```