forge
Explore
Log in

Don't you dare go Hollow

make niri-session POSIX compatible (#970)

Browse files at this commit

36076d5279f349a32814dea91ca8f4dee61d5b08UnverifiedErica Z and Ivan MolodetskikhParent: 427c4e3
* make niri-session POSIX compatible

* Update resources/niri-session

---------
resources/niri-sessionmodified+4 -4
@@ -12,7 +12,7 @@ if [ -n "$SHELL" ] &&
12 fi12 fi
13 13
14 # Try to detect the service manager that is being used14 # Try to detect the service manager that is being used
15-if hash systemctl &> /dev/null; then15+if hash systemctl >/dev/null 2>&1; then
16 # Make sure there's no already running session.16 # Make sure there's no already running session.
17 if systemctl --user -q is-active niri.service; then17 if systemctl --user -q is-active niri.service; then
18 echo 'A niri session is already running.'18 echo 'A niri session is already running.'
@@ -41,15 +41,15 @@ if hash systemctl &> /dev/null; then
41 41
42 # Unset environment that we've set.42 # Unset environment that we've set.
43 systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET43 systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET
44-elif hash dinitctl &> /dev/null; then44+elif hash dinitctl >/dev/null 2>&1; then
45 # Check that the user dinit daemon is running45 # Check that the user dinit daemon is running
46- if ! pgrep -u $(id -u) dinit &> /dev/null; then46+ if ! pgrep -u "$(id -u)" dinit >/dev/null 2>&1; then
47 echo "dinit user daemon is not running."47 echo "dinit user daemon is not running."
48 exit 148 exit 1
49 fi49 fi
50 50
51 # Make sure there's no already running session.51 # Make sure there's no already running session.
52- if dinitctl --user is-started niri &> /dev/null; then52+ if dinitctl --user is-started niri >/dev/null 2>&1; then
53 echo 'A niri session is already running.'53 echo 'A niri session is already running.'
54 exit 154 exit 1
55 fi55 fi