-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
improve "#2522 use startup command from /usr/share/xsession ..." #2557
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,13 +59,17 @@ 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 | ||
# GDM exports environment variables XDG_CURRENT_DESKTOP and XDG_SESSION_DESKTOP. | ||
# This follows it. | ||
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" | ||
XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP//;/:} | ||
export XDG_CURRENT_DESKTOP | ||
export XDG_SESSION_DESKTOP="$DESKTOP_SESSION" | ||
fi | ||
} | ||
|
||
|
@@ -80,15 +84,24 @@ wm_start() | |
# debian | ||
if [ -r /etc/X11/Xsession ]; then | ||
pre_start | ||
|
||
|
||
# if you want to start preferred desktop environment, | ||
# add following line, | ||
# [ -n "$XRDP_SESSION" ] && export DESKTOP_SESSION=<your preferred desktop> | ||
# in either of following file. | ||
# 1. ~/.profile | ||
# 2. create a file (any filename is OK) in /etc/profile.d | ||
# <your preferred desktop> shall be one of "ls -1 /usr/share/xsessions/" | ||
# e.g. [ -n "$XRDP_SESSION" ] && export DESKTOP_SESSION==ubuntu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should probably be DESKTOP_SESSION=ubuntu There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the documentation. This way we give some kind of "best practice" and prevent too many custom solutions/hacks that might break if upstream changes something |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed in the PR, please remove this bit. By all means add a comment to point the user to |
||
# 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")" | ||
get_xdg_session_startupcmd "$DESKTOP_SESSION" | ||
fi | ||
|
||
. /etc/X11/Xsession | ||
post_start | ||
exit 0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest
"ls -1 /usr/share/xsessions/" without .desktop suffix