quickwrite bash functions using sops
This commit is contained in:
parent
a6dcb43c60
commit
45ddefb2f6
1 changed files with 17 additions and 17 deletions
34
.bashrc
34
.bashrc
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
# Check if the shell is non-interactive
|
# Check if the shell is non-interactive
|
||||||
if [[ $- != *i* ]]; then
|
if [[ $- != *i* ]]; then
|
||||||
# Shell is non-interactive. Be done now!
|
# Shell is non-interactive. Be done now!
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ignore duplicate commands and commands starting with a space for Bash history
|
# Ignore duplicate commands and commands starting with a space for Bash history
|
||||||
|
@ -24,14 +24,14 @@ shopt -s cmdhist
|
||||||
|
|
||||||
# enable color support of ls and also add handy aliases
|
# enable color support of ls and also add handy aliases
|
||||||
if [ -x /usr/bin/dircolors ]; then
|
if [ -x /usr/bin/dircolors ]; then
|
||||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||||
alias ls='ls --color=auto'
|
alias ls='ls --color=auto'
|
||||||
alias dir='dir --color=auto'
|
alias dir='dir --color=auto'
|
||||||
alias vdir='vdir --color=auto'
|
alias vdir='vdir --color=auto'
|
||||||
|
|
||||||
alias grep='grep --color=auto'
|
alias grep='grep --color=auto'
|
||||||
alias fgrep='fgrep --color=auto'
|
alias fgrep='fgrep --color=auto'
|
||||||
alias egrep='egrep --color=auto'
|
alias egrep='egrep --color=auto'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# some ls aliases
|
# some ls aliases
|
||||||
|
@ -39,21 +39,21 @@ alias ll='ls -alF'
|
||||||
alias la='ls -A'
|
alias la='ls -A'
|
||||||
alias l='ls -CF'
|
alias l='ls -CF'
|
||||||
|
|
||||||
# IP
|
|
||||||
alias ipme='wget -qO - icanhazip.com'
|
|
||||||
alias speedtest='wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip'
|
|
||||||
|
|
||||||
# Bash Prompt
|
|
||||||
PS1="\[\033[35m\]\t\[\033[m\]-\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[31;1m\]\w\[\033[m\]\$ "
|
PS1="\[\033[35m\]\t\[\033[m\]-\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[31;1m\]\w\[\033[m\]\$ "
|
||||||
|
|
||||||
# Export environmental variables
|
# Export environmental variables
|
||||||
export EDITOR=vim
|
export EDITOR=nvim
|
||||||
export VISUAL=vim
|
export VISUAL=nvim
|
||||||
export BROWSER=firefox
|
export BROWSER=firefox
|
||||||
|
|
||||||
# Source external file
|
# Source external file
|
||||||
if [[ -f ~/.customrc ]]; then
|
if [[ -f ~/.customrc ]]; then
|
||||||
. ~/.customrc
|
. ~/.customrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bash ~/.motd
|
bash ~/.motd
|
||||||
|
|
||||||
|
# quick writing funcs
|
||||||
|
function unlock() { export SOPS_AGE_KEY=$(age -d ${HOME}/.age/privkey.age); }
|
||||||
|
function write() { SOPS_AGE_KEY=${SOPS_AGE_KEY} sops $1; }
|
||||||
|
function j() { SOPS_AGE_KEY=${SOPS_AGE_KEY} sops ${HOME}/journal/$(date +%Y%m%d).txt; }
|
||||||
|
|
Loading…
Reference in a new issue