Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-19-2009, 05:59 AM   #1
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 304

Rep: Reputation: 33
command line execution vs clicking on the icon

I have a project I built with KDevelop. It has a Data folder with all the images and stuff. It's in the same directory as the executable. Does anyone know why if I start it from the command line ./project5 everything works but if I click on the gear icon in KDE it starts but all the images fail to load?
Old 04-19-2009, 07:34 AM   #2
Senior Member
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Rep: Reputation: 37
I'd say the working directory is set to your home dir or something when you click it open. I'd say it inherits the X's home dir.
When you launch the app from command line it uses the launch dir as home dir and that's why the images work.
Perhaps check the image paths in your app and change the working directory in it.
Old 04-19-2009, 04:39 PM   #3
Registered: Apr 2009
Posts: 108

Rep: Reputation: 24
When starting from the commandline you give the executable path explicitly: in ./project5 you have the '.' part that identifies the current directory.
A double-click launch from the Desktop behaves quite like using cron jobs: you need to use full pathnames to make it work right. This is a bit weird, actually, because window managers could just as well handle this issue for you, but they don't. A nice programming task could this be for all the open source desktops all around the world.

Last edited by Tinkster; 10-30-2010 at 03:17 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change a GNOME panel icon from command line? General Programming 0 03-19-2007 06:22 PM
Long delay after clicking on Gnome Icon Lsatenstein Fedora 1 07-11-2005 02:27 AM
Mounting via CD icon works, but via command line = permission denied nmoog Linux - Newbie 6 03-07-2004 02:26 AM
getting the path of a file by clicking on its icon using glade2 chaits Linux - Software 1 02-04-2004 07:48 AM
how to add icon with the command line jonsharland Linux - General 1 10-17-2002 03:59 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration