<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.xfce.org/extern.php?action=feed&amp;tid=7489&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Xfce Forums / Using Environment Variables in Launchers]]></title>
		<link>http://forum.xfce.org/viewtopic.php?id=7489</link>
		<description><![CDATA[The most recent posts in Using Environment Variables in Launchers.]]></description>
		<lastBuildDate>Sun, 30 Sep 2012 16:04:50 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Using Environment Variables in Launchers]]></title>
			<link>http://forum.xfce.org/viewtopic.php?pid=27583#p27583</link>
			<description><![CDATA[<p>Hi, </p><p>I am trying to use environment variables in a custom launcher.</p><p>I tried to use this command line as the command:</p><div class="codebox"><pre><code>exo-open --working-directory $HOME/src --launch TerminalEmulator</code></pre></div><p>but when I try to execute the launcher, I get this error message in a modal box:</p><p>----<br /><strong>Failed to launch preferred application for category &quot;TerminalEmulator&quot;.</strong></p><p>Failed to change to directory &#039;$HOME/src&#039; (No such file or directory).<br />----</p><p>I was expecting that environment variables are supported directly. The command specified does work in a bash shell as expected. The launcher fails even if &quot;Run in terminal&quot; is checked.</p><p> Is there a way that I can use environment variable in a launcher or is this a bug?</p><p>Thanks,<br />Ralph</p><p>----<br />System info:</p><div class="codebox"><pre><code>ralph@goten:~$ xfce4-about --version
xfce4-about 4.8.3 (Xfce 4.8)

Copyright (c) 2008-2011
	The Xfce development team. All rights reserved.

Please report bugs to &lt;[url]http://bugzilla.xfce.org[/url]&gt;.
Translators list from 2011-09-18 00:00:09.
ralph@goten:~$ uname -a
Linux goten 3.2.0-31-generic #50-Ubuntu SMP Fri Sep 7 16:16:45 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux</code></pre></div><p>----</p><p><strong>EDIT</strong>:&#160; I did find a workaround. It came to me when I realized that my command was not executed in a shell. So, I could wrap the entire command line in a shell call:</p><div class="codebox"><pre><code>bash -c &#039;exec exo-open --working-directory $HOME/src --launch TerminalEmulator&#039;</code></pre></div><p>Additionally, I can even export more environment variables, too:</p><div class="codebox"><pre><code>bash -c &#039;export NAME=rrice;exec exo-open --working-directory $HOME/src --launch TerminalEmulator&#039;</code></pre></div><p>It seems weird, but it works for now.</p>]]></description>
			<author><![CDATA[dummy@example.com (rrice)]]></author>
			<pubDate>Sun, 30 Sep 2012 16:04:50 +0000</pubDate>
			<guid>http://forum.xfce.org/viewtopic.php?pid=27583#p27583</guid>
		</item>
	</channel>
</rss>
