Existe um erro em xdotool
em algumas versões, pelo menos.
string de bug:
Can't consume 1 args; are only 0 available. This is a bug.
rastreador de bugs: link
solução alternativa de bugs:
definir --name "whatever"
function activate_window_via_pid {
# for the chrome browser there are multiple processes,
# therefore we must pick one of them,
# the last one seems to work
window_id=$(xdotool search --pid $1 --name "bug workaround" | tail -1)
xdotool windowactivate --sync $window_id
}