Allow .profile to load multiple config files
• set environment variables in .profile load • move bash settings to be in profile if they are for POSIX (sh/zsh/etc) • use .d files in bash customizationsmain
parent
a3ab0c407f
commit
d1090feefe
@ -0,0 +1,7 @@
|
||||
#shellcheck disable=SC2034
|
||||
EDITOR=vim
|
||||
BROWSER=firefox
|
||||
PATH="${XDG_BIN_HOME}:${PATH}"
|
||||
HISTCONTROL=ignoredups:erasedups:ignorespace
|
||||
HISTFILESIZE=
|
||||
HISTSIZE=
|
@ -0,0 +1,24 @@
|
||||
#ft=sh
|
||||
|
||||
add_date_prefix () {
|
||||
DIR=$(dirname "$1")
|
||||
FILE=$(basename "$1")
|
||||
DATE=$(date -r "$1" +"%F")
|
||||
if [ ! -f "$1" ] ; then
|
||||
echo "unknown file: $1"
|
||||
return
|
||||
fi
|
||||
mv "$1" "$DIR/${DATE}_${FILE}"
|
||||
}
|
||||
|
||||
get_bitrate () {
|
||||
if [ ! -f "$1" ] ; then
|
||||
echo "[ERROR] unknown file: $1"
|
||||
return
|
||||
fi
|
||||
if ! command -v exiftool > /dev/null ; then
|
||||
echo "[ERROR] exiftool not installed"
|
||||
return
|
||||
fi
|
||||
exiftool -AudioBitrate "$1" | awk '{print $4}'
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
#ft=bash
|
||||
alias ll='ls -alF'
|
||||
alias curl='curl --proto-default https --silent '
|
||||
|
@ -0,0 +1,18 @@
|
||||
#ft=bash
|
||||
|
||||
# Disable capslock
|
||||
if [[ -x $(which setxkbmap) ]] && [[ $(uname) == Linux ]]; then
|
||||
setxkbmap -option ctrl:nocaps
|
||||
fi
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
if [ -x /usr/bin/lesspipe ]; then
|
||||
eval "$(SHELL=/bin/sh lesspipe)"
|
||||
fi
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
if test -r ~/.dircolors ; then
|
||||
eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
fi
|
||||
fi
|
@ -0,0 +1,11 @@
|
||||
#ft=bash
|
||||
if [[ ! "${BASH_VERSION}" = "3.2*" ]]; then
|
||||
shopt -s autocd
|
||||
fi
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
@ -0,0 +1,3 @@
|
||||
#shellcheck disable=SC2034
|
||||
HISTTIMEFORMAT='%y-%m-%d %T λ '
|
||||
QUOTING_STYLE=literal
|
@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export EDITOR=vim
|
||||
export BROWSER=firefox
|
||||
|
||||
export HISTCONTROL=ignoredups:erasedups:ignorespace
|
||||
export HISTFILESIZE=
|
||||
export HISTSIZE=
|
||||
export HISTTIMEFORMAT='%y-%m-%d %T λ '
|
||||
|
||||
# QUOTING_STYLE so ls does not
|
||||
export QUOTING_STYLE=literal
|
||||
export RIPGREP_CONFIG_PATH="${XDG_CONFIG_HOME}/ripgrep/config"
|
@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function add-path {
|
||||
dir="$1"
|
||||
if [[ $PATH =~ $dir ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ -d $dir ]]; then
|
||||
PATH=$dir:$PATH
|
||||
fi
|
||||
}
|
||||
|
||||
function prefix-path {
|
||||
dir="$1"
|
||||
if [[ $PATH =~ $dir ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ -d $dir ]]; then
|
||||
PATH=$PATH:$dir
|
||||
fi
|
||||
}
|
||||
|
||||
add-path /usr/local/go/bin
|
||||
add-path ~/.bin
|
||||
add-path ~/.cargo/bin
|
||||
add-path ~/.deno/bin
|
||||
prefix-path ~/.local/bin
|
||||
add-path ~/bin
|
||||
add-path ~/go/bin
|
||||
add-path ~/opt/bin
|
||||
|
||||
# work
|
||||
add-path ~/.rbenv/shims
|
||||
add-path /usr/local/opt/mysql-client/bin
|
||||
add-path ~/google-cloud-sdk/bin/
|
||||
|
||||
unset -f add-path
|
||||
unset -f prefix-path
|
@ -0,0 +1 @@
|
||||
PATH="${PATH}:${HOME}/.deno/bin"
|
@ -0,0 +1,6 @@
|
||||
if [ -d /usr/local/go/bin ] ; then
|
||||
PATH="${PATH}:/usr/local/go/bin"
|
||||
fi
|
||||
if [ -d "${HOME}/go/bin" ] ; then
|
||||
PATH="${PATH}:${HOME}/go/bin"
|
||||
fi
|
@ -1,5 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2034
|
||||
BASH_SILENCE_DEPRECATION_WARNING=1
|
||||
GOPRIVATE=github.com/HelloTech
|
||||
GO_TEST=gotest
|
||||
PATH="${PATH}:${HOME}/.rbenv/shims:/usr/local/opt/mysql-client/bin:${HOME}/google-cloud-sdk/bin"
|
||||
|
@ -0,0 +1,3 @@
|
||||
# shellcheck disable=SC2034
|
||||
GOPRIVATE=github.com/HelloTech
|
||||
GO_TEST=gotest
|
@ -0,0 +1,2 @@
|
||||
#shellcheck disable=SC2034
|
||||
RIPGREP_CONFIG_PATH="${XDG_CONFIG_HOME}/ripgrep/config"
|
@ -0,0 +1 @@
|
||||
PATH="${PATH}:${HOME}/.cargo/bin"
|
Loading…
Reference in New Issue