[ubuntu-za] Set lauch directory

Tom Bamford tom at aims.ac.za
Mon Jan 16 09:42:11 UTC 2012


On 16 January 2012 11:16, Charl Wentzel <charl.wentzel at vodamail.co.za>wrote:

> **
> Hi Guys
>
> 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?
>
> Regards
> Charl
>
>
Hi Charl

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.

#!/bin/bash
DIR="$(cd "$(dirname "$0")" && pwd)"
COMMAND="yourbinary"
cd "$DIR"
$COMMAND

Regards
Tom

-- 
Systems Administrator
African Institute for Mathematical Sciences
Cape Town, South Africa
Tel: +27 (0)21 787 9328
Fax: +27 (0)21 787 9321
Jabber: tom at aims.ac.za
Web: www.aims.ac.za
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-za/attachments/20120116/026a1035/attachment.html>


More information about the ubuntu-za mailing list