.profile: Reorganize, compact license, etc.

This commit is contained in:
Salt 2019-07-10 04:31:05 -05:00
parent 6865ba8335
commit 68cde74a8b

View File

@ -1,24 +1,7 @@
#!/bin/sh
# Copyright (c) 2017 rehashedsalt/vintagesalt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Licensed under the terms of the MIT license
## POSIX NOTICE
# This script, or at least the parts expected to be run by a standard sh
@ -39,7 +22,6 @@
# shellcheck disable=1117
# Environment variables
# First, what shell are we?
_baseshell="$(basename -- "$0")"
# Patch PATH
@ -107,7 +89,7 @@ if has dircolors; then
fi
fi
# Set up editor aliases
# Set up our text editor
for editor in vim vi nano; do
if has "$editor"; then
export EDITOR="$editor"
@ -116,7 +98,12 @@ for editor in vim vi nano; do
done
alias e='$EDITOR'
# If emerge exists, add emerge aliases
# Now for a shitton of aliases
if ! has define; then
if has mate-dictionary; then
alias define='mate-dictionary -n --look-up'
fi
fi
if has emerge; then
alias e-depclean='sudo emerge -a --depclean'
alias e-inst='sudo emerge -a --jobs --tree --quiet-build y'
@ -128,8 +115,10 @@ if has emerge; then
alias e-cleanup='sudo eclean -d distfiles && sudo eclean -d packages'
fi
fi
# Sudo prompt and such
if has instantmusic; then
alias song='instantmusic -p -s'
alias songp='instantmusic -s'
fi
if has sudo; then
case $_baseshell in
*bash|*zsh)
@ -140,20 +129,7 @@ if has sudo; then
esac
fi
# If we have instantmusic, add aliases for that
if has instantmusic; then
alias song='instantmusic -p -s'
alias songp='instantmusic -s'
fi
# Dictionary aliases
if ! has define; then
if has mate-dictionary; then
alias define='mate-dictionary -n --look-up'
fi
fi
# Alias for my bare repo dotfile setup
# Dotfile management aliases
if [ -d "$HOME/.dotfiles" ]; then
dotcmd='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
alias dot="$dotcmd"
@ -187,11 +163,9 @@ else
alias ls="ls $lsarguments"
alias ll="ls -Ahl $lsarguments"
fi
# Miscellaneous aliases
alias cp='cp -i'
alias d='du -hs'
alias todo='$EDITOR "$HOME/Documents/todo"'
alias waitwhat='echo $?'
# Set up a default PS1
# This *should* work for all terminals. I know it works on ksh