12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- # vim: ft=sh:
- # shellcheck shell=sh
- # shellcheck source=/dev/null
- # shellcheck disable=3043,1090
- # load env
- __env=''
- for __env in ~/.nix-profile/etc/profile.d/nix.sh ~/.config/env; do
- [ -f "${__env}" ] && . "${__env}"
- done
- unset __env
- # start user services
- command -v s6-user-init >/dev/null && {
- # shellcheck disable=3030,2190,2206,2296
- {
- __ppid="${$}"
- __checked_disown() {
- if type disown 1>/dev/null; then
- # shellcheck disable=3044
- disown
- fi
- }
- # shellcheck disable=3044
- [ -n "${ZSH_VERSION}" ] && {
- declare -hA __old_options
- __old_options=(${(kv)options})
- setopt no_notify no_monitor
- }
- # shellcheck disable=2016
- ppid="${__ppid}" \
- pd "${__ppid}" \
- 'exec s6-user-init stop "${ppid:?}"' \
- & __checked_disown
- s6-user-init start "${__ppid:?}" & __checked_disown
- [ -n "${ZSH_VERSION}" ] && {
- # shellcheck disable=2034
- options=(${(kv)__old_options})
- unset __old_options
- }
- unset -f __checked_disown
- unset __ppid
- } 1>/dev/null 2>/dev/null
- }
- # if on first TTY then start X
- [ "${TTY:-$(tty)}" = /dev/tty1 ] && {
- xlog="${TMPDIR:-/tmp}/x.log"
- {
- SX_CLIENT_STOP_CMD="s6-x11-init stop ${$}" \
- exec sx start \
- dbus-launch --exit-with-x11 s6-x11-init start "${$}"
- } 1>>"${xlog}" 2>>"${xlog}"
- }
|