Add some more distrobox stuff

This commit is contained in:
Alexander Rosenberg 2025-02-16 23:06:32 -08:00
parent f21f778bd5
commit 4a3a91dd9c
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -32,6 +32,22 @@ function source_user_file {
# Load user early init file # Load user early init file
source_user_file "early-init" source_user_file "early-init"
# Load distrobox early init file
if [[ -v DISTROBOX_ENTER_PATH ]] && [[ -e /run/.containerenv ]]; then
local ctenv=("${(@f)"$(</run/.containerenv)"}")
for line in ${ctenv}; do
if [[ "${line}" == 'name='* ]]; then
export DISTROBOX_MY_NAME="${(Q)${line:5}}"
if [[ -d "${HOME}/src/compat/${DISTROBOX_MY_NAME}" ]]; then
export DISTROBOX_MY_COMPAT="${HOME}/src/compat/${DISTROBOX_MY_NAME}"
local init_file="${DISTROBOX_MY_COMPAT}/early-init.zsh"
[[ -e "${init_file}" ]] && source "${init_file}"
fi
break
fi
done
fi
# Some options # Some options
setopt autocd extendedglob rm_star_silent completealiases rc_quotes histignorespace setopt autocd extendedglob rm_star_silent completealiases rc_quotes histignorespace
unsetopt beep notify unsetopt beep notify
@ -297,6 +313,12 @@ bindkey '^ ' autosuggest-accept
# Load user init file # Load user init file
source_user_file 'local' source_user_file 'local'
# Load distrobox normal init file
if [[ -v DISTROBOX_MY_COMPAT ]] && \
[[ -f "${DISTROBOX_MY_COMPAT}/init.zsh" ]]; then
source "${DISTROBOX_MY_COMPAT}/init.zsh"
fi
# THE FOLLOWING PLUGINS MUST COME LAST # THE FOLLOWING PLUGINS MUST COME LAST
# More completions # More completions