Commit fd7d1ca3 authored by David Edmundson's avatar David Edmundson

Drop use of qtpaths in startkde

Summary:
Qtpaths doesn't work on some distros (Ubuntu for example, where it's
shipped with dev tools) and it's quite a slow way to effectively just read
an environment variable.

This is a rework of d90c63ac that
also correctly includes system directories.

Test Plan:
Put shell script in ~/.config/plasma-workspace/env
put shell script /etc/xdg/plasma-workspace/env
Rebooted. Confirmed both were run

Checked earlier 'if' statement works manually in bash.

Reviewers: #plasma

Subscribers: apol, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9478
parent 9be96f0e
......@@ -33,13 +33,14 @@ fi
#
# * Then ksmserver is started which takes control of the rest of the startup sequence
# We need to create config folder so we can write startupconfigkeys
if [ ${XDG_CONFIG_HOME} ]; then
configDir=$XDG_CONFIG_HOME;
else
configDir=${HOME}/.config; #this is the default, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
fi
sysConfigDirs=${XDG_CONFIG_DIRS:-/etc/xdg}
# We need to create config folder so we can write startupconfigkeys
mkdir -p $configDir
#This is basically setting defaults so we can use them with kstartupconfig5
......@@ -151,11 +152,10 @@ fi
# For anything else (that doesn't set env vars, or that needs a window manager),
# better use the Autostart folder.
scriptpath=`qtpaths --locate-dirs GenericConfigLocation plasma-workspace | tr ':' '\n'`
scriptpath=`echo "$configDir:$sysConfigDirs" | tr ':' '\n'`
# Add /env/ to the directory to locate the scripts to be sourced
for prefix in `echo $scriptpath`; do
for file in "$prefix"/env/*.sh; do
for file in "$prefix"/plasma-workspace/env/*.sh; do
test -r "$file" && . "$file" || true
done
done
......
......@@ -16,13 +16,14 @@ else
qdbus=qdbus
fi
# We need to create config folder so we can write startupconfigkeys
if [ ${XDG_CONFIG_HOME} ]; then
configDir=$XDG_CONFIG_HOME;
else
configDir=${HOME}/.config; #this is the default, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
fi
sysConfigDirs=${XDG_CONFIG_DIRS:-/etc/xdg}
# We need to create config folder so we can write startupconfigkeys
mkdir -p $configDir
#This is basically setting defaults so we can use them with kstartupconfig5
......@@ -166,13 +167,11 @@ fi
# For anything else (that doesn't set env vars, or that needs a window manager),
# better use the Autostart folder.
# TODO: Use GenericConfigLocation once we depend on Qt 5.4
scriptpath=`qtpaths --paths ConfigLocation | tr ':' '\n' | sed 's,$,/plasma-workspace,g'`
scriptpath=`echo "$configDir:$sysConfigDirs" | tr ':' '\n'`
# Add /env/ to the directory to locate the scripts to be sourced
for prefix in `echo $scriptpath`; do
for file in "$prefix"/env/*.sh; do
test -r "$file" && . "$file"
for file in "$prefix"/plasma-workspace/env/*.sh; do
test -r "$file" && . "$file" || true
done
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment