qubes.GetAppmenus: handle home directory properly in case of sudo
This commit is contained in:
parent
2df17a4790
commit
418a5ec6e3
@ -17,7 +17,13 @@ for i in /etc/profile.d/*.sh ; do
|
||||
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