s6-x11-init 517 B

12345678910111213141516171819202122232425
  1. #!/bin/sh --
  2. # vim: ft=sh
  3. set -ue
  4. : "${XDG_RUNTIME_DIR:=${TMPDIR:-/tmp}/runtime-${USER:-$(id -un)}}"
  5. : "${XDG_DATA_HOME:=${HOME:?}/.local/share}"
  6. if [ "${1}" = start ]; then
  7. : "${XAUTHORITY:?}"
  8. : "${DISPLAY:?}"
  9. _dpy__="${DISPLAY##*:}"
  10. _host__="${DISPLAY%%:*}"
  11. export BSPWM_SOCKET="${XDG_RUNTIME_DIR}/bspwm-socket${_host__:+-${_host__}}${_dpy__:+-${_dpy__}}"
  12. unset _dpy__
  13. unset _host__
  14. fi
  15. export S6_SYSPATH="${XDG_DATA_HOME}/s6/x11"
  16. export S6_RUNPATH="${XDG_RUNTIME_DIR}/s6/x11"
  17. exec s6-user-init "${@}"