Skip to content

Commit b531d30

Browse files
committed
make niri-session POSIX compatible
1 parent 427c4e3 commit b531d30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

resources/niri-session

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ if [ -n "$SHELL" ] &&
55
! (echo "$SHELL" | grep -q "false") &&
66
! (echo "$SHELL" | grep -q "nologin"); then
77
if [ "$1" != '-l' ]; then
8-
exec bash -c "exec -l '$SHELL' -c '$0 -l $*'"
8+
exec sh -c "exec -l '$SHELL' -c '$0 -l $*'"
99
else
1010
shift
1111
fi
1212
fi
1313

1414
# Try to detect the service manager that is being used
15-
if hash systemctl &> /dev/null; then
15+
if hash systemctl >/dev/null 2>&1; then
1616
# Make sure there's no already running session.
1717
if systemctl --user -q is-active niri.service; then
1818
echo 'A niri session is already running.'
@@ -41,15 +41,15 @@ if hash systemctl &> /dev/null; then
4141

4242
# Unset environment that we've set.
4343
systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET
44-
elif hash dinitctl &> /dev/null; then
44+
elif hash dinitctl >/dev/null 2>&1; then
4545
# Check that the user dinit daemon is running
46-
if ! pgrep -u $(id -u) dinit &> /dev/null; then
46+
if ! pgrep -u "$(id -u)" dinit >/dev/null 2>&1; then
4747
echo "dinit user daemon is not running."
4848
exit 1
4949
fi
5050

5151
# Make sure there's no already running session.
52-
if dinitctl --user is-started niri &> /dev/null; then
52+
if dinitctl --user is-started niri >/dev/null 2>&1; then
5353
echo 'A niri session is already running.'
5454
exit 1
5555
fi

0 commit comments

Comments
 (0)