Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use startup command from /usr/share/xsession if DISPLAY_SESSION is set #2522

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions sesman/startwm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ post_start()
return 0
}

get_xdg_session_startupcmd()
{
# DESKTOP_SESSION should be set in sesman.ini in the SessionVariables section.
# If set and valid then the STARTUP command will be taken from there
if [ -n "$1" ] && [ -d /usr/share/xsessions ] \
&& [ -f "/usr/share/xsessions/$1.desktop" ]; then
STARTUP=$(grep ^Exec= "/usr/share/xsessions/$1.desktop")
STARTUP=${STARTUP#Exec=*}
XDG_CURRENT_DESKTOP=$(grep ^DesktopNames= "/usr/share/xsessions/$1.desktop")
XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP#DesktopNames=*}
echo "env XDG_CURRENT_DESKTOP=\"$XDG_CURRENT_DESKTOP\" $STARTUP"
fi
}

#start the window manager
wm_start()
{
Expand All @@ -66,6 +80,15 @@ wm_start()
# debian
if [ -r /etc/X11/Xsession ]; then
pre_start

# STARTUP is the default startup command.
# if $1 is empty and STARTUP was not set
# /etc/X11/Xsession.d/50x11-common_determine-startup will fallback to
# x-session-manager
if [ -z "$STARTUP" ] && [ -n "$DESKTOP_SESSION" ]; then
STARTUP="$(get_xdg_session_startupcmd "$DESKTOP_SESSION")"
fi

. /etc/X11/Xsession
post_start
exit 0
Expand Down