Skip to content

Commit 60fd654

Browse files
authored
cinnamon-session: make sure wayland sessions get a login shell (#161)
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
1 parent 0199cfc commit 60fd654

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
if [ "x$XDG_SESSION_TYPE" = "xwayland" ] &&
4+
[ "x$XDG_SESSION_CLASS" != "xgreeter" ] &&
5+
[ -n "$SHELL" ] &&
6+
grep -q "$SHELL" /etc/shells &&
7+
! (echo "$SHELL" | grep -q "false") &&
8+
! (echo "$SHELL" | grep -q "nologin"); then
9+
if [ "$1" != '-l' ]; then
10+
exec bash -c "exec -l '$SHELL' -c '$0 -l $*'"
11+
else
12+
shift
13+
fi
14+
fi
15+
16+
exec @libexecdir@/cinnamon-session-binary "$@"

cinnamon-session/meson.build

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ cinnamon_session_sources = [
5353
gdbus_sources,
5454
]
5555

56-
executable('cinnamon-session',
56+
executable('cinnamon-session-binary',
5757
cinnamon_session_sources,
5858
dependencies: [
5959
cinnamon_desktop,
@@ -75,6 +75,18 @@ executable('cinnamon-session',
7575
],
7676
include_directories: [ rootInclude ],
7777
install: true,
78+
install_dir: get_option('libexecdir'),
79+
)
80+
81+
script_conf = configuration_data()
82+
script_conf.set('libexecdir', get_option('prefix') / get_option('libexecdir'))
83+
84+
configure_file(
85+
input: 'cinnamon-session.in',
86+
output: 'cinnamon-session',
87+
install: true,
88+
install_dir: get_option('bindir'),
89+
configuration: script_conf
7890
)
7991

8092
units = [

0 commit comments

Comments
 (0)