Cleaning up zsh startup files
This commit is contained in:
parent
e6886b6fc4
commit
cbc9ea92c0
32
zprofile
32
zprofile
|
@ -1,13 +1,6 @@
|
||||||
# General
|
# -*- sh -*-
|
||||||
|
|
||||||
if [[ -x "/usr/bin/zsh" ]]; then
|
# General
|
||||||
SHELL=/usr/bin/zsh
|
|
||||||
elif [[ -x "/bin/zsh" ]]; then
|
|
||||||
SHELL=/bin/zsh
|
|
||||||
else
|
|
||||||
SHELL=/bin/bash
|
|
||||||
fi
|
|
||||||
export SHELL
|
|
||||||
|
|
||||||
umask 077
|
umask 077
|
||||||
|
|
||||||
|
@ -50,28 +43,25 @@ export LESS
|
||||||
|
|
||||||
eval "$(lesspipe)"
|
eval "$(lesspipe)"
|
||||||
|
|
||||||
export HISTSIZE=1000
|
# Other environment variables
|
||||||
export SAVEHIST=1000
|
|
||||||
export HIST_IGNORE_ALL_DUPS=1
|
|
||||||
export HISTFILE=~/.zsh_history
|
|
||||||
|
|
||||||
export PYTHONSTARTUP="${HOME}/.pythonrc"
|
export PYTHONSTARTUP="${HOME}/.pythonrc"
|
||||||
export WORKON_HOME=${HOME}/.local/share/virtualenvs/
|
export WORKON_HOME=${HOME}/.local/share/virtualenvs/
|
||||||
|
|
||||||
export PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig/
|
export PKG_CONFIG_PATH=${HOME}/.local/lib/pkgconfig/
|
||||||
export LD_LIBRARY_PATH=$HOME/.local/lib/
|
export LD_LIBRARY_PATH=${HOME}/.local/lib/
|
||||||
|
|
||||||
export TEXMFHOME=$HOME/Documents/texmf
|
export TEXMFHOME=${HOME}/Documents/texmf
|
||||||
export TEXMFOUTPUT=/tmp
|
export TEXMFOUTPUT=/tmp
|
||||||
|
|
||||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
||||||
export PERL5LIB="/home/exot/.local/share/perl5/lib/perl5"
|
export PERL5LIB="${HOME}/.local/share/perl5/lib/perl5"
|
||||||
export PERL_LOCAL_LIB_ROOT="/home/exot/.local/share/perl5/"
|
export PERL_LOCAL_LIB_ROOT="${HOME}/.local/share/perl5/"
|
||||||
export PERL_MB_OPT="--install_base \"/home/exot/.local/share/perl5/\""
|
export PERL_MB_OPT="--install_base \"${HOME}/.local/share/perl5/\""
|
||||||
export PERL_MM_OPT="INSTALL_BASE=/home/exot/.local/share/perl5/"
|
export PERL_MM_OPT="INSTALL_BASE=${HOME}/.local/share/perl5/"
|
||||||
|
|
||||||
export PATH="/home/exot/.local/share/perl5/bin:${HOME}/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/bin:/usr/sbin:/sbin:/usr/local/sbin"
|
export PATH="${HOME}/.local/share/perl5/bin:${HOME}/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/bin:/usr/sbin:/sbin:/usr/local/sbin"
|
||||||
export MANPATH="${PERL_LOCAL_LIB_ROOT}/man:${HOME}/.local/share/man:/usr/share/man"
|
export MANPATH="${PERL_LOCAL_LIB_ROOT}/man:${HOME}/.local/share/man:/usr/share/man"
|
||||||
export INFOPATH="/usr/share/info:${HOME}/.local/share/info/"
|
export INFOPATH="/usr/share/info:${HOME}/.local/share/info/"
|
||||||
|
|
||||||
|
|
84
zshrc
84
zshrc
|
@ -1,3 +1,5 @@
|
||||||
|
# -*- sh -*-
|
||||||
|
|
||||||
# Prompt
|
# Prompt
|
||||||
|
|
||||||
enable -r repeat
|
enable -r repeat
|
||||||
|
@ -40,6 +42,13 @@ export PS1="┌$RETURN_CODE$WHOAMI $CWD $VCS$JOBS%b
|
||||||
|
|
||||||
unset hostfg hostbg
|
unset hostfg hostbg
|
||||||
|
|
||||||
|
# History
|
||||||
|
|
||||||
|
HISTSIZE=30000
|
||||||
|
SAVEHIST=30000
|
||||||
|
HIST_IGNORE_ALL_DUPS=1
|
||||||
|
HISTFILE=~/.zsh_history
|
||||||
|
|
||||||
# Terminal
|
# Terminal
|
||||||
|
|
||||||
case "$TERM" in
|
case "$TERM" in
|
||||||
|
@ -56,57 +65,6 @@ case "$TERM" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Screen Title
|
|
||||||
|
|
||||||
termtitle() {
|
|
||||||
local title
|
|
||||||
|
|
||||||
title="$*"
|
|
||||||
|
|
||||||
case "${TERM}" in
|
|
||||||
screen*)
|
|
||||||
echo -en "\033k${title}\033\\"
|
|
||||||
;;
|
|
||||||
xterm|rxvt*)
|
|
||||||
echo -en "\033]2;${title}\a"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
preexec() {
|
|
||||||
last_command="$1"
|
|
||||||
|
|
||||||
if [[ "${TERM}" =~ "screen*" ]] ; then
|
|
||||||
termtitle "${last_command}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ ! "${TERM}" =~ "screen*" ]] ; then
|
|
||||||
termtitle "${USER}@${HOST}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
precmd() {
|
|
||||||
last_ret=$?
|
|
||||||
|
|
||||||
if [[ "${TERM}" =~ "screen*" ]] ; then
|
|
||||||
if [[ ${last_ret} -eq 0 ]] ; then
|
|
||||||
termtitle "[${last_command}]"
|
|
||||||
else
|
|
||||||
termtitle "[${last_ret} ${last_command}]"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# if no command is running set screen title to ($PWD)
|
|
||||||
chpwd() {
|
|
||||||
if [[ "${TERM}" =~ "screen*" ]] ; then
|
|
||||||
last_command="${PWD}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
last_command=$0
|
|
||||||
|
|
||||||
# Completion
|
# Completion
|
||||||
|
|
||||||
fpath=(~/.config/zsh/completion $fpath)
|
fpath=(~/.config/zsh/completion $fpath)
|
||||||
|
@ -147,19 +105,14 @@ do-startx() {
|
||||||
vlock
|
vlock
|
||||||
}
|
}
|
||||||
|
|
||||||
function new-ssh-key() {
|
|
||||||
rm -f ~/.ssh/$1 ~/.ssh/$1.pub
|
|
||||||
ssh-keygen -b 4096 -f ~/.ssh/$1
|
|
||||||
cat ~/.ssh/$1.pub | ssh $1 'cat > ~/.ssh/authorized_keys'
|
|
||||||
}
|
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
||||||
if ls --version | grep -q coreutils ; then
|
if ls --version | grep -q coreutils ; then
|
||||||
LS_COLORS=`dircolors -b | cut -s -d= -f2- | sed -e "s/'\(.*\)';/\1/"`
|
LS_COLORS=`dircolors -b | cut -s -d= -f2- | sed -e "s/'\(.*\)';/\1/"`
|
||||||
LS_OPTIONS+="--color=auto"
|
export LS_COLORS
|
||||||
LS_OPTIONS+="--file-type"
|
alias ls='ls --color=auto'
|
||||||
alias ls='ls --color=auto'
|
else
|
||||||
|
alias ls='ls --file-type'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
alias ll='ls -l'
|
alias ll='ls -l'
|
||||||
|
@ -181,8 +134,9 @@ alias grep="grep --color=auto --binary-files=without-match --exclude=.svn"
|
||||||
# Utility functions
|
# Utility functions
|
||||||
|
|
||||||
function encode-with-ffmpeg () {
|
function encode-with-ffmpeg () {
|
||||||
$movie = $1
|
$movie = $1
|
||||||
$output = $2
|
$output = $2
|
||||||
ffmpeg -y -i $movie -c:v libx264 -preset veryslow -b:v 630k -pass 1 -c:a aac -b:a 128k -f mp4 /dev/null && \
|
|
||||||
ffmpeg -i $movie -c:v libx264 -preset veryslow -b:v 630k -pass 2 -c:a aac -b:a 128k $output
|
ffmpeg -y -i $movie -c:v libx264 -preset veryslow -b:v 630k -pass 1 -c:a aac -b:a 128k -f mp4 /dev/null && \
|
||||||
|
ffmpeg -i $movie -c:v libx264 -preset veryslow -b:v 630k -pass 2 -c:a aac -b:a 128k $output
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue