title: Running multiple xdtool commands from activateResult
body: <p>I'm creating a gnome shell extension and implementing the search provider. In the activateResult method I want to run some code like</p>
  
  <pre><code>GLib.spawn_command_line_sync('xdotool windowactivate ' + window_id);
  GLib.spawn_command_line_sync('xdotool key "ctrl+r"');
  GLib.spawn_command_line_sync('xdotool type ' + some_text);
  </code></pre>
  
  <p>The problem is that only the first command works, and I get some errors like:</p>
  
  <pre><code>Jul 27 20:05:09 comp org.gnome.Shell.desktop[3334]: Window manager warning: Received a NET_CURRENT_DESKTOP message from a broken (outdated) client who sent a 0 timestamp
  Jul 27 20:05:09 comp org.gnome.Shell.desktop[3334]: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x2e00001 (somestuff)
  Jul 27 20:05:09 comp org.gnome.Shell.desktop[3334]: Window manager warning: last_focus_time (93207838) is greater than comparison timestamp (93207584).  This most likely represents a buggy client sending inaccurate timestamps in messages such as _NET_ACTIVE_WINDOW.  Trying to work around...
  Jul 27 20:05:09 comp org.gnome.Shell.desktop[3334]: Window manager warning: last_user_time (93207838) is greater than comparison timestamp (93207584).  This most likely represents a buggy client sending inaccurate timestamps in messages such as _NET_ACTIVE_WINDOW.  Trying to work around...
  Jul 27 20:05:09 comp org.gnome.Shell.desktop[3334]: Window manager warning: 0x2e00001 (somestuff) appears to be one of the offending windows with a timestamp of 93207838.  Working around..
  </code></pre>
  
  <p>One thing I tried was to combine all the xdotool commands with <code>bash -c "... ... ..."</code> with no luck.</p>
  
  <p>After selecting a search result, how can I switch to a window and simulate key presses?</p>
  
  <p>(I'm brand new to gnome stuff, gjs stuff, and even JS, but, do write python daily)</p>
  
  <p>edit: Just tried <code>spawn_command_line_async</code> and it works. Feels sloppy, someone with more experienced might have a better answer.</p>