mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Try to pick user login shell instead of assuming bash
The trick is inspired by `gnome-session`.
This commit is contained in:
committed by
Ivan Molodetskikh
parent
58f6b30325
commit
f3e04981d8
+12
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user