[kde] Re: How to set the KDE path?

2011-02-08 Thread Alex Schuster
Kevin Krammer writes:

 On Tuesday, 2011-02-08, Dotan Cohen wrote:

  ✈ganymede:~$ cat .kde/env/path.sh
  #!/bin/bash
  export PATH=$HOME/.bin:$PATH
 
 Maybe try without the first line.

Hmm, this can't really matter, it's just a comment.

I'd try adding something like
echo $PATH  /tmp/startkde.log
to verify if this file is being sourced. Or maybe even edit 
/usr/bin/startkde, activating bash debug output, putting all stuff between 
parantheses and redirecting output to another log file:

#!/bin/sh
#
#  DEFAULT KDE STARTUP SCRIPT ( 4.6.00 (4.6.0) )
#

(
set -xv # enable debugging
[rest of script]
)  /tmp/startkde.fulllog 21


It might be better to only put the relevant part into parantheses. On my 
Gentoo system it's from line 199 to 214:

(
set -xv
libpath=`kde4-config --path lib | tr : '\n'`

for prefix in `echo $libpath | sed -n -e 's,/lib[^/]*/,/env/,p'`; do
  for file in $prefix*.sh; do
test -r $file  . $file
  done
done
)  /tmp/startkde.fulllog 21

Wonko
___
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

[kde] Re: How to set the KDE path?

2011-02-02 Thread Kevin Krammer
On Tuesday, 2011-02-01, Dotan Cohen wrote:
 On Tue, Feb 1, 2011 at 21:06, Kevin Krammer kevin.kram...@gmx.at wrote:
  On Tuesday, 2011-02-01, Dotan Cohen wrote:
  On Tue, Feb 1, 2011 at 18:24, Kevin Krammer kevin.kram...@gmx.at wrote:
   That never worked because e.g. .bash_profile is only read by
   interactive shells (see man bash) and the shell running
   /usr/bin/startkde is not interactive.
  
  Of course, .bash_profile is for bash as the name implies. But what
  about .profile? Would it not make sense for KDE to respect that?
  
  KDE is started through a script called startkde.
  This is executed by a shell interpreter, whatever /bin/sh points to.
  
  This shell might not read .profile, bash for example only does this for
  interactive login shells. Nothing KDE can do about that.
 
 This is the whole point. What does KDE read to set the PATH?

When a process is created, it gets the current environment of its parent 
process (well, the parent can pass a modified env if it chooses to).
The process itself then reads the environment through system API, e.g. 
getenv()

So if you run any program from within an interactive shell, it basically sees 
the environment of the shell at that point. If the shell's environment is 
altered afterwards, this will have no effect on the already running process.

So the environment for KDE base processes is the one which they are started 
in.
In case of a KDE workspace session, this is the environment which is present 
inside the startkde script. Which in turn is also running with the environment 
which was valid at its start.

Now the script's code or the interpreter running the script can alter this 
environment and any process started after such a change sees the new one 
(remember any process started before a change sees the old one).

The KDE environment extender mechanism uses that by having the startkde script 
source (include into itself) all files with extension .sh in any of its env 
directories.

 For
 instance, the path that the Krunner dialogue looks for apps?

A combination of paths in $PATH and KDE specific non-interactive-binaries 
paths.
See kde4-config --path exec

 And why
 isn't this configurable in System Settings?

Maybe to avoid misunderstanding when such a change only effects KDE programs 
an no non-KDE programs.
You could try a wish list item on bugs.kde.org for making the KDE specific 
search list configurable.

   For KDE one can additional use KDE's environment extender mechanims,
   i.e. putting a file (with .sh extension) into $HOME/.kde/env
  
  Do you know the syntax? It is not the bash syntax. Thanks.
  
  Somthing like this:
  
  export PATH=$HOME/.bin:$PATH
 
 Thanks, but that has no effect in, for instance $HOME/.kde/env/path.sh
 which has been chmodded +x and the system restart.

That should have worked. I've used that myself several times. The files in 
there are just read, so executable shouldn't be necessary either.

Check that your setup is actually using $HOME/.kde/ some distributions patched 
KDE to make it something different.
See kde4-config --localprefix

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring


signature.asc
Description: This is a digitally signed message part.
___
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

[kde] Re: How to set the KDE path?

2011-02-01 Thread Felix Miata
On 2011/02/01 17:34 (GMT+0200) Dotan Cohen composed:

 It is rather frustrating that the Plasma Krunner (Alt-F2) does not
 follow the path configured in $HOME/.profile. If the user has a
 wrapper function for /usr/bin/firefox in $HOME/.bin/firefox and
 $HOME/.bin starts the path, Konsole will open the firefox wrapper but
 Krunner will open /usr/bin/firefox.

 The lead Plasma developer mentions that the user can configure the KDE
 path by placing an executable in ~/.xinitrc
 https://bugs.kde.org/show_bug.cgi?id=263883

 However, it doesn't work. Googling the issue I see lots of people
 asking and the answer is usually to configure the path in
 .bash_profile or .profile. That does not work in KDE 4.x, I assume
 that it worked in 3.x by the age of those posts.

 So, what is the correct syntax for configuring the KDE path in
 ~/.xinitrc? Thanks!

Start with http://lists.opensuse.org/opensuse/2011-01/msg00812.html maybe? 
What I've seen of the responses on your quest to solve this disgusts me.

What I do with alien installs is put them in /usr/local/, then start them 
using fullpath of the executable, putting it in a script in default $PATH if 
necessary to ease load on user memory.
-- 
How much better to get wisdom than gold, to choose
understanding rather than silver. Proverbs 16:16 NKJV

  Team OS/2 ** Reg. Linux User #211409

Felix Miata  ***  http://fm.no-ip.com/
___
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.


[kde] Re: How to set the KDE path?

2011-02-01 Thread Kevin Krammer
On Tuesday, 2011-02-01, Dotan Cohen wrote:
 It is rather frustrating that the Plasma Krunner (Alt-F2) does not
 follow the path configured in $HOME/.profile. If the user has a
 wrapper function for /usr/bin/firefox in $HOME/.bin/firefox and
 $HOME/.bin starts the path, Konsole will open the firefox wrapper but
 Krunner will open /usr/bin/firefox.
 
 The lead Plasma developer mentions that the user can configure the KDE
 path by placing an executable in ~/.xinitrc
 https://bugs.kde.org/show_bug.cgi?id=263883
 
 However, it doesn't work. Googling the issue I see lots of people
 asking and the answer is usually to configure the path in
 .bash_profile or .profile. That does not work in KDE 4.x, I assume
 that it worked in 3.x by the age of those posts.

That never worked because e.g. .bash_profile is only read by interactive 
shells (see man bash) and the shell running /usr/bin/startkde is not 
interactive.

Some people might have had /bin/bash symlinked to /bin/sh and .bashrc sourcing 
.bash_profile but of course this is just working around the way that shell 
works.

Usually distributions have some way of setting environment variables that 
should always be present regardless of the type of login (local vs. from 
remote, X vs. virtual console).

Xinit is a way to do that only for X11 based sessions, but again regardless of 
workspace environment being used.

For KDE one can additional use KDE's environment extender mechanims, i.e. 
putting a file (with .sh extension) into $HOME/.kde/env 

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring


signature.asc
Description: This is a digitally signed message part.
___
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.