Bug 333793

Summary: startkde script is using kf5-config (from kdelibs4support) and misses .kf5/lib64 presence
Product: [Plasma] plasmashell Reporter: Luiz Angelo De Luca <luizluca>
Component: generalAssignee: Sebastian Kügler <sebas>
Status: RESOLVED FIXED    
Severity: major CC: afiestas, bhush94, demm, kde, lbeltrame, notmart
Priority: NOR    
Version: master   
Target Milestone: 1.0   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Luiz Angelo De Luca 2014-04-23 21:16:23 UTC
Hello,

startkde (from plasma-workspace) is using kf5-config to get kde library path:

# Source scripts found in <localprefix>/env/*.sh and <prefixes>/env/*.sh
# (where <localprefix> is $KDEHOME or ~/.kde, and <prefixes> is where KDE is installed)
#
# This is where you can define environment variables that will be available to
# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
# or eval `gpg-agent --daemon`.
# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
#
# (see end of this file).
# For anything else (that doesn't set env vars, or that needs a window manager),
# better use the Autostart folder.

libpath=`kf5-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

However, kf5-config is only listing /usr/lib64:

$ kf5-config --path lib
/usr/lib64/

While kde4-config listed user home as well:

$ kde4-config --path lib
/home/REDETRESC/luizluca/.kde4/lib64/:/usr/lib64/

Also, as kf5-config is from kdelibs4support, startkde might not depend on it for long time.

Maybe looking for a lib directory and replacing lib.* by env is a little too hack.
For example, a user named liberty might get trouble:
   
$ echo "/home/liberty/.kf5/lib64" | sed -n -e 's,/lib[^/]*/,/env/,p'
/home/env/.kf5/lib64

I also reported another problem related to autostart app on bug 333241.




Reproducible: Always

Steps to Reproduce:
1.create a script as .kf5/env/test.sh
2.log in into kf5

Actual Results:  
3. test.sh does not run

Expected Results:  
3. test.sh should run

kf5-config also has other problems (as well as kde4-config). But maybe they are not worth to fix:

luizluca(tresc031501) /opt/kf5/bin $ kde4-config --userpath desktop
/home/REDETRESC/luizluca/Desktop/ <---OK

luizluca(tresc031501) /opt/kf5/bin $ kde4-config --userpath autostart
/home/REDETRESC/luizluca/Autostart/ <---- should be /home/REDETRESC/luizluca/.kde4/Autostart or /home/REDETRESC/luizluca/.local/autostart (defined in systemsettings/personal-information)

luizluca(tresc031501) /opt/kf5/bin $ kde4-config --userpath document
/home/REDETRESC/luizluca/Documentos/ <---OK

and

luizluca(tresc031501) /opt/kf5/bin $ kf5-config --userpath desktop
/home/REDETRESC/luizluca/Desktop <---OK

luizluca(tresc031501) /opt/kf5/bin $ kf5-config --userpath autostart
autostart - unknown type of userpath <---???? missing ???

luizluca(tresc031501) /opt/kf5/bin $ kf5-config --userpath document
/home/REDETRESC/luizluca/Documentos <---OK
Comment 1 Marco Martin 2014-04-24 09:24:50 UTC
this is maybe more a bug against kdelibs4support ?
Comment 2 Luiz Angelo De Luca 2014-04-24 16:47:31 UTC
I guess it would be better to have an alternative way to get the ~/.kf5/env path as kdelibs4support might be removed in the future (or not?)
Comment 3 Luiz Angelo De Luca 2014-05-22 18:48:48 UTC
Still in beta:

systemsetting is working fine with scripts for both pre and startup, at least for installing the files.

pre is stored in:
.local/share/env/x.sh

And startup in:
~/.config/autostart/x.sh

But I see nowhere someone that calls .local/share/env/ in startkde, only the reference to:

$ kf5-config --path lib
/usr/lib64/

That does not include ~/.local/share/env/
Comment 4 David Edmundson 2014-05-24 15:13:45 UTC
CC'ing Alex F.
Comment 6 Luca Beltrame 2014-07-06 14:41:04 UTC
Git commit 18bcfd118a935e9b74c03013ca5dfbaedf606eb5 by Luca Beltrame.
Committed on 06/07/2014 at 14:40.
Pushed by lbeltrame into branch 'master'.

Use qtpaths isntead of kf5-config in startkde

Currently env and shutdown scripts in startkde are not run due to the way kf5-config is used. There is no more $KDEHOME, so proper paths aren't being found.
This patch moves things to qtpaths, putting things under ConfigLocation + "plasma-workspace" + "env" (or "shutdown").

As a plus, kf5-config is no longer used in startkde.
REVIEW: 119145

M  +12   -8    startkde/startkde.cmake

http://commits.kde.org/plasma-workspace/18bcfd118a935e9b74c03013ca5dfbaedf606eb5
Comment 7 Luca Beltrame 2014-07-06 14:43:53 UTC
Git commit 2e33a8e0d8cd60eb01335ff4737e4c1883dcfa57 by Luca Beltrame.
Committed on 06/07/2014 at 14:42.
Pushed by lbeltrame into branch 'master'.

Autostart KCM: update env and shutdown paths to GenericConfigLocation + plasma-workspace + [env|shutdown]

In order to fix bug 333793, some adjustments to both the startkde (RR 119145) and the autostart KCM are needed.
This patch, like the analogous one made to startkde, moves env and shutdown directories to GenericConfigLocation + plasma-workspace/[env|shutdown].
REVIEW: 119146

M  +5    -2    kcms/autostart/autostart.cpp

http://commits.kde.org/plasma-desktop/2e33a8e0d8cd60eb01335ff4737e4c1883dcfa57