This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/bin/prelude

22 lines
831 B
Bash
Executable file

#!/usr/bin/env sh
# these are all paths used across many of the dotfiles and should be assumed to
# be loaded and properly set by every script - this means you are responsible
# for making sure they're loaded!
export XDG_CONFIG_HOME="$HOME/.config"
export DOTFILES_PATH="$XDG_CONFIG_HOME/lytedev-dotfiles"
export ENV_PATH="$HOME/.env"
export TERMINAL="kitty"
# TODO: better logic for auto-detecting alternative home directories?
# 1. check dirname(basename $HOME)) matches username
# 2. check /home/$username
NICE_HOME="$HOME"
[ "$(basename "${HOME}")" = ".home" ] && NICE_HOME="$(realpath "$HOME/..")"
[ -e "${HOME}/.nice_home" ] && NICE_HOME="$(cat "${HOME}/.nice_home")"
[ -e "${ENV_PATH}/.nice_home" ] && NICE_HOME="$(cat "${ENV_PATH}/.nice_home")"
export NICE_HOME
# shellcheck disable=SC1090
. "$DOTFILES_PATH/bin/paths"