title: How do I set the default browser for xdg-open on Centos 7 if xdg-settings has no desktop environment
body: <p>There are many questions similar to mine (e.g. <a href="https://stackoverflow.com/questions/41172692/xdg-open-not-open-default-browser">xdg-open not open default browser</a> or <a href="https://stackoverflow.com/questions/52209774/xdg-settings-not-setting-default-web-browser-in-gentoo">xdgutils - xdg-settings not setting default-web-browser in gentoo</a>, but none of the answers helped in my case. Therefor I ask for my particular situation:</p>
  
  <hr>
  
  <p>On Centos 7 I have no free desktop manager running, I just run some X11 applications (like VS Code) from the command line where the DISPLAY variable is set to the X server on the (Windows) machine I connect from.</p>
  
  <p>On the Centos machine I have two browsers installed, <code>firefox</code> and <code>google-chrome</code>. I can start both browsers just by typing <code>firefox</code> resp. <code>google-chrome</code> in the bash terminal. </p>
  
  <p><code>xdg-open</code> is available and it opens links in <code>google-chrome</code> - as does VS Code. However I want to change this to <code>firefox</code>.</p>
  
  <p>I tried:</p>
  
  <ol>
  <li><p>Ticking "Default browser" in Firefox's GUI preferences.</p></li>
  <li><p>Using <code>xdg-settings</code>, but </p>
  
  <pre><code>xdg-settings get default-web-browser 
  </code></pre>
  
  <p>returns "xdg-settings: unknown desktop environment"</p></li>
  <li><p>Setting $BROWSER. In bash I issued</p>
  
  <pre><code>export BROWSER=firefox
  </code></pre>
  
  <p>but still <code>google-chrome</code> is started by <code>xdg-open</code></p></li>
  </ol>
  
  <p><strong>How can I set in this environment the default browser to firefox?</strong></p>
  
  <hr>
  
  <p>Note: Strangely on another machine with Centos <strong>6</strong> (and "no desktop environment" either) the <code>export BROWSER</code> method works!</p>