79 lines
2.8 KiB
Bash
79 lines
2.8 KiB
Bash
#!/bin/sh
|
|
# shellcheck disable=SC2155
|
|
|
|
export PROFILE_LOADED=true
|
|
|
|
export SHELL_CONFIG_DIR="${SHELL_CONFIG_DIR:-"${XDG_CONFIG_HOME:-"$HOME/.config"}/shell"}"
|
|
|
|
for f in "$SHELL_CONFIG_DIR/local/env" "$SHELL_CONFIG_DIR/env"; do
|
|
if test -f "$f"; then
|
|
. "$f"
|
|
fi
|
|
done
|
|
|
|
# Locales
|
|
export LC_ALL=en_US.UTF-8
|
|
export LANG=en_US.UTF-8
|
|
export LANGUAGE=en_US.UTF-8
|
|
|
|
# Remove programs from root of home directory
|
|
export XDG_CONFIG_HOME="$HOME/.config"
|
|
export XDG_DATA_HOME="$HOME/.local/share"
|
|
export XDG_CACHE_HOME="$HOME/.cache"
|
|
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
|
|
export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc"
|
|
#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs.
|
|
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
|
|
export LESSHISTFILE="-"
|
|
[ -f "$XDG_CONFIG_HOME/alsa/asoundrc" ] && export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc"
|
|
# export GNUPGHOME="${XDG_DATA_HOME:-$HOME/.local/share}/gnupg"
|
|
export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default"
|
|
export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi"
|
|
# export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
|
|
# export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android"
|
|
# export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo"
|
|
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
|
|
|
|
[ -f "$HOME/.cargo/env" ] && . "$HOME/.cargo/env"
|
|
|
|
# Other programs
|
|
export FZF_DEFAULT_OPTS="--layout=reverse --height 33%"
|
|
export LESS=-R
|
|
export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')"
|
|
export LESS_TERMCAP_md="$(printf '%b' '[1;36m')"
|
|
export LESS_TERMCAP_me="$(printf '%b' '[0m')"
|
|
export LESS_TERMCAP_so="$(printf '%b' '[01;44;33m')"
|
|
export LESS_TERMCAP_se="$(printf '%b' '[0m')"
|
|
export LESS_TERMCAP_us="$(printf '%b' '[1;32m')"
|
|
export LESS_TERMCAP_ue="$(printf '%b' '[0m')"
|
|
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
|
|
export VDPAU_DRIVER=va_gl # Fix steam remote play black screen
|
|
# shellcheck disable=SC2046
|
|
command -v dbus-launch > /dev/null && export $(dbus-launch)
|
|
|
|
|
|
|
|
# If running in a TTY…
|
|
if [ "$(tty | sed 's-[0-9]$--g')" = /dev/tty ]; then
|
|
export IS_TTY=true
|
|
|
|
# Change the prompt theme to one that doesn't use nerdfonts
|
|
export P10K_CONFIG_LOCATION="$HOME/.config/shell/p10k/simple.p10k.zsh"
|
|
|
|
echo
|
|
echo "Welcome home"
|
|
|
|
else
|
|
export IS_TTY=false
|
|
|
|
# gnome likes to reset the keymap settings I make and I hate it
|
|
# if… gnome is the desktop, the profile is unloaded, we are not in tmux, and gsettings is a valid command
|
|
if [ "$DESKTOP_SESSION" = "gnome" ] && [ -z "${PROFILE_LOADED+foo}" ] && [ -z "${TMUX+foo}" ] && command -v gsettings > /dev/null; then
|
|
(
|
|
sleep 1 &&
|
|
gsettings set org.gnome.desktop.input-sources xkb-options "['caps:escape', 'compose:sclk']"
|
|
) &
|
|
fi
|
|
fi
|
|
|
|
# vim:ft=sh:sw=3:ts=3:nospell
|