<div class="gmail_quote">On 16 January 2012 11:16, Charl Wentzel <span dir="ltr"><<a href="mailto:charl.wentzel@vodamail.co.za">charl.wentzel@vodamail.co.za</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<u></u>


  
  

<div>
Hi Guys<br>
<br>
I'm trying to set the working/lauching directory for an app in its .desktop file.  This particular app must be started in the correct directory or else if fails to start.  I've googled quite a bit, but can't find any parameter that can set this.  Anybody have an idea?<br>


<br>
Regards<span class="HOEnZb"><font color="#888888"><br>
Charl
</font></span></div><br></blockquote></div><br>Hi Charl<br><br>How about a shell script that changes the working dir before launching your binary? Put this in the same dir as your target binary and launch it instead.<br>

<br><span style="font-family:courier new,monospace">#!/bin/bash</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">DIR="$(cd "$(dirname "$0")" && pwd)"</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">COMMAND="yourbinary"</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">cd "$DIR"</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">$COMMAND</span><br style="font-family:courier new,monospace" clear="all"><br>Regards<br>Tom<br><br>-- <br><font size="1">Systems Administrator<br>African Institute for Mathematical Sciences<br>

Cape Town, South Africa<br>Tel: +27 (0)21 787 9328<br>Fax: +27 (0)21 787 9321<br>Jabber: <a href="mailto:tom@aims.ac.za" target="_blank">tom@aims.ac.za</a><br>Web: <a href="http://www.aims.ac.za/" target="_blank">www.aims.ac.za</a></font><br>

<br><br>