fixed issues when switching with Xorg started with startx/xinit (multi-user.target)
fixed issues when switching from console without Xorg running
replaced usage of runlevel command by use of systemctl to determine current target. runlevel did not always returns a defined runlevel and caused a bash error (on first script run)
made grepping for xinit process more strict
fixed issue where 'prime-select user_logout_waiter' execution would not always exit for a while after switching
fixed issues when switching with Xorg started with startx/xinit (multi-user.target) fixed issues when switching from console without Xorg running replaced usage of runlevel command by use of systemctl to determine current target. runlevel did not always returns a defined runlevel and caused a bash error (on first script run) made grepping for xinit process more strict fixed issue where 'prime-select user_logout_waiter' execution would not always exit for a while after switching