Move most exports from shrc to profile

This commit is contained in:
Anthony Rose 2022-08-23 13:44:31 +01:00
parent 62d6db7ce3
commit 1d656e8bd8
2 changed files with 53 additions and 50 deletions

View file

@ -1,9 +1,51 @@
#!/bin/sh
export ANSIBLE_NOCOWS=1
export BLOCKSIZE=K
export EDITOR=vi
export ENV="$HOME/.shrc"
export HISTCONTROL=ignorespace:ignoredups
export LANG=C
export PAGER=less
export PAPERSIZE=a4
export POWERSHELL_TELEMETRY_OPTOUT=1
export PS1="${PS1:-\$\ }"
export PYTHONWARNINGS=ignore::UserWarning
# Set up XDG variables. See:
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/etc/xdg}
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
# Locale and language.
## Clear the existing locale settings and set options I always want.
export TZ=Europe/London # Can override this elsewhere if needed.
if [ -f /etc/locale.conf ]
then
/etc/locale.conf
fi
if [ -f "$XDG_CONFIG_HOME/locale.conf" ]
then
. "$XDG_CONFIG_HOME/locale.conf"
fi
if [ "${XDG_CURRENT_DESKTOP:-unknown}" = GNOME ]
then
export QT_FONT_DPI=72
fi
# Desktop files (used by desktop environments within both X11 and Wayland) are
# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for
# snappy applications' desktop files.
_snap_xdg_path=/var/lib/snapd/desktop
if [ -n "${XDG_DATA_DIRS##*${_snap_xdg_path}}" ] && [ -n "${XDG_DATA_DIRS##*${_snap_xdg_path}:*}" ]
then
XDG_DATA_DIRS="${XDG_DATA_DIRS}:${_snap_xdg_path}"
fi
unset _snap_xdg_path
if [ -r "$HOME/.profile.$(hostname -s)" ]
then

View file

@ -24,16 +24,10 @@ fi
# Set up XDG variables. See:
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/etc/xdg}
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
if [ ! -d "$XDG_DATA_HOME" ] ; then install -d -m 0700 "$XDG_DATA_HOME" ; fi
if [ ! -d "$XDG_CACHE_HOME" ] ; then install -d -m 0700 "$XDG_CACHE_HOME" ; fi
if [ ! -d "$XDG_CONFIG_HOME" ] ; then install -d -m 0700 "$XDG_CONFIG_HOME" ; fi
if [ ! -d "$XDG_STATE_HOME" ] ; then install -d -m 0700 "$XDG_STATE_HOME" ; fi
if [ ! -d "$XDG_DATA_HOME" ] ; then install -d -m 0700 "$XDG_DATA_HOME" ; fi
if [ ! -d "$XDG_CACHE_HOME" ] ; then install -d -m 0700 "$XDG_CACHE_HOME" ; fi
if [ ! -d "$XDG_CONFIG_HOME" ] ; then install -d -m 0700 "$XDG_CONFIG_HOME" ; fi
if [ ! -d "$XDG_STATE_HOME" ] ; then install -d -m 0700 "$XDG_STATE_HOME" ; fi
if [ ! -d "$HOME/.local/bin" ] ; then install -d -m 0700 "$HOME/.local/bin" ; fi
_acp_add_path () {
@ -70,34 +64,16 @@ done
umask 0022
# Locale and language.
## Clear the existing locale settings and set options I always want.
export TIME_STYLE=long-iso # Used by GNU 'ls'.
export TZ=Europe/London # Can override this elsewhere if needed.
if [ -f /etc/locale.conf ]
then
. /etc/locale.conf
fi
if [ -f "$XDG_CONFIG_HOME/locale.conf" ]
then
. "$XDG_CONFIG_HOME/locale.conf"
fi
# Other exports.
export ANSIBLE_NOCOWS=1
export EDITOR=vi
export HISTCONTROL=ignorespace:ignoredups
export PAPERSIZE=a4
export POWERSHELL_TELEMETRY_OPTOUT=1
export PS1="${PS1:-\$\ }"
export PYTHONWARNINGS=ignore::UserWarning
export TIME_STYLE=long-iso # Used by GNU 'ls'.
if [ "$(uname -s)" = Darwin ]
then
export BASH_SILENCE_DEPRECATION_WARNING=1
fi
# Override this in ~/.config/bashrc or ~/.ssh/config.
# Override this in "$XDG_CONFIG_HOME/shrc.local" or "$HOME/.ssh/config".
export LIBVIRT_DEFAULT_URI="qemu+ssh://vmhost/system"
if test -x /usr/bin/tty
@ -115,11 +91,6 @@ else
export EDITOR=vi
fi
if [ "${XDG_CURRENT_DESKTOP:-unknown}" = GNOME ]
then
export QT_FONT_DPI=72
fi
if [ "$(id -u)" -ne 0 ] && [ -x /usr/bin/dnf ]
then
alias dnf="dnf --cacheonly --nogpgcheck"
@ -175,16 +146,6 @@ fi
alias prun='podman run --rm --interactive --tty --security-opt label=disable --volume "$HOME":"$HOME" --volume "$XDG_RUNTIME_DIR":"$XDG_RUNTIME_DIR" --env XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" --env XDG_SESSION_TYPE=wayland --ipc host'
alias pruncerts='prun --volume /etc/pki/ca-trust:/etc/pki/ca-trust:ro --volume /etc/ssl/certs:/etc/ssl/certs:ro'
# Desktop files (used by desktop environments within both X11 and Wayland) are
# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for
# snappy applications' desktop files.
_snap_xdg_path=/var/lib/snapd/desktop
if [ -n "${XDG_DATA_DIRS##*${_snap_xdg_path}}" ] && [ -n "${XDG_DATA_DIRS##*${_snap_xdg_path}:*}" ]
then
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${_snap_xdg_path}"
fi
unset _snap_xdg_path
mkcd () {
if [ $# -ne 1 ]
then
@ -236,11 +197,6 @@ then
ssh-add "$HOME/.ssh/id_ed25519"
fi
if [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bashrc.local" ]
then
. "${XDG_CONFIG_HOME:-$HOME/.config}/bashrc.local"
fi
usermotd () {
if [ -n "$_acp_motd_shown" ]
then
@ -310,4 +266,9 @@ tlscheck () {
fi
}
if [ -r "$XDG_CONFIG_HOME/shrc.local" ]
then
. "$XDG_CONFIG_HOME/shrc.local"
fi
usermotd