Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 05-03-2014, 05:37 PM   #1
LQ Newbie
Registered: Jan 2007
Location: Bremerton, WA USA
Distribution: Debian Testing
Posts: 15

Rep: Reputation: 3
.desktop files ignoring local bin

Hello, having a problem with .desktop entries not being able to see executables in my local bin folder.
FYI: I'm on Debian "Testing" 64-bit, Xfce 4.10.

It's happening with various programs, but just for testing purposes, I compiled a simple form with Lazarus, called it "testthis" and put it in ~/.local/bin.
I have $HOME/.local/bin in my $PATH.
If I type the name of the program in a terminal, it runs.
If I double-click the executable from the file manager, it runs.

BUT, if I have it called via a .desktop file from the main menu, it doesn't run.
If I type in a terminal "exo-open ~/.local/share/applications/test.desktop" it runs.
If I put the .desktop entry on my Desktop, I double-click it and it pops up a message box titled "Launch error" with this error message:
Failed to run "testthis.desktop"
Failed to execute child process "testthis" (No such file or directory)
Now, if I have just the name of the program in the .desktop file:
then it gives the error.
If I put the full path in:
then it runs fine.
Also, if I run a script from the .desktop file that runs a program in my local bin just by name, it doesn't work either.

The Freedesktop spec says that the $PATH is searched:
The Exec key must contain a command line. A command line consists of an executable program optionally followed by one or more arguments. The executable program can either be specified with its full path or with the name of the executable only. If no full path is provided the executable is looked up in the $PATH environment variable used by the desktop environment.
What's going on here?

P.S. I have tried changing the execute permissions on the desktop file; doesn't do anything

Last edited by hpp3; 05-03-2014 at 07:32 PM.
Old 05-04-2014, 05:21 AM   #2
LQ Addict
Registered: Dec 2013
Posts: 13,159
Blog Entries: 9

Rep: Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603
why are you using $HOME/.local/bin instead of $HOME/bin?

i don't even have a folder of that name, neither is it in my $PATH.
1 members found this post helpful.
Old 05-04-2014, 09:24 AM   #3
Senior Member
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Linux Mint
Posts: 1,714

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
I've also encountered the "desktop file needs full path to program" situation. My solution is to just include the full path in the desktop file.

ondoho: I've got a $HOME/bin folder that I created where I keep various personal executables. And, like you, I never created (nor even thought of creating a $HOME/.local/bin folder. However, looking at my $PATH, I see that Fedora Rawhide has both $HOME/.local/bin and $HOME/bin.
1 members found this post helpful.
Old 05-04-2014, 10:42 AM   #4
LQ Newbie
Registered: Jan 2007
Location: Bremerton, WA USA
Distribution: Debian Testing
Posts: 15

Original Poster
Rep: Reputation: 3
I created $HOME/.local/bin because there was already a $HOME/.local and I found advice to put user-created .desktop files in $HOME/.local/share/applications and I thought "How clever, a root file structure inside my home dir... neat!!", so I started installing compiled stuff that I wanted to keep all to myself in $HOME/.local instead of /usr or /opt. Some things complain and require some tweaks, but it's mostly worked out pretty well.
Old 05-04-2014, 10:55 AM   #5
LQ Newbie
Registered: Jan 2007
Location: Bremerton, WA USA
Distribution: Debian Testing
Posts: 15

Original Poster
Rep: Reputation: 3
So, I found the problem.

Apparently, my Xfce was searching down a different $PATH than what was being set by all the usual suspects. As a Litmus test, I removed the "/usr/local/games:/usr/games" section from PATH everywhere I could find it. But every time I rebooted or did the logout/login dance, it was still there. Something was re-setting my path, but I couldn't find it. What was doing this, and why? Hours of head-scratching and a thousand internet searches later, and I had my answer:
Yes, you may not believe it, but the developers of lightdm hard–coded the PATH in the c–files of the manager. See for yourself here and here. So you change it in /etc/login.defs, and then comes lightdm and runs you over. WTF?!?
My reaction exactly. LightDM was changing my $PATH? and it's hard-coded?!? O_o Geez, some people's kids...
So, I followed the advice at that post and created a .xinitrc with my chose $PATH set and rebooted.
No dice.
A few more internet searches later and I had the right answer:
So, apparently ~/.xinitrc is only parsed when using Xinit or startx, like when you don't use a login or session manager to run your desktop environment. I have always used a login manager, so the solution was to do the same in ~/.xsession.
Bingo. My $PATH is set as I like it, and all my locally installed apps fire up just fine.

Last edited by hpp3; 05-04-2014 at 10:56 AM.


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
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 09:33 AM
Subversion : /usr/local/bin/svnserve.bin lord-fu *BSD 2 12-17-2006 11:46 AM
making files available in /usr/local/bin and /usr/sbin reakinator Linux - Newbie 1 10-14-2006 06:09 PM
Installing .bin-files, leave the file in /usr/local/bin/ ? lagu2653 Linux - Software 1 11-08-2005 09:30 PM
Can't move program files to /usr/local/bin/ asburyguy Linux - Newbie 4 04-03-2004 12:53 PM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:29 AM.

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