From e2a22c3e9f050bc7a47976b602df7ffa2f2cdb55 Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 18 Aug 2022 10:13:39 +0100 Subject: [PATCH] update --- external.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/external.sh b/external.sh index 38dd013..d92f1c4 100755 --- a/external.sh +++ b/external.sh @@ -15,6 +15,26 @@ parent_id="$(xprop -id "$wid" WM_TRANSIENT_FOR | awk -F '# ' '{print $2}')" if [ -n "$parent_id" ] ; then parent_class="$(xprop -id "$parent_id" WM_CLASS | awk -F '"' '{print $2}')" + if [ "$parent_class" = gimp ] ; then + parent_x="$(xdotool getwindowgeometry --shell $parent_id | grep X | awk -F '=' '{print $2}')" + parent_y="$(xdotool getwindowgeometry --shell $parent_id | grep Y | awk -F '=' '{print $2}')" + + x="$((parent_x + 20))" + y="$((parent_y + 20))" + + # without an echo, the xdotool command will not work. + # it appears that xdotool runs before the window is created if no echo is used. + # using a sleep command instead of echo just causes a delay in the window opening. + # so it appears the output to stdout (or whatever) causes bspwm to open the window + echo "" + xdotool windowmove "$wid" "$x" "$y" + exit + + # notify-send $parent_id "$parent_class | $parent_x , $parent_y | $parent_width x $parent_height" + # notify-send $wid "$width x $height" + # (sleep 2 ; notify-send $wid "xdotool windowmove --sync $wid $x $y") & + fi + if [ "$parent_class" = chromium ] ; then parent_x="$(xdotool getwindowgeometry --shell $parent_id | grep X | awk -F '=' '{print $2}')" parent_y="$(xdotool getwindowgeometry --shell $parent_id | grep Y | awk -F '=' '{print $2}')"