clicksnap update

master
Daniel Napora 2021-05-04 22:50:19 +02:00
parent 9907437d5a
commit 0e1190f96b
1 changed files with 10 additions and 8 deletions

View File

@ -21,6 +21,8 @@ HEX_ID=$(printf '0x%x\n' $WINDOW)
CHILD_ID=$(xwininfo -id $HEX_ID -children|grep "\"" | awk '{print $1}') CHILD_ID=$(xwininfo -id $HEX_ID -children|grep "\"" | awk '{print $1}')
if xwininfo -id $CHILD_ID -wm |grep Dock ; then exit 0 ;fi # Ignore Dock eg. tint2
if xwininfo -id $CHILD_ID -wm |grep Undecorated ; then # Undecorated if xwininfo -id $CHILD_ID -wm |grep Undecorated ; then # Undecorated
T="0" T="0"
else # Decorated else # Decorated
@ -51,23 +53,23 @@ OFF_Y="${OFFSET#*,}"
case $POS_CODE in case $POS_CODE in
00) # top-left 00) # top-left
W=$((AVAIL_X/2-GAP)) H=$((AVAIL_Y/2-T-GAP)) X=$((0+OFF_X+GAP/2)) Y=$((0+OFF_Y+GAP/2));; W=$((AVAIL_X/2-GAP*3/2)) H=$((AVAIL_Y/2-T-GAP*3/2)) X=$((0+OFF_X+GAP)) Y=$((0+OFF_Y+GAP));;
10) # top 10) # top
W=$((AVAIL_X-GAP)) H=$((AVAIL_Y/2-T-GAP)) X=$((0+OFF_X+GAP/2)) Y=$((0+OFF_Y+GAP/2));; W=$((AVAIL_X-GAP*2)) H=$((AVAIL_Y/2-T-GAP*3/2)) X=$((0+OFF_X+GAP)) Y=$((0+OFF_Y+GAP));;
20) # top-right 20) # top-right
W=$((AVAIL_X/2-GAP)) H=$((AVAIL_Y/2-T-GAP)) X=$((AVAIL_X/2+OFF_X+GAP/2)) Y=$((0+OFF_Y+GAP/2));; W=$((AVAIL_X/2-GAP*3/2)) H=$((AVAIL_Y/2-T-GAP*3/2)) X=$((AVAIL_X/2+OFF_X+GAP/2)) Y=$((0+OFF_Y+GAP));;
01) # left 01) # left
W=$((AVAIL_X/2-GAP)) H=$((AVAIL_Y-T-GAP)) X=$((0+OFF_X+GAP/2)) Y=$((0+OFF_Y+GAP/2));; W=$((AVAIL_X/2-GAP*3/2)) H=$((AVAIL_Y-T-GAP*2)) X=$((0+OFF_X+GAP)) Y=$((0+OFF_Y+GAP));;
11) # center 11) # center
W=$((AVAIL_X/8*6-OFF_X)) H=$((AVAIL_Y/8*6-T)) X=$((AVAIL_X/8+OFF_X/2)) Y=$((AVAIL_Y/8+OFF_Y/2));; W=$((AVAIL_X/8*6-OFF_X)) H=$((AVAIL_Y/8*6-T)) X=$((AVAIL_X/8+OFF_X/2)) Y=$((AVAIL_Y/8+OFF_Y/2));;
21) # right 21) # right
W=$((AVAIL_X/2-GAP)) H=$((AVAIL_Y-T-GAP)) X=$((AVAIL_X/2+OFF_X+GAP/2)) Y=$((0+OFF_Y+GAP/2));; W=$((AVAIL_X/2-GAP*3/2)) H=$((AVAIL_Y-T-GAP*2)) X=$((AVAIL_X/2+OFF_X+GAP/2)) Y=$((0+OFF_Y+GAP));;
02) # bottom-left 02) # bottom-left
W=$((AVAIL_X/2-GAP)) H=$((AVAIL_Y/2-T-GAP)) X=$((0+OFF_X+GAP/2)) Y=$((AVAIL_Y/2+OFF_Y+GAP/2));; W=$((AVAIL_X/2-GAP*3/2)) H=$((AVAIL_Y/2-T-GAP*3/2)) X=$((0+OFF_X+GAP)) Y=$((AVAIL_Y/2+OFF_Y+GAP/2));;
12) # bottom 12) # bottom
W=$((AVAIL_X-GAP)) H=$((AVAIL_Y/2-T-GAP)) X=$((0+OFF_X+GAP/2)) Y=$((AVAIL_Y/2+OFF_Y+GAP/2));; W=$((AVAIL_X-GAP*2)) H=$((AVAIL_Y/2-T-GAP*3/2)) X=$((0+OFF_X+GAP)) Y=$((AVAIL_Y/2+OFF_Y+GAP/2));;
22) # bottom-right 22) # bottom-right
W=$((AVAIL_X/2-GAP)) H=$((AVAIL_Y/2-T-GAP)) X=$((AVAIL_X/2+OFF_X+GAP/2)) Y=$((AVAIL_Y/2+OFF_Y+GAP/2));; W=$((AVAIL_X/2-GAP*3/2)) H=$((AVAIL_Y/2-T-GAP*3/2)) X=$((AVAIL_X/2+OFF_X+GAP/2)) Y=$((AVAIL_Y/2+OFF_Y+GAP/2));;
esac esac