This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KDE4 KRunner path

Tags: None
(comma "," separated)
Darkmind
Registered Member
Posts
30
Karma
0
OS

KDE4 KRunner path

Thu Jun 23, 2011 6:44 am
I didn't succeed in googling answer for my question (did this for an hour).

I have Firefox installed in '/usr/bin' from system repository. Apart from that I've installed a newer version in '~/firefox'.

Now I'd like to configure my system to launch the '~/firefox' instance every time I type "firefox" command, no matter from Shell, KRunner or clicking desktop icon.

I configured PATH in ~/.bashrc and logged in again. This enabled "firefox" in shell, but KRunner still executes one from '/usr/bin'.

Following advices from Google, I created '~/.kde/env' directory and 'profile.sh' script there. This script only updates PATH variable:
Code: Select all
PATH="$HOME/firefox:$PATH";
export PATH;

I logged out and logged in again. No difference. KRunner and desktop icons still prefer '/usr/bin'

Does anyone know how to get rid of this? How can I affect PATH which is used by KDE4 when it looks for executable?

Thanks in advance
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KDE4 KRunner path

Thu Jun 23, 2011 8:27 am
Did you make the script you placed in ~/.kde/env/ executable? Also, is ~/.kde/ the directory used by KDE? You can check with the output of "kde4-config --localprefix"


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
dpalacio
Registered Member
Posts
240
Karma
2
OS

Re: KDE4 KRunner path

Thu Jun 23, 2011 3:28 pm
There should appear two Firefox results in KRunner. One has the Firefox icon and will execute the system's Firefox. The second one has a gray gear icon and should run your ~/firefox.


connect(post, SIGNAL(readSignature()), qapp, SLOT(quit()));
Darkmind
Registered Member
Posts
30
Karma
0
OS

Re: KDE4 KRunner path

Fri Jun 24, 2011 5:03 am
bcooksley wrote:Did you make the script you placed in ~/.kde/env/ executable? Also, is ~/.kde/ the directory used by KDE? You can check with the output of "kde4-config --localprefix"


Yes, it's executable. 'kde4-config --localprefix' shows '<HOME>/.kde4'. I tried to place the same script into '~/.kde4/env', but result is the same
Darkmind
Registered Member
Posts
30
Karma
0
OS

Re: KDE4 KRunner path

Fri Jun 24, 2011 5:09 am
dpalacio wrote:There should appear two Firefox results in KRunner. One has the Firefox icon and will execute the system's Firefox. The second one has a gray gear icon and should run your ~/firefox.


I see 2 instances there, but both of them execute the same version of Firefox (from /usr/bin). As I said, when I execute Firefox from console, correct version is picked.

Nevertheless, even imagine that the second instance executed correct version, how can I put it to the first position?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KDE4 KRunner path

Fri Jun 24, 2011 5:46 am
Given the results of "kde4-config --localprefix", it definitely needs to be placed under ~/.kde4/. After moving the file and ensuring it was executable you did logout and back in right? Those settings are only applied on KDE Startup.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Darkmind
Registered Member
Posts
30
Karma
0
OS

Re: KDE4 KRunner path

Fri Jun 24, 2011 6:43 am
Definitely, I always logout/login when doing changes in environment
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KDE4 KRunner path

Sat Jun 25, 2011 12:28 am
What is the output of "kde4-config --path exe"?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Darkmind
Registered Member
Posts
30
Karma
0
OS

Re: KDE4 KRunner path

Sun Jun 26, 2011 8:57 am
Code: Select all
[darkmind@Host ~]$ kde4-config --path exe
/home/darkmind/.kde4/lib/kde4/libexec/:/usr/lib/kde4/libexec/:/usr/bin/


How can I change these paths?
pinotree
KDE Developer
Posts
222
Karma
7
OS

Re: KDE4 KRunner path

Sun Jun 26, 2011 10:47 am
Darkmind wrote:I have Firefox installed in '/usr/bin' from system repository. Apart from that I've installed a newer version in '~/firefox'.

So you have the ~/firefox/bin directory with the 'firefox' executable there? If so ...

Darkmind wrote:Following advices from Google, I created '~/.kde/env' directory and 'profile.sh' script there. This script only updates PATH variable:
Code: Select all
PATH="$HOME/firefox:$PATH";
export PATH;


... this would be wrong, because you have to add the bin directory to PATH, not the installation prefix.


Pino Toscano
Darkmind
Registered Member
Posts
30
Karma
0
OS

Re: KDE4 KRunner path

Sun Jun 26, 2011 2:18 pm
pinotree wrote:... this would be wrong, because you have to add the bin directory to PATH, not the installation prefix.

There's no 'bin' directory under 'firefox' one. Firefox executable is located right into '/home/darkmind/firefox':
Code: Select all
[darkmind@Host ~]$ ls -l /home/darkmind/firefox/firefox
-rwxr-xr-x 1 darkmind users 3914 Jan  1  2010 /home/darkmind/firefox/firefox

To be sure, I have the same 'export' in my .bashrc file and when I type 'firefox' from BASH, it starts correct version of Firefox (from $HOME/firefox)
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KDE4 KRunner path

Mon Jun 27, 2011 3:48 am
Please edit the script you have placed in ~/.kde4/env/ and add the following below the "export PATH=..." statement:
Code: Select all
echo "*** ENVIRONMENT CHECK $PATH"


Once logged in, grep ~/.xsession-errors for "ENVIRONMENT CHECK"


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS

Re: KDE4 KRunner path

Mon Jun 27, 2011 1:01 pm
An easier solution could be to make a new desktop file for the new Firefox. In kmenuedit, make a new Firefox item and set the command to launch /home/darkmind/firefox/firefox. Additionally, you can rename the old Firefox "Firefox-old" or something similar, which should make it rank second if you type "fir" in KRunner.


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
Darkmind
Registered Member
Posts
30
Karma
0
OS

Re: KDE4 KRunner path

Tue Jun 28, 2011 5:26 am
bcooksley,

I did this and I see .xsession-errors contain this line and quite long list of paths. Firefox instance in my home directory is among them and first in line:

*** ENVIRONMENT CHECK /home/darkmind/firefox:/home/darkmind/bin:/home/darkmind/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/opt/cross/bin:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:.:/usr/sbin:/sbin

Still, KRunner executes instance from '/usr/bin'. While Konsole executes one from '/home/darkmind/firefox'
Darkmind
Registered Member
Posts
30
Karma
0
OS

Re: KDE4 KRunner path

Tue Jun 28, 2011 5:33 am
Hans,

Yeah, I know, there is always more than one way to do it. That's why I like Linux, one can always apply a workaround almost for any problem.

On the other hand, I saw a lot of people having the same problem, but I didn't see anyone who succeeded in fixing. Seems like there's a bug or some unevident behavior of KDE. And I'd like to know the real cause of this problem, both to have a good understanding of how KDE works with environment and to correctly fix the problem.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]