Skip to content

Commit

Permalink
Try to pick user login shell instead of assuming bash
Browse files Browse the repository at this point in the history
The trick is inspired by `gnome-session`.
  • Loading branch information
kchibisov committed Oct 17, 2023
1 parent 58f6b30 commit 18613c1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion resources/niri-session
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 18613c1

Please sign in to comment.