make niri-session POSIX compatible (#970)
Browse files at this commit1 changed file +4 -4
- resources/niri-session +4 -4
resources/niri-sessionmodified+4 -4
| @@ -12,7 +12,7 @@ if [ -n "$SHELL" ] && | |||
| 12 | fi | 12 | fi |
| 13 | 13 | ||
| 14 | # Try to detect the service manager that is being used | 14 | # 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 |
| 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; then | 17 | 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_SOCKET | 43 | 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 |
| 45 | # Check that the user dinit daemon is running | 45 | # 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 |
| 47 | echo "dinit user daemon is not running." | 47 | echo "dinit user daemon is not running." |
| 48 | exit 1 | 48 | exit 1 |
| 49 | fi | 49 | 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; then | 52 | + 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 1 | 54 | exit 1 |
| 55 | fi | 55 | fi |