Move most exports from shrc to profile
This commit is contained in:
parent
62d6db7ce3
commit
1d656e8bd8
2 changed files with 53 additions and 50 deletions
|
@ -1,9 +1,51 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
export ANSIBLE_NOCOWS=1
|
||||||
export BLOCKSIZE=K
|
export BLOCKSIZE=K
|
||||||
export EDITOR=vi
|
export EDITOR=vi
|
||||||
export ENV="$HOME/.shrc"
|
export ENV="$HOME/.shrc"
|
||||||
|
export HISTCONTROL=ignorespace:ignoredups
|
||||||
export LANG=C
|
export LANG=C
|
||||||
export PAGER=less
|
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)" ]
|
if [ -r "$HOME/.profile.$(hostname -s)" ]
|
||||||
then
|
then
|
||||||
|
|
|
@ -24,16 +24,10 @@ fi
|
||||||
|
|
||||||
# Set up XDG variables. See:
|
# Set up XDG variables. See:
|
||||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
|
if [ ! -d "$XDG_DATA_HOME" ] ; then install -d -m 0700 "$XDG_DATA_HOME" ; fi
|
||||||
export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/etc/xdg}
|
if [ ! -d "$XDG_CACHE_HOME" ] ; then install -d -m 0700 "$XDG_CACHE_HOME" ; fi
|
||||||
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
if [ ! -d "$XDG_CONFIG_HOME" ] ; then install -d -m 0700 "$XDG_CONFIG_HOME" ; fi
|
||||||
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
if [ ! -d "$XDG_STATE_HOME" ] ; then install -d -m 0700 "$XDG_STATE_HOME" ; fi
|
||||||
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 "$HOME/.local/bin" ] ; then install -d -m 0700 "$HOME/.local/bin" ; fi
|
if [ ! -d "$HOME/.local/bin" ] ; then install -d -m 0700 "$HOME/.local/bin" ; fi
|
||||||
|
|
||||||
_acp_add_path () {
|
_acp_add_path () {
|
||||||
|
@ -70,34 +64,16 @@ done
|
||||||
|
|
||||||
umask 0022
|
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.
|
# 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 PS1="${PS1:-\$\ }"
|
||||||
export PYTHONWARNINGS=ignore::UserWarning
|
export TIME_STYLE=long-iso # Used by GNU 'ls'.
|
||||||
|
|
||||||
if [ "$(uname -s)" = Darwin ]
|
if [ "$(uname -s)" = Darwin ]
|
||||||
then
|
then
|
||||||
export BASH_SILENCE_DEPRECATION_WARNING=1
|
export BASH_SILENCE_DEPRECATION_WARNING=1
|
||||||
fi
|
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"
|
export LIBVIRT_DEFAULT_URI="qemu+ssh://vmhost/system"
|
||||||
|
|
||||||
if test -x /usr/bin/tty
|
if test -x /usr/bin/tty
|
||||||
|
@ -115,11 +91,6 @@ else
|
||||||
export EDITOR=vi
|
export EDITOR=vi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${XDG_CURRENT_DESKTOP:-unknown}" = GNOME ]
|
|
||||||
then
|
|
||||||
export QT_FONT_DPI=72
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$(id -u)" -ne 0 ] && [ -x /usr/bin/dnf ]
|
if [ "$(id -u)" -ne 0 ] && [ -x /usr/bin/dnf ]
|
||||||
then
|
then
|
||||||
alias dnf="dnf --cacheonly --nogpgcheck"
|
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 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'
|
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 () {
|
mkcd () {
|
||||||
if [ $# -ne 1 ]
|
if [ $# -ne 1 ]
|
||||||
then
|
then
|
||||||
|
@ -236,11 +197,6 @@ then
|
||||||
ssh-add "$HOME/.ssh/id_ed25519"
|
ssh-add "$HOME/.ssh/id_ed25519"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bashrc.local" ]
|
|
||||||
then
|
|
||||||
. "${XDG_CONFIG_HOME:-$HOME/.config}/bashrc.local"
|
|
||||||
fi
|
|
||||||
|
|
||||||
usermotd () {
|
usermotd () {
|
||||||
if [ -n "$_acp_motd_shown" ]
|
if [ -n "$_acp_motd_shown" ]
|
||||||
then
|
then
|
||||||
|
@ -310,4 +266,9 @@ tlscheck () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ -r "$XDG_CONFIG_HOME/shrc.local" ]
|
||||||
|
then
|
||||||
|
. "$XDG_CONFIG_HOME/shrc.local"
|
||||||
|
fi
|
||||||
|
|
||||||
usermotd
|
usermotd
|
||||||
|
|
Loading…
Reference in a new issue