aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xresources/niri-session13
1 files changed, 12 insertions, 1 deletions
diff --git a/resources/niri-session b/resources/niri-session
index 8d24bccc..46d73aa2 100755
--- a/resources/niri-session
+++ b/resources/niri-session
@@ -1,4 +1,15 @@
-#!/bin/bash --login
+#!/bin/sh
+
+if [ -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
# Make sure there's no already running session.
if systemctl --user -q is-active niri.service; then