DSK: Update

This commit is contained in:
Salt 2018-11-22 02:24:19 -06:00
parent 7c9b378e29
commit caffa48a20
2 changed files with 29 additions and 15 deletions

2
.dsk

@ -1 +1 @@
Subproject commit 116ff5018765d157f522d5ae8674185e9152301a Subproject commit 2ba069edf111cbaf7a95b66b11d9ac046dec9a5a

View File

@ -25,10 +25,22 @@
# If it is not, open a bug report at gitlab.com/rehashedsalt/home and I'll take # If it is not, open a bug report at gitlab.com/rehashedsalt/home and I'll take
# care of it # care of it
# Not finding these sources is none of my concern; they're out of scope
# shellcheck disable=1091
# shellcheck disable=1090
# I'm well aware of when functions are defined vs used
# Those choices are deliberate
# shellcheck disable=2139
# shellcheck disable=2016
# Quit being pedantic
# shellcheck disable=1117
# Environment variables # Environment variables
# Use Vim if we have it # Use Vim if we have it
export EDITOR="vi" export EDITOR="vi"
which vim > /dev/null 2>&1 && export EDITOR="vim" command -v vim > /dev/null 2>&1 && export EDITOR="vim"
# Patch PATH # Patch PATH
desiredpath="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/games:/usr/games:$HOME/.bin:$HOME/.local/bin" desiredpath="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/games:/usr/games:$HOME/.bin:$HOME/.local/bin"
@ -50,21 +62,21 @@ PATH="$desiredpath:$PATH"
[ -f "/etc/profile.d/bash_completion.sh" ] && . "/etc/profile.d/bash_completion.sh" [ -f "/etc/profile.d/bash_completion.sh" ] && . "/etc/profile.d/bash_completion.sh"
# Grab pip completion, if it exists # Grab pip completion, if it exists
if which pip > /dev/null 2>&1; then if command -v pip > /dev/null 2>&1; then
case "$(basename "$SHELL")" in case "$(basename "$SHELL")" in
*bash) *bash)
if ! [ -f "$HOME/.pip-completion-bash" ]; then if ! [ -f "$HOME/.pip-completion-bash" ]; then
pip completion --bash > "$HOME/.pip-completion-bash" pip completion --bash > "$HOME/.pip-completion-bash"
echo ".profile: Created pip completion for bash" echo ".profile: Created pip completion for bash"
fi fi
source "$HOME/.pip-completion-bash" . "$HOME/.pip-completion-bash"
;; ;;
zsh) zsh)
if ! [ -f "$HOME/.pip-completion-zsh" ]; then if ! [ -f "$HOME/.pip-completion-zsh" ]; then
pip completion --zsh > "$HOME/.pip-completion-zsh" pip completion --zsh > "$HOME/.pip-completion-zsh"
echo ".profile: Created pip completion for zsh" echo ".profile: Created pip completion for zsh"
fi fi
source "$HOME/.pip-completion-zsh" . "$HOME/.pip-completion-zsh"
;; ;;
*) *)
;; ;;
@ -72,20 +84,20 @@ if which pip > /dev/null 2>&1; then
fi fi
# If emerge exists, add emerge aliases # If emerge exists, add emerge aliases
if which emerge > /dev/null 2>&1 ; then if command -v emerge > /dev/null 2>&1 ; then
alias e-depclean='sudo emerge -a --depclean' alias e-depclean='sudo emerge -a --depclean'
alias e-inst='sudo emerge -a --jobs --tree --quiet-build y' alias e-inst='sudo emerge -a --jobs --tree --quiet-build y'
alias e-upgrade='sudo emerge -DNUua --jobs --tree --quiet-build y --with-bdeps=y --keep-going --backtrack=1000 @world' alias e-upgrade='sudo emerge -DNUua --jobs --tree --quiet-build y --with-bdeps=y --keep-going --backtrack=1000 @world'
alias e-newuse='sudo emerge -Uva --jobs --tree --quiet-build y @world' alias e-newuse='sudo emerge -Uva --jobs --tree --quiet-build y @world'
alias e-search='emerge -s' alias e-search='emerge -s'
alias e-sync='sudo emerge --sync' alias e-sync='sudo emerge --sync'
if which eclean > /dev/null 2>&1; then if command -v eclean > /dev/null 2>&1; then
alias e-cleanup='sudo eclean -d distfiles && sudo eclean -d packages' alias e-cleanup='sudo eclean -d distfiles && sudo eclean -d packages'
fi fi
fi fi
# If we have instantmusic, add aliases for that # If we have instantmusic, add aliases for that
if which instantmusic > /dev/null 2>&1; then if command -v instantmusic > /dev/null 2>&1; then
alias song='instantmusic -p -s' alias song='instantmusic -p -s'
alias songp='instantmusic -s' alias songp='instantmusic -s'
fi fi
@ -105,7 +117,7 @@ if [ -d "$HOME/.dotfiles" ]; then
fi fi
# Aliases for common utilities # Aliases for common utilities
if [ "`uname`" = "Linux" ]; then if [ "$(uname)" = "Linux" ]; then
# Assume we have GNU coreutils # Assume we have GNU coreutils
lsarguments='--color=auto --group-directories-first' lsarguments='--color=auto --group-directories-first'
alias l="ls -CF --file-type $lsarguments" alias l="ls -CF --file-type $lsarguments"
@ -135,11 +147,9 @@ alias waitwhat='echo $?'
# Set up a default PS1 # Set up a default PS1
# This *should* work for all terminals. I know it works on ksh # This *should* work for all terminals. I know it works on ksh
function _ps1() { _ps1() {
exitcode="$?" exitcode="$?"
r="\e[0m" r="\e[0m"
fg_blue="\e[34m"
fg_cyan="\e[36m"
fg_red="\e[31m" fg_red="\e[31m"
fg_green="\e[32m" fg_green="\e[32m"
fg_yellow="\e[33m" fg_yellow="\e[33m"
@ -148,10 +158,10 @@ function _ps1() {
# Add hostname prefix in SSH sessions # Add hostname prefix in SSH sessions
if [ "$SSH_CLIENT" ]; then if [ "$SSH_CLIENT" ]; then
prefix="${fg_bold}${fg_red}`hostname`${r}${fg_red}:" prefix="${fg_bold}${fg_red}$(hostname)${r}${fg_red}:"
fi fi
# Append a "restricted" prefix in rbash # Append a "restricted" prefix in rbash
if [ "$0" == "rbash" ]; then if [ "$0" = "rbash" ]; then
prefix="${fg_bold}${fg_grey}rbash${r}:" prefix="${fg_bold}${fg_grey}rbash${r}:"
fi fi
# Change PWD color depending on the shell # Change PWD color depending on the shell
@ -175,11 +185,15 @@ function _ps1() {
if ! [ "$exitcode" = "0" ]; then if ! [ "$exitcode" = "0" ]; then
fail="${fg_bold}${fg_red}?" fail="${fg_bold}${fg_red}?"
fi fi
# printf is used here less for its C-like arguments and more becasue
# POSIX echo doesn't have an option to not print a newline.
# Hence this warning is disabled
# shellcheck disable=2059
printf "[${prefix}${cpwd}${r}]${fail}${r}${fg_green}\$${r} " printf "[${prefix}${cpwd}${r}]${fail}${r}${fg_green}\$${r} "
} }
if ! [ "$ZSH_NAME" ]; then if ! [ "$ZSH_NAME" ]; then
# I've got a different ZSH theme # I've got a different ZSH theme
export PS1='`_ps1`' export PS1='$(_ps1)'
fi fi