Add xdg base directory spec

main
Buddy Sandidge 6 years ago
parent c9fc813e19
commit a60b752614

@ -36,6 +36,3 @@ fi
if [ "$TERM" == xterm ]; then if [ "$TERM" == xterm ]; then
export TERM=xterm-256color export TERM=xterm-256color
fi fi
[[ -f ~/.nvm/nvm.sh ]] && source ~/.nvm/nvm.sh
[[ -r $NVM_DIR/bash_completion ]] && source $NVM_DIR/bash_completion

@ -1,31 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
function min-jpg { function min-jpg {
tmpfile=$(mktemp) tmpfile="$(mktemp)"
ogfile="$1" ogfile="$1"
jpegtran -optimize -perfect -outfile $tmpfile $ogfile jpegtran -optimize -perfect -outfile "$tmpfile" "$ogfile"
mv $tmpfile $ogfile mv "$tmpfile" $ogfile
} }
function min-png { function min-png {
tmpfile=$(mktemp) tmpfile="$(mktemp)"
ogfile="$1" ogfile="$1"
pngcrush -rem alla -reduce -brute $ogfile $tmpfile pngcrush -rem alla -reduce -brute "$ogfile" "$tmpfile"
mv $tmpfile $ogfile mv "$tmpfile" "$ogfile"
}
function parse_git_status {
if [[ $(git status 2> /dev/null | wc -l) -eq 0 ]]; then
return
fi
if [[ $(git status 2> /dev/null | grep -E "working tree|directory clean" | wc -l) -eq 0 ]]; then
echo ' ∓'
fi
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
} }
function get-create-date { function get-create-date {
@ -42,16 +28,3 @@ function add-date-prefix {
function get-bitrate { function get-bitrate {
exiftool -AudioBitrate "$1" | awk '{print $4}' exiftool -AudioBitrate "$1" | awk '{print $4}'
} }
function _hostname-color {
case "$(whoami)" in
william) echo $blue;;
buddy) echo $blue;;
root) echo $bred;;
*) echo $purple;;
esac
}
function _hostname-show {
hostname -s | tr '[A-Z]' '[a-z]'
}

@ -15,3 +15,30 @@ PS1="$PS1\[$yellow\]"'$(parse_git_status) '
PS1="$PS1\[$purple\]\D{%F %I:%M%P} " PS1="$PS1\[$purple\]\D{%F %I:%M%P} "
# display date # display date
PS1="$PS1\[$color_off\]\nλ " PS1="$PS1\[$color_off\]\nλ "
function parse_git_status {
if [[ $(git status 2> /dev/null | wc -l) -eq 0 ]]; then
return
fi
if [[ $(git status 2> /dev/null | grep -E "working tree|directory clean" | wc -l) -eq 0 ]]; then
echo ' ∓'
fi
}
function _hostname-color {
case "$(whoami)" in
william) echo $blue;;
buddy) echo $blue;;
root) echo $bred;;
*) echo $purple;;
esac
}
function _hostname-show {
hostname -s | tr '[A-Z]' '[a-z]'
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}

@ -1,18 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
export LANGUAGE="en_US:en" export LANGUAGE="en_US:en"
export LC_MESSAGES="en_US.UTF-8" export LC_MESSAGES="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8" export LC_COLLATE="en_US.UTF-8"
# Load RVM into a shell session *as a function* export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:="$HOME/.config"}
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" export XDG_CACHE_HOME=${XDG_CACHE_HOME:="$HOME/.cache"}
export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"}
[[ -f ~/.nvm/nvm.sh ]] && source ~/.nvm/nvm.sh
[[ -r $NVM_DIR/bash_completion ]] && source $NVM_DIR/bash_completion

Loading…
Cancel
Save