mkdir -m760 ~/.local/share
}
xdg_data_dirs=($XDG_DATA_HOME /{opt,usr/local,usr/pkg,usr}/share
- "${XDG_DATA_DIRS:+${xdg_data_dirs[@]}}")
+ ${XDG_DATA_DIRS:+"$xdg_data_dirs[@]"})
# XXX: if colons are not escaped, could remove unintended part of string
# TODO: remove empty element via array not scalar
export XDG_DATA_DIRS=${XDG_DATA_DIRS#$XDG_DATA_HOME:}
}
if [[ -v XDG_RUNTIME_DIR ]] {
+ # NOTE: this can be set by systemd or other pre-shell supervisor, and
+ # if any services were started such as pipewire, we need to use
+ # the existing runtime dir so that we can get any existing
+ # program sockets or other data
export XDG_RUNTIME_DIR
} elif [[ -v TMPDIR ]] {
# make runtime dir in our session-specific tmpdir