Skip to content

Commit

Permalink
cinnamon-session: make sure wayland sessions get a login shell (#161)
Browse files Browse the repository at this point in the history
Users expect their shell profiles to get sourced at startup, which
doesn't happen with wayland sessions.

This commit brings back that feature, by making the cinnamon-session
wrapper script run a login shell.

ref: https://gitlab.gnome.org/GNOME/gnome-session/-/commit/7e307f8ddb91db5d4051c4c792519a660ba67f35
  • Loading branch information
bobby285271 authored Jan 31, 2024
1 parent 0199cfc commit 60fd654
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
16 changes: 16 additions & 0 deletions cinnamon-session/cinnamon-session.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

if [ "x$XDG_SESSION_TYPE" = "xwayland" ] &&
[ "x$XDG_SESSION_CLASS" != "xgreeter" ] &&
[ -n "$SHELL" ] &&
grep -q "$SHELL" /etc/shells &&
! (echo "$SHELL" | grep -q "false") &&
! (echo "$SHELL" | grep -q "nologin"); then
if [ "$1" != '-l' ]; then
exec bash -c "exec -l '$SHELL' -c '$0 -l $*'"
else
shift
fi
fi

exec @libexecdir@/cinnamon-session-binary "$@"
14 changes: 13 additions & 1 deletion cinnamon-session/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cinnamon_session_sources = [
gdbus_sources,
]

executable('cinnamon-session',
executable('cinnamon-session-binary',
cinnamon_session_sources,
dependencies: [
cinnamon_desktop,
Expand All @@ -75,6 +75,18 @@ executable('cinnamon-session',
],
include_directories: [ rootInclude ],
install: true,
install_dir: get_option('libexecdir'),
)

script_conf = configuration_data()
script_conf.set('libexecdir', get_option('prefix') / get_option('libexecdir'))

configure_file(
input: 'cinnamon-session.in',
output: 'cinnamon-session',
install: true,
install_dir: get_option('bindir'),
configuration: script_conf
)

units = [
Expand Down

0 comments on commit 60fd654

Please sign in to comment.