forge
Explore
Log in

Don't you dare go Hollow

Try to pick user login shell instead of assuming bash

Browse files at this commit

f3e04981d8eaf7cc25b9f01cf91cf595abc4387cKirill ChibisovParent: 58f6b30
The trick is inspired by `gnome-session`.
resources/niri-sessionmodified+12 -1
@@ -1,4 +1,15 @@
1-#!/bin/bash --login1+#!/bin/sh
2+
3+if [ -n "$SHELL" ] &&
4+ grep -q "$SHELL" /etc/shells &&
5+ ! (echo "$SHELL" | grep -q "false") &&
6+ ! (echo "$SHELL" | grep -q "nologin"); then
7+ if [ "$1" != '-l' ]; then
8+ exec bash -c "exec -l '$SHELL' -c '$0 -l $*'"
9+ else
10+ shift
11+ fi
12+fi
2 13
3 # Make sure there's no already running session.14 # Make sure there's no already running session.
4 if systemctl --user -q is-active niri.service; then15 if systemctl --user -q is-active niri.service; then