Why does the command
xdotool search --class mupdf windowactivate --sync type f]H
work in the command line as expected, almost, but not at all in the following script
joc(){ # Joy of Cooking, joc [page #, def 823]
mupdf $HD/ReadBooks/Rombauer/Rombauer-JoyOfCooking_11_823.pdf ${1:-823}
sleep 1
eval "xdotool search --class mupdf windowactivate --sync type f]H"
}
Note I have tried in the script both with and without quotes, with and without eval, with and without 'search ... --sync'. As far as I can tell the xdotool command has no effect at all.
CodePudding user response:
Because after starting mupdf
it doesn't return control to the script until you close it. You have to run it in background using &
at the end:
mupdf example.pdf &
sleep 1
xdotool search --class mupdf windowactivate --sync type f]H