diff --git a/resources/niri-session b/resources/niri-session index 8d24bccc7..46d73aa20 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