From Hitman, 2 Years ago, written in Plain Text.
Embed
  1. # known bug it hangs
  2. #!/usr/bin/openrc-run
  3.  
  4. depend() {
  5. after logind
  6. after alsasound
  7. }
  8.  
  9. start() {
  10. users="$(users)"
  11. for user in $users $([ -z "$users" ] && getent passwd | grep -P '1[0-9]{3,5}' | cut -d: -f1); do [ "$(getent passwd "$user" | cut -d: -f3)" \< 1000 ] && continue
  12. grp="$(getent group "$user" | cut -d: -f1)"
  13. if pgrep -u "$user" session >/dev/null; then
  14. func_ran=1
  15. su -s /bin/sh -c "dbus-launch env XDG_RUNTIME_DIR=/run/user/$(getent passwd "$user" | cut -d: -f3) pipewire" $user $grp || eend 1 &
  16. sleep 1 && if [ -n "$(command -v wireplumber)" ]; then if ! pgrep wireplumber -u $user; then su -s /bin/sh -c "dbus-launch env XDG_RUNTIME_DIR=/run/user/$(getent passwd "$user" | cut -d: >
  17. elif [ -n "$(command -v pipweire-media-session)" ]; then if ! pgrep pipewire-media-session -u $user; then su -s /bin/sh -c "dbus-launch env XDG_RUNTIME_DIR=/run/user/$(getent passwd "$use>
  18. sleep 1 && if [ -n "$(command -v pipewire-pulse)" ]; then if ! pgrep pipewire-pulse -u $user; then su -s /bin/sh -c "dbus-launch env XDG_RUNTIME_DIR=/run/user/$(getent passwd "$user" | cu>
  19. fi
  20. done
  21. [ -z $func_ran ] && eend 1
  22. }
  23.  
  24.  
captcha