From fc04c3c60a2b752206025012d1935c1cbf306f84 Mon Sep 17 00:00:00 2001 From: angelic-sedition Date: Sat, 16 May 2015 03:10:51 -0400 Subject: [PATCH] Improve i3 support; addresses issue mentioned in #1 - Use window id to float windows, so that the wrong window isn't ever accidentally floated - Sleep when first creating window to ensure it is mapped before resizing/floating --- tdrop | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tdrop b/tdrop index 38a80e3..8ea9202 100755 --- a/tdrop +++ b/tdrop @@ -131,8 +131,14 @@ wm_autoset_for_both() { # tilers that won't remember sizing elif [[ $wm == i3 ]]; then + # need to sleep first time to wait for window to be created + map_post_oneshot() { + sleep 0.1 && \ + i3-msg "[id=$1] floating enable" && \ + xdotool windowmove "$1" "$xoff" "$yoff" windowsize "$1" "$width" "$height" + } map_post() { - i3-msg floating enable && \ + i3-msg "[id=$1] floating enable" && \ xdotool windowmove "$1" "$xoff" "$yoff" windowsize "$1" "$width" "$height" } fi