diff options
| author | Kirill Chibisov <contact@kchibisov.com> | 2023-10-17 18:46:03 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-17 19:05:58 +0400 |
| commit | f3e04981d8eaf7cc25b9f01cf91cf595abc4387c (patch) | |
| tree | c90b627c3f017a5f907ebbee491089bff12c9245 | |
| parent | 58f6b3032519ce22635aba0d2d55f00c57c6e0f5 (diff) | |
| download | niri-f3e04981d8eaf7cc25b9f01cf91cf595abc4387c.tar.gz niri-f3e04981d8eaf7cc25b9f01cf91cf595abc4387c.tar.bz2 niri-f3e04981d8eaf7cc25b9f01cf91cf595abc4387c.zip | |
Try to pick user login shell instead of assuming bash
The trick is inspired by `gnome-session`.
| -rwxr-xr-x | resources/niri-session | 13 |
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 |
