I have a little troubles with binding resize mode. I have the following resize config
set $resize_delta 2
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym h resize shrink width $resize_delta px or $resize_delta ppt
bindsym j resize grow height $resize_delta px or $resize_delta ppt
bindsym k resize shrink height $resize_delta px or $resize_delta ppt
bindsym l resize grow width $resize_delta px or $resize_delta ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width $resize_delta px or $resize_delta ppt
bindsym Down resize grow height $resize_delta px or $resize_delta ppt
bindsym Up resize shrink height $resize_delta px or $resize_delta ppt
bindsym Right resize grow width $resize_delta px or $resize_delta ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
I want to have resize by direction, if i press h i want to increase/decrease depends on window position, if it's in right corner pressing h would be increase width, if in left corner would be decrease width, can i do this? Same resize by direction you can check in tmux,windows terminal. For tmux you need to set following:
# change the window size
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
I've made a python script some time ago to do just that. It's very terrible and hacky, still, it works most of the time. Here's what you'll need:
$npm install i3ipcor$sudo pacman -S python-i3ipcif you're on arch)