title: Linux: Open URL from command line, then wait a specified time, then close web browser
body: <p>I have attempted to create a script that will accomplish the following:</p>
  
  <ol>
  <li>Launch the Firefox web browser with a specified URL.</li>
  <li>Pause for 5 seconds (using the <code>timeout</code> command)</li>
  <li>Gracefully close Firefox using <code>wmctrl</code>.</li>
  </ol>
  
  <p>The script:</p>
  
  <pre><code>#!/bin/bash
  firefox http://www.google.com
  timeout 5; DISPLAY=:0.0 wmctrl -c "firefox"
  </code></pre>
  
  <p>However, after running the script, I must manually close Firefox. The timeout command does not function properly.</p>