LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-03-2014, 04:37 PM   #1
hpp3
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:
Quote:
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:
Code:
Exec=testthis
then it gives the error.
If I put the full path in:
Code:
Exec=/home/hpp3/.local/bin/testthis
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:
http://standards.freedesktop.org/des...exec-variables
Quote:
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 06:32 PM.
 
Old 05-04-2014, 04:21 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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, 08:24 AM   #3
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
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, 09:42 AM   #4
hpp3
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, 09:55 AM   #5
hpp3
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:
http://ljwo.wordpress.com/2014/02/02...n-wheezy-xfce/
Quote:
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:
http://unix.stackexchange.com/a/81254
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 09:56 AM.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:07 PM.

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