X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=i3-pull;fp=i3-pull;h=87b7f07dd2ff534944340debc419206fa05d45b5;hp=0000000000000000000000000000000000000000;hb=d67edcdca8795a4bca116aa532d02dda246a6f53;hpb=a9e3d60b4254cd5c6216c4b3e7f8cd5cc5107fad diff --git a/i3-pull b/i3-pull new file mode 100755 index 0000000..87b7f07 --- /dev/null +++ b/i3-pull @@ -0,0 +1,19 @@ +#!/bin/bash + +# sometimes I want to pull in and sometimes I want to swap. + +set -e; . /usr/local/lib/bash-bear; set +e + +mark=$1 +h=$(i3-msg -t get_tree | jq -r ".. | select(.focused? == true) | .rect.height") + +cur_workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused? == true) | .name') + + +# 1080 = half the 4k height +#if [[ $cur_workspace == 1 && $h ]] && (( h <= 1080 )); then +if [[ $cur_workspace == 1 && $h ]]; then + i3-msg "swap container with mark $mark; [con_mark=\"$mark\"] focus" +else + i3-msg '[con_mark="'$mark'"] move workspace current' +fi