Try to pick user login shell instead of assuming bash
Browse files at this commitf3e04981d8eaf7cc25b9f01cf91cf595abc4387cParent: 58f6b301 changed file +12 -1
- resources/niri-session +12 -1
resources/niri-sessionmodified+12 -1
| @@ -1,4 +1,15 @@ | |||
| 1 | -#!/bin/bash --login | 1 | +#!/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; then | 15 | if systemctl --user -q is-active niri.service; then |