What we have here is a code that looks for the title
AAA
if it finds it, it activates it and then repositions it.
but the problem is, if the file is not open.. it will
open it just fine. however won't activate and reposition it.
a=`xdotool search --name "AAA"`
if [[ "$a" ]]; then
xdotool windowactivate --sync $a
xdotool windowmove --sync $a 377 153
else
leafpad '/media/1/AAA'
xdotool windowactivate --sync $a
xdotool windowmove --sync $a 377 153
fi
UPDATE
i suppose it doesn't have to activate it, given that it would be active when opened, but it can not reposition it.
Not quite sure what the user is having issues with but here we go:
The reason for the window not being re-positioned is because:
You search for 'leafpad' and place it in
$a
, but if leafpad isn't started$a
will be empty when you go into theelse
block. So you need to search and place leafpad in$a
after it's launched again in order to move it.