(bash,tmux) replace stmux alias with function and auto add git key
This commit is contained in:
parent
1033a876c3
commit
01fe5cc1b7
1 changed files with 7 additions and 3 deletions
10
bash/bashrc
10
bash/bashrc
|
|
@ -8,9 +8,6 @@ alias ls='lsd'
|
|||
alias ll="lsd -AlF"
|
||||
alias la="lsd -A"
|
||||
|
||||
# Starts a new secure session with auto-wipe enabled
|
||||
alias stmux='ssh-agent tmux new-session \; set-hook client-detached "run-shell \"ssh-add -D\""'
|
||||
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
alias alert='notify-send --urgency=normal -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
|
@ -239,6 +236,13 @@ parse_git_branch() {
|
|||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
|
||||
}
|
||||
|
||||
# Starts a new secure session with auto-wipe enabled
|
||||
stmux() {
|
||||
ssh-agent sh -c "tmux new-session -s secure \
|
||||
\; set-hook client-detached \"run-shell 'SSH_AUTH_SOCK=\$SSH_AUTH_SOCK ssh-add -D'\" \
|
||||
\; send-keys \"ssh-add $GIT_KEY\" C-m"
|
||||
}
|
||||
|
||||
export GOPATH=$HOME/go
|
||||
export PATH=$PATH:$GOPATH:$GOPATH/bin:/usr/local/go/bin
|
||||
export EDITOR=nvim
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue