Merge remote-tracking branch 'origin/pr/199'
* origin/pr/199: qubes.GetAppmenus: handle home directory properly in case of sudo Silence shellcheck GetAppmenus: ensure right app directories
This commit is contained in:
commit
cc68f165bc
@ -6,8 +6,24 @@
|
||||
# - directories stored on /rw in case of "rw-only" persistence
|
||||
# - nothing, otherwise
|
||||
|
||||
# Reload scripts in /etc/profile.d/, in case they register additional
|
||||
# directories in XDG_DATA_DIRS and we forgot them
|
||||
# (e.g. because we are running under sudo).
|
||||
for i in /etc/profile.d/*.sh ; do
|
||||
if [ -r "$i" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "$i" >/dev/null
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$XDG_DATA_HOME" ]; then
|
||||
XDG_DATA_HOME="$HOME/.local/share"
|
||||
user="$(whoami)"
|
||||
# In case we are running under sudo, use default-user.
|
||||
if [ "$user" = "root" ]; then
|
||||
user="$(qubesdb-read /default-user || echo user)"
|
||||
fi
|
||||
home="$(eval echo "~$user")"
|
||||
XDG_DATA_HOME="$home/.local/share"
|
||||
fi
|
||||
if [ -z "$XDG_DATA_DIRS" ]; then
|
||||
XDG_DATA_DIRS="/usr/local/share/:/usr/share/"
|
||||
|
Loading…
Reference in New Issue
Block a user