Merge pull request #30 from jokeyrhyme/23-use-preferred-shell
fix: use preferred SHELL in login shell mode
This commit is contained in:
commit
e05814291c
1 changed files with 10 additions and 7 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
# From: https://people.debian.org/~mpitt/systemd.conf-2016-graphical-session.pdf
|
# From: https://people.debian.org/~mpitt/systemd.conf-2016-graphical-session.pdf
|
||||||
|
|
||||||
if command -v systemctl >/dev/null; then
|
if command -v systemctl >/dev/null; then
|
||||||
|
|
@ -16,13 +18,14 @@ if command -v systemctl >/dev/null; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# /etc/profile contains a lot of important environment variables
|
# use the user's preferred shell to acquire environment variables
|
||||||
source /etc/profile
|
# see: https://github.com/pop-os/cosmic-session/issues/23
|
||||||
|
if [ -n "${SHELL}" ]; then
|
||||||
# load user's profile if it exists
|
# --in-login-shell: our flag to indicate that we don't need to recurse any further
|
||||||
if [ -n "${HOME}" -a -f "${HOME}/.profile" ]
|
if [ "${1}" != "--in-login-shell" ]; then
|
||||||
then
|
# `exec -l`: like `login`, prefixes $SHELL with a hyphen to start a login shell
|
||||||
source "${HOME}/.profile"
|
exec bash -c "exec -l '${SHELL}' -c '${0} --in-login-shell'"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export XDG_CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:=COSMIC}"
|
export XDG_CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:=COSMIC}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue