Compare commits
3 Commits
20a3911ab7
...
acfd0cdee4
Author | SHA1 | Date | |
---|---|---|---|
acfd0cdee4 | |||
4561adf530 | |||
a7a8d7da8f |
@ -15,29 +15,46 @@ elif which xclip &> /dev/null; then
|
||||
fi
|
||||
|
||||
# Abstract different ways to paste from the clipboard.
|
||||
# TODO: Use OSC-52 to get the clipboard, not widely supported though
|
||||
if [ "`uname`" = "Darwin" ]; then
|
||||
# Use pbpaste to get the clipboard
|
||||
alias paste='pbpaste'
|
||||
elif which xclip &> /dev/null; then
|
||||
# Use xclip to get the clipboard
|
||||
alias paste='xclip -selection c -o'
|
||||
fi
|
||||
|
||||
# Passthrough an escape sequences tmux doesn't know about.
|
||||
tmux-dcs-passthrough() {
|
||||
if [ -n "$TMUX" ]; then
|
||||
printf "\x1bPtmux;\x1b$1\x1b\\"
|
||||
else
|
||||
printf "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# OSC 9 - Post a notification - supported by iTerm2, maybe others?
|
||||
notify() {
|
||||
tmux-dcs-passthrough "\x1b]9;$*\x7"
|
||||
}
|
||||
|
||||
# Detect the type and extract an archive file.
|
||||
extract() {
|
||||
if [ -f $1 ]; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xvjf $1 ;;
|
||||
*.tar.gz) tar xvzf $1 ;;
|
||||
*.tar.xz) gunzip $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) unrar x $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xvf $1 ;;
|
||||
*.tbz2) tar xvjf $1 ;;
|
||||
*.tgz) tar xvzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7zr x $1 ;;
|
||||
*) echo "$fg[red]error:$reset_color unable to extract '$1'" ;;
|
||||
*.tar.bz2) tar xvjf $1 ;;
|
||||
*.tar.gz) tar xvzf $1 ;;
|
||||
*.tar.xz) [ `"uname"` = "Darwin" ] && tar xvJf $1 || gunzip $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) unrar x $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xvf $1 ;;
|
||||
*.tbz2) tar xvjf $1 ;;
|
||||
*.tgz) tar xvzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7zr x $1 ;;
|
||||
*) echo "$fg[red]error:$reset_color unable to extract '$1'" ;;
|
||||
esac
|
||||
else
|
||||
echo "$fg[red]error:$reset_color file not found '$1'"
|
||||
|
1
zshenv
1
zshenv
@ -81,6 +81,7 @@ which pinentry-curses &> /dev/null && \
|
||||
export LPASS_PINENTRY=pinentry-curses
|
||||
|
||||
# Teach these some XDG Base Directory Spec manners
|
||||
export IPYTHONDIR=$HOME/.config/ipython
|
||||
which cargo &> /dev/null && \
|
||||
export CARGO_HOME=$HOME/.local/share/cargo
|
||||
if which ccache &> /dev/null; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user