[neon/neon-packaging/plasma-login-manager/Neon/stable] debian: don't put our custom *session scripts in /etc

Carlos De Maine null at kde.org
Mon Jun 15 13:20:22 BST 2026


Git commit 5b43b350239fc8888b3ec3caba2adb9af37ee61d by Carlos De Maine.
Committed on 15/06/2026 at 12:14.
Pushed by carlosdem into branch 'Neon/stable'.

don't put our custom *session scripts in /etc

patch the scripts bound for /usr/lib/plasmalogin/*  instead

D  +0    -57   debian/Xsession
A  +2    -0    debian/patches/series
A  +38   -0    debian/patches/wayland-session.diff
A  +95   -0    debian/patches/xsession.diff
M  +0    -8    debian/rules
D  +0    -63   debian/wayland-session

https://invent.kde.org/neon/neon-packaging/plasma-login-manager/-/commit/5b43b350239fc8888b3ec3caba2adb9af37ee61d

diff --git a/debian/Xsession b/debian/Xsession
deleted file mode 100755
index 53b905d..0000000
--- a/debian/Xsession
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /bin/sh
-# Xsession - run as user
-# Copyright (C) 2016 Pier Luigi Fiorini <pierluigi.fiorini at gmail.com>
-
-# This file is extracted from kde-workspace (kdm/kfrontend/genkdmconf.c)
-# Copyright (C) 2001-2005 Oswald Buddenhagen <ossi at kde.org>
-
-# Note that the respective logout scripts are not sourced.
-case $SHELL in
-  */bash)
-    [ -z "$BASH" ] && exec $SHELL $0 "$@"
-    set +o posix
-    [ -f /etc/profile ] && . /etc/profile
-    if [ -f $HOME/.bash_profile ]; then
-      . $HOME/.bash_profile
-    elif [ -f $HOME/.bash_login ]; then
-      . $HOME/.bash_login
-    elif [ -f $HOME/.profile ]; then
-      . $HOME/.profile
-    fi
-    ;;
-  */zsh)
-    [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
-    emulate -R zsh
-    [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
-    zhome=${ZDOTDIR:-$HOME}
-    # zshenv is always sourced automatically.
-    [ -f $zdir/zprofile ] && . $zdir/zprofile
-    [ -f $zhome/.zprofile ] && . $zhome/.zprofile
-    [ -f $zdir/zlogin ] && . $zdir/zlogin
-    [ -f $zhome/.zlogin ] && . $zhome/.zlogin
-    setopt shwordsplit noextendedglob
-    ;;
-  */csh|*/tcsh)
-    # [t]cshrc is always sourced automatically.
-    # Note that sourcing csh.login after .cshrc is non-standard.
-    xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
-    $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $xsess_tmp"
-    . $xsess_tmp
-    rm -f $xsess_tmp
-    ;;
-  */fish)
-    [ -f /etc/profile ] && . /etc/profile
-    [ -f $HOME/.profile ] && . $HOME/.profile
-    xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
-    $SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
-    . $xsess_tmp
-    rm -f $xsess_tmp
-    ;;
-  *) # Plain sh, ksh, and anything we do not know.
-    [ -f /etc/profile ] && . /etc/profile
-    [ -f $HOME/.profile ] && . $HOME/.profile
-    ;;
-esac
-
-# invoke global X session script
-. /etc/X11/Xsession
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c689a62
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+wayland-session.diff
+xsession.diff
diff --git a/debian/patches/wayland-session.diff b/debian/patches/wayland-session.diff
new file mode 100644
index 0000000..345327f
--- /dev/null
+++ b/debian/patches/wayland-session.diff
@@ -0,0 +1,38 @@
+diff --git a/home/carlos/Projects/plasma-login-manager/data/scripts/wayland-session b/tmp/neons/plasma-login-manager/debian/wayland-session
+index d5b4077..99c5e2e 100755
+--- a/plasma-login-manager/data/scripts/wayland-session
++++ b/plasma-login-manager/data/scripts/wayland-session
+@@ -12,14 +12,28 @@ PLASMALOGIN_USER_SHELL=$SHELL
+ 
+ case $SHELL in
+   */bash)
+-    [ -z "$BASH" ] && exec $SHELL --login $0 "$@"
+-    shopt -q login_shell || exec $SHELL --login $0 "$@"
++    [ -z "$BASH" ] && exec $SHELL $0 "$@"
+     set +o posix
++    [ -f /etc/profile ] && . /etc/profile
++    if [ -f $HOME/.bash_profile ]; then
++      . $HOME/.bash_profile
++    elif [ -f $HOME/.bash_login ]; then
++      . $HOME/.bash_login
++    elif [ -f $HOME/.profile ]; then
++      . $HOME/.profile
++    fi
+     ;;
+   */zsh)
+-    [ -z "$ZSH_NAME" ] && exec $SHELL --login $0 "$@"
+-    [[ -o login ]] || exec $SHELL --login $0 "$@"
+-    emulate -R sh
++    [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
++    emulate -R zsh
++    [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
++    zhome=${ZDOTDIR:-$HOME}
++    # zshenv is always sourced automatically.
++    [ -f $zdir/zprofile ] && . $zdir/zprofile
++    [ -f $zhome/.zprofile ] && . $zhome/.zprofile
++    [ -f $zdir/zlogin ] && . $zdir/zlogin
++    [ -f $zhome/.zlogin ] && . $zhome/.zlogin
++    setopt shwordsplit noextendedglob
+     ;;
+   */csh|*/tcsh)
+     # [t]cshrc is always sourced automatically.
diff --git a/debian/patches/xsession.diff b/debian/patches/xsession.diff
new file mode 100644
index 0000000..82125f1
--- /dev/null
+++ b/debian/patches/xsession.diff
@@ -0,0 +1,95 @@
+--- a/plasma-login-manager/data/scripts/Xsession
++++ b/plasma-login-manager/data/scripts/Xsession
+@@ -8,14 +8,28 @@
+ # Note that the respective logout scripts are not sourced.
+ case $SHELL in
+   */bash)
+-    [ -z "$BASH" ] && exec $SHELL --login $0 "$@"
+-    shopt -q login_shell || exec $SHELL --login $0 "$@"
++    [ -z "$BASH" ] && exec $SHELL $0 "$@"
+     set +o posix
++    [ -f /etc/profile ] && . /etc/profile
++    if [ -f $HOME/.bash_profile ]; then
++      . $HOME/.bash_profile
++    elif [ -f $HOME/.bash_login ]; then
++      . $HOME/.bash_login
++    elif [ -f $HOME/.profile ]; then
++      . $HOME/.profile
++    fi
+     ;;
+   */zsh)
+-    [ -z "$ZSH_NAME" ] && exec $SHELL --login $0 "$@"
+-    [[ -o login ]] || exec $SHELL --login $0 "$@"
+-    emulate -R sh
++    [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
++    emulate -R zsh
++    [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
++    zhome=${ZDOTDIR:-$HOME}
++    # zshenv is always sourced automatically.
++    [ -f $zdir/zprofile ] && . $zdir/zprofile
++    [ -f $zhome/.zprofile ] && . $zhome/.zprofile
++    [ -f $zdir/zlogin ] && . $zdir/zlogin
++    [ -f $zhome/.zlogin ] && . $zhome/.zlogin
++    setopt shwordsplit noextendedglob
+     ;;
+   */csh|*/tcsh)
+     # [t]cshrc is always sourced automatically.
+@@ -39,56 +53,5 @@ case $SHELL in
+     ;;
+ esac
+ 
+-[ -f /etc/xprofile ] && . /etc/xprofile
+-[ -f /usr/local/etc/xprofile ] && . /usr/local/etc/xprofile
+-[ -f $HOME/.xprofile ] && . $HOME/.xprofile
+-
+-# run all system xinitrc shell scripts.
+-if [ -d /etc/X11/xinit/xinitrc.d ]; then
+-  for i in /etc/X11/xinit/xinitrc.d/* ; do
+-  if [ -x "$i" ]; then
+-    . "$i"
+-  fi
+-  done
+-fi
+-
+-# Load Xsession scripts
+-# OPTIONFILE, USERXSESSION, USERXSESSIONRC and ALTUSERXSESSION are required
+-# by the scripts to work
+-xsessionddir="/etc/X11/Xsession.d"
+-OPTIONFILE=/etc/X11/Xsession.options
+-USERXSESSION=$HOME/.xsession
+-USERXSESSIONRC=$HOME/.xsessionrc
+-ALTUSERXSESSION=$HOME/.Xsession
+-
+-if [ -d "$xsessionddir" ]; then
+-    for i in `ls $xsessionddir`; do
+-        script="$xsessionddir/$i"
+-        echo "Loading X session script $script"
+-        if [ -r "$script"  -a -f "$script" ] && expr "$i" : '^[[:alnum:]_-]\{1,\}$' > /dev/null; then
+-            . "$script"
+-        fi
+-    done
+-fi
+-
+-if [ -d /etc/X11/Xresources ]; then
+-  for i in /etc/X11/Xresources/*; do
+-    [ -f $i ] && xrdb -merge $i
+-  done
+-elif [ -f /etc/X11/Xresources ]; then
+-  xrdb -merge /etc/X11/Xresources
+-fi
+-[ -f $HOME/.Xresources ] && xrdb -merge $HOME/.Xresources
+-
+-if [ -f "$USERXSESSIONRC" ]; then
+-  . "$USERXSESSIONRC"
+-fi
+-if [ -f "$USERXSESSION" ]; then
+-  . "$USERXSESSION"
+-fi
+-
+-if [ -z "$*" ]; then
+-    exec xmessage -center -buttons OK:0 -default OK "Sorry, $DESKTOP_SESSION is no valid session."
+-else
+-    exec $@
+-fi
++# invoke global X session script
++. /etc/X11/Xsession
diff --git a/debian/rules b/debian/rules
index 89c54e1..f35a272 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,8 +9,6 @@
 
 override_dh_auto_configure:
 	dh_auto_configure -- -DBUILD_MAN_PAGES=ON \
-	-DSESSION_COMMAND="/etc/plasmalogin/Xsession" \
-	-DWAYLAND_SESSION_COMMAND="/etc/plasmalogin/wayland-session" \
 	-DDBUS_CONFIG_FILENAME="plasmalogin_org.freedesktop.DisplayManager.conf" \
 	-DINSTALL_PAM_CONFIGURATION=OFF \
 	-DBUILD_TESTING=OFF
@@ -27,12 +25,6 @@ override_dh_install:
 	# cp debian specific files
 	dh_install
 
-override_dh_fixperms-arch:
-	# ensure installed scripts are marked as executable
-	chmod +x $(CURDIR)/debian/plasmalogin/etc/plasmalogin/Xsession
-	chmod +x $(CURDIR)/debian/plasmalogin/etc/plasmalogin/wayland-session
-	dh_fixperms
-
 override_dh_installpam:
 	dh_installpam --name=plasmalogin
 	dh_installpam --name=plasmalogin-autologin
diff --git a/debian/wayland-session b/debian/wayland-session
deleted file mode 100755
index 99c5e2e..0000000
--- a/debian/wayland-session
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-# wayland-session - run as user
-# Copyright (C) 2015-2016 Pier Luigi Fiorini <pierluigi.fiorini at gmail.com>
-
-# This file is extracted from kde-workspace (kdm/kfrontend/genkdmconf.c)
-# Copyright (C) 2001-2005 Oswald Buddenhagen <ossi at kde.org>
-
-# Note that the respective logout scripts are not sourced.
-
-# Backup the user shell setting into PLASMALOGIN specific variable
-PLASMALOGIN_USER_SHELL=$SHELL
-
-case $SHELL in
-  */bash)
-    [ -z "$BASH" ] && exec $SHELL $0 "$@"
-    set +o posix
-    [ -f /etc/profile ] && . /etc/profile
-    if [ -f $HOME/.bash_profile ]; then
-      . $HOME/.bash_profile
-    elif [ -f $HOME/.bash_login ]; then
-      . $HOME/.bash_login
-    elif [ -f $HOME/.profile ]; then
-      . $HOME/.profile
-    fi
-    ;;
-  */zsh)
-    [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
-    emulate -R zsh
-    [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
-    zhome=${ZDOTDIR:-$HOME}
-    # zshenv is always sourced automatically.
-    [ -f $zdir/zprofile ] && . $zdir/zprofile
-    [ -f $zhome/.zprofile ] && . $zhome/.zprofile
-    [ -f $zdir/zlogin ] && . $zdir/zlogin
-    [ -f $zhome/.zlogin ] && . $zhome/.zlogin
-    setopt shwordsplit noextendedglob
-    ;;
-  */csh|*/tcsh)
-    # [t]cshrc is always sourced automatically.
-    # Note that sourcing csh.login after .cshrc is non-standard.
-    wlsess_tmp=`mktemp /tmp/wlsess-env-XXXXXX`
-    $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $wlsess_tmp"
-    . $wlsess_tmp
-    rm -f $wlsess_tmp
-    ;;
-  */fish)
-    [ -f /etc/profile ] && . /etc/profile
-    [ -f $HOME/.profile ] && . $HOME/.profile
-    xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
-    $SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
-    . $xsess_tmp
-    rm -f $xsess_tmp
-    ;;
-  *) # Plain sh, ksh, and anything we do not know.
-    [ -f /etc/profile ] && . /etc/profile
-    [ -f $HOME/.profile ] && . $HOME/.profile
-    ;;
-esac
-
-# Restore user shell setting that may have been clobbered by setting environment
-export SHELL=$PLASMALOGIN_USER_SHELL
-
-exec $@


More information about the Neon-commits mailing list