Skip to content

Commit

Permalink
try using startup command in /usr/share/xsessions
Browse files Browse the repository at this point in the history
gnome shell has a way to start different desktop profiles, but all
use the same gnome-session binary.

also XDG somehow explects that the DESKTOP_SESSION environment variable
is set. This value is derived from the .desktop file name in /usr/share/xsessions

There is also a XDG_CURRENT_DESKTOP that comes from that file

on debian/ubuntu setting STARTUP should work, not sure about other
distros.
  • Loading branch information
akarl10 committed Jan 29, 2023
1 parent 29ef7f8 commit 46b5a40
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions sesman/startwm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@ wm_start()
. /etc/default/locale
export LANG LANGUAGE
fi

# DESKTOP_SESSION should be set in sesman.ini in the SessionVariables section.
# If DESKTOP_SESSION is not set the first available configuration in /usr/share/xsessions
# will be used instead
if [ -d /usr/share/xsessions ]; then
if [ -z $DESKTOP_SESSION ]; then
choosenSession=`ls -1 /usr/share/xsessions/*.desktop | head -n 1`
DESKTOP_SESSION=${choosenSession##*/}
DESKTOP_SESSION=${DESKTOP_SESSION%%.desktop}
export DESKTOP_SESSION
fi
STARTUP=`grep ^Exec= /usr/share/xsessions/$DESKTOP_SESSION.desktop`
STARTUP=${STARTUP#Exec=*}
XDG_CURRENT_DESKTOP=`grep ^DesktopNames= /usr/share/xsessions/$DESKTOP_SESSION.desktop`
XDG_CURRNET_DESKTOP=${DesktopNames#DesktopNames=*}
export XDG_CURRENT_DESKTOP
fi

# debian
if [ -r /etc/X11/Xsession ]; then
Expand Down

0 comments on commit 46b5a40

Please sign in to comment.