Re-organise shrc and export GPG_TTY
This commit is contained in:
parent
b522585dd1
commit
05f610d4cf
1 changed files with 48 additions and 45 deletions
|
@ -1,5 +1,43 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
PATH="/usr/sbin:/sbin:/usr/bin:/bin"
|
||||||
|
for dir in $HOME/bin \
|
||||||
|
$HOME/.cargo/bin \
|
||||||
|
$HOME/.gem/ruby/2.6.0/bin \
|
||||||
|
/usr/X11R7/bin \
|
||||||
|
/usr/X11R6/bin \
|
||||||
|
/usr/local/sbin \
|
||||||
|
/usr/local/bin \
|
||||||
|
/usr/pkg/sbin \
|
||||||
|
/usr/pkg/bin \
|
||||||
|
/usr/games \
|
||||||
|
/usr/local/heirloom-doctools/bin \
|
||||||
|
/usr/pkg/heirloom-doctools/bin \
|
||||||
|
/var/lib/snapd/snap/bin \
|
||||||
|
/app/bin \
|
||||||
|
/snap/bin \
|
||||||
|
; do
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
PATH="$PATH:$dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
export PATH
|
||||||
|
|
||||||
|
MANPATH="/usr/share/man"
|
||||||
|
for dir in $HOME/.local/share/man \
|
||||||
|
/usr/X11R6/man \
|
||||||
|
/usr/X11R7/man \
|
||||||
|
/usr/local/man \
|
||||||
|
/usr/pkg/man \
|
||||||
|
/usr/local/share/man \
|
||||||
|
/usr/local/heirloom-doctools/man \
|
||||||
|
; do
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
MANPATH="$MANPATH:$dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
export MANPATH
|
||||||
|
|
||||||
umask 0022
|
umask 0022
|
||||||
|
|
||||||
set -o emacs
|
set -o emacs
|
||||||
|
@ -31,14 +69,17 @@ export POWERSHELL_TELEMETRY_OPTOUT=1
|
||||||
export PYTHONWARNINGS="ignore::UserWarning"
|
export PYTHONWARNINGS="ignore::UserWarning"
|
||||||
|
|
||||||
PS1="$ "
|
PS1="$ "
|
||||||
if /bin/test -z "${HOST}"; then
|
if test -z "${HOST}"; then
|
||||||
HOST="$(hostname 2>/dev/null || cat /etc/hostname)"
|
HOST="$(hostname 2>/dev/null || cat /etc/hostname)"
|
||||||
fi
|
fi
|
||||||
if /bin/test $(id -u) -eq 0; then
|
if test $(id -u) -eq 0; then
|
||||||
export PS1="${HOST%%.*}# "
|
export PS1="${HOST%%.*}# "
|
||||||
else
|
else
|
||||||
export PS1="${HOST%%.*}$ "
|
export PS1="${HOST%%.*}$ "
|
||||||
fi
|
fi
|
||||||
|
if test -x /usr/bin/tty; then
|
||||||
|
export GPG_TTY=$(tty)
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$BASH" ]; then
|
if [ "$BASH" ]; then
|
||||||
shopt -s histappend
|
shopt -s histappend
|
||||||
|
@ -103,7 +144,7 @@ alias qemu-p3="qemu-system-i386 -machine pc,accel=kvm -cpu pentium3 -m 256 -vga
|
||||||
alias qemu-core2="qemu-system-x86_64 -machine q35,accel=kvm -cpu core2duo -m 2048 -vga qxl -usb -soundhw hda -nic none" # -nic user,model=e1000
|
alias qemu-core2="qemu-system-x86_64 -machine q35,accel=kvm -cpu core2duo -m 2048 -vga qxl -usb -soundhw hda -nic none" # -nic user,model=e1000
|
||||||
|
|
||||||
if [ ! -d "$HOME/.local/bin" ]; then
|
if [ ! -d "$HOME/.local/bin" ]; then
|
||||||
/bin/mkdir -p "$HOME/.local/bin"
|
mkdir -p "$HOME/.local/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Alias vi to vim if it is installed.
|
# Alias vi to vim if it is installed.
|
||||||
|
@ -115,10 +156,11 @@ fi
|
||||||
export GOPATH="$HOME/data/go"
|
export GOPATH="$HOME/data/go"
|
||||||
if [ -x /usr/bin/go ] || [ -x /usr/local/bin/go ]; then
|
if [ -x /usr/bin/go ] || [ -x /usr/local/bin/go ]; then
|
||||||
if [ ! -d "$GOPATH" ]; then
|
if [ ! -d "$GOPATH" ]; then
|
||||||
/bin/mkdir -p "$GOPATH/bin"
|
mkdir -p "$GOPATH/bin"
|
||||||
/bin/mkdir -p "$GOPATH/pkg"
|
mkdir -p "$GOPATH/pkg"
|
||||||
/bin/mkdir -p "$GOPATH/src"
|
mkdir -p "$GOPATH/src"
|
||||||
fi
|
fi
|
||||||
|
export PATH="$PATH:$GOPATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use a manually-installed ansible if available.
|
# Use a manually-installed ansible if available.
|
||||||
|
@ -133,45 +175,6 @@ alias prunx="podman run -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e DISPLAY=\"unix\$D
|
||||||
alias drun="sudo docker run --rm -it"
|
alias drun="sudo docker run --rm -it"
|
||||||
alias drunx="sudo docker run -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e DISPLAY=\"unix\$DISPLAY\""
|
alias drunx="sudo docker run -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e DISPLAY=\"unix\$DISPLAY\""
|
||||||
|
|
||||||
PATH="/usr/sbin:/sbin:/usr/bin:/bin"
|
|
||||||
for dir in $HOME/bin \
|
|
||||||
$GOPATH/bin \
|
|
||||||
$HOME/.cargo/bin \
|
|
||||||
$HOME/.gem/ruby/2.6.0/bin \
|
|
||||||
/usr/X11R7/bin \
|
|
||||||
/usr/X11R6/bin \
|
|
||||||
/usr/local/sbin \
|
|
||||||
/usr/local/bin \
|
|
||||||
/usr/pkg/sbin \
|
|
||||||
/usr/pkg/bin \
|
|
||||||
/usr/games \
|
|
||||||
/usr/local/heirloom-doctools/bin \
|
|
||||||
/usr/pkg/heirloom-doctools/bin \
|
|
||||||
/var/lib/snapd/snap/bin \
|
|
||||||
/app/bin \
|
|
||||||
/snap/bin \
|
|
||||||
; do
|
|
||||||
if [ -d "$dir" ]; then
|
|
||||||
PATH="$PATH:$dir"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
MANPATH="/usr/share/man"
|
|
||||||
for dir in $HOME/.local/share/man \
|
|
||||||
/usr/X11R6/man \
|
|
||||||
/usr/X11R7/man \
|
|
||||||
/usr/local/man \
|
|
||||||
/usr/pkg/man \
|
|
||||||
/usr/local/share/man \
|
|
||||||
/usr/local/heirloom-doctools/man \
|
|
||||||
; do
|
|
||||||
if [ -d "$dir" ]; then
|
|
||||||
MANPATH="$MANPATH:$dir"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
export MANPATH
|
|
||||||
|
|
||||||
mkcd () {
|
mkcd () {
|
||||||
if [ $# -ne 1 ]; then
|
if [ $# -ne 1 ]; then
|
||||||
echo "mkcd: incorrect arguments (one directory required)." >&2
|
echo "mkcd: incorrect arguments (one directory required)." >&2
|
||||||
|
|
Loading…
Reference in a new issue