Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
112 lines (96 sloc) 3.05 KB
# Created by newuser for 5.0.7
autoload -U compinit promptinit
compinit
promptinit
prompt walters
setopt completealiases
setopt nohashdirs
setopt transientrprompt
setopt AUTO_CD
setopt AUTO_PUSHD
setopt PUSHD_SILENT
setopt NUMERIC_GLOB_SORT
setopt EXTENDED_GLOB
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_DUPS
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# AUTOCOLOR
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias diff='colordiff' # requires colordiff package
# MODIFIED COMMANDS
alias bc='bc -l'
alias make='make -j8'
alias htop='htop -d10'
alias feeds='newsbeuter -r'
alias ssh-scan='nmap -p 22 --open -sV 192.168.1.0/24'
alias temp='watch --interval 1 sensors'
alias ..='cd ..'
alias df='df -h'
alias mkdir='mkdir -p -v'
alias ocean='play -n -n --combine merge synth pinknoise band -n 1200 1800 tremolo 50 10 tremolo 0.14 70 tremolo 0.2 50'
alias cd-rip='rip cd rip -U -O /tmp/morituri --track-template="%t - %n" --disc-template=%d'
function sed-rename()
{
for i in ${@:2}
do
mv "$i" "$(sed "$1" <<< "$i")"
done
}
function resample ()
{
sox -q --buffer 8096 -G "$1" -c 2 -b 16 "$2" rate -v 44100 dither -a
}
im-scale()
{
convert -colorspace sRGB +sigmoidal-contrast 6.5,50% -filter LanczosSharp -distort Resize "$3" -sigmoidal-contrast 6.5,50% -colorspace sRGB -quality 100 "$1" "$2"
}
im-compare()
{
compare -metric PSNR "$1" "$2" /dev/null
}
ffmpeg-compare()
{
ffmpeg -i "$1" -i "$2" -lavfi "psnr; [0:v][1:v]ssim" -f NULL /dev/null 2>&1 | tail -n2
}
function flac_to_webm()
{
ffmpeg -i "$1" -i "$2" -c:v libvpx-vp9 -crf 10 -pix_fmt yuv420p -vf "sws_flags=lanczos; scale=255:-1" -c:a libopus -ar 48000 -ac 2 -compression_level 10 -b:a 96K "${1%.*}.webm"
}
function xztar()
{
tar cf - "$1" | xz -v -T 0 -f - > "$1".tar.xz
}
function optijpeg()
{
/opt/mozjpeg/bin/jpegtran -progressive -optimize -copy none -outfile "$1" "$1"
}
function l()
{
"$@" | less -r
}
# EXPORTS
export EDITOR=nano
HISTSIZE=2000
SAVEHIST=2000
HISTFILE=~/.zsh_history
autoload zkbd
source ~/.zkbd/rxvt-unicode-256color-:0
[[ -n ${key[Backspace]} ]] && bindkey "${key[Backspace]}" backward-delete-char
[[ -n ${key[Insert]} ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n ${key[PageUp]} ]] && bindkey "${key[PageUp]}" up-line-or-history
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
[[ -n ${key[PageDown]} ]] && bindkey "${key[PageDown]}" down-line-or-history
[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
[[ -n ${key[Left]} ]] && bindkey "${key[Left]}" backward-char
[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
[[ -n ${key[Right]} ]] && bindkey "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" history-beginning-search-backward
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" history-beginning-search-forward
# | type style
if [ $TERM = "rxvt-unicode-256color" ]
then
echo -e -n "\x1b[\x35 q"
fi
Something went wrong with that request. Please try again.