if leafpad is open.. and i close it via terminal
killall leafpad
then this xdotool code will work just fine.
it opens a file, waits 2 seconds, searches for the title, and then activates it and moves it around.
leafpad '/media/1/AAA'
sleep 2
a=`xdotool search --name "AAA"`
xdotool windowactivate --sync $a
xdotool windowmove --sync $a 377 153
but let's close leafpad manually without the 'killall leafpad' command.
now let's re-run this script.
nope, this time it is not working.
what is the solution so that this code can ALWAYS work even if leafpad was not closed via killall
command.
what is causing this ?