diff options
| author | Erica Z <96443509+z-erica@users.noreply.github.com> | 2025-01-14 07:41:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-14 09:41:50 +0300 |
| commit | 36076d5279f349a32814dea91ca8f4dee61d5b08 (patch) | |
| tree | 2b947efff44a464fabe2ec0ab4331ee1262220e9 /resources | |
| parent | 427c4e39820b3cdbe86f355dd5fb8b3c6a8f0138 (diff) | |
| download | niri-36076d5279f349a32814dea91ca8f4dee61d5b08.tar.gz niri-36076d5279f349a32814dea91ca8f4dee61d5b08.tar.bz2 niri-36076d5279f349a32814dea91ca8f4dee61d5b08.zip | |
make niri-session POSIX compatible (#970)
* make niri-session POSIX compatible
* Update resources/niri-session
---------
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'resources')
| -rwxr-xr-x | resources/niri-session | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/resources/niri-session b/resources/niri-session index 2fe31987..4e4fb096 100755 --- a/resources/niri-session +++ b/resources/niri-session @@ -12,7 +12,7 @@ if [ -n "$SHELL" ] && fi # Try to detect the service manager that is being used -if hash systemctl &> /dev/null; then +if hash systemctl >/dev/null 2>&1; then # Make sure there's no already running session. if systemctl --user -q is-active niri.service; then echo 'A niri session is already running.' @@ -41,15 +41,15 @@ if hash systemctl &> /dev/null; then # Unset environment that we've set. systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET -elif hash dinitctl &> /dev/null; then +elif hash dinitctl >/dev/null 2>&1; then # Check that the user dinit daemon is running - if ! pgrep -u $(id -u) dinit &> /dev/null; then + if ! pgrep -u "$(id -u)" dinit >/dev/null 2>&1; then echo "dinit user daemon is not running." exit 1 fi # Make sure there's no already running session. - if dinitctl --user is-started niri &> /dev/null; then + if dinitctl --user is-started niri >/dev/null 2>&1; then echo 'A niri session is already running.' exit 1 fi |
