view .zshalias @ 482:93ac94dc3feb

Updated config
author unexist
date Thu, 29 Nov 2018 09:25:32 +0100
parents cf2b9ea9e48a
children 42c6bdaeeeaa
line wrap: on
line source

#
# @file Zsh alias file
#
# @copyright (c) 2006-2018, Christoph Kappel <unexist@subforge.org>
# @version $Id: .zshalias,v 479 1543225000.0-3600 unexist $
#

# ls
alias ls='ls --color -phFX --group-directories-first'
alias la='ls -a'
alias ll='ls -l'
alias l='ls -l'

# Miscellaneous
alias q='clear && logout'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias grep='grep -nI --color'

# Security
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Sudo
if [ -e /usr/bin/sudo ] ; then
  alias halt="sudo /sbin/halt"
  alias reboot="sudo /sbin/reboot"
  alias killjobs="sudo lprm -"
  alias s="sudo"
  alias fuck='sudo $(fc -ln -1)'

  # Based on dist
  if [ -e /usr/bin/pacman ] ; then
    alias p="packer --noedit"
    alias I="sudo pacman -S"
    alias R="sudo pacman -R"
    alias S="pacman -Q"
  elif [ -e /usr/bin/apt-get ] ; then
    alias p="sudo apt-get"
    alias I="sudo apt-get install"
    alias R="sudo apt-get remove"
    alias S="apt-cache search"
    alias keptback="sudo apt-get --with-new-pkgs upgrade"
  fi
fi

# Valgrind
if [ -e /usr/bin/valgrind ] ; then
  alias memcheck="valgrind --tool=memcheck --leak-check=full --suppressions=$HOME/.suppressions"
  alias addrcheck="valgrind --tool=addrcheck --leak-check=full --suppressions=$HOME/.suppressions"
  alias sgcheck="valgrind --tool=exp-sgcheck"
fi

# Calc
if [ -e /usr/bin/concalc ] ; then
  alias calc='noglob concalc'
fi

# Mercurial
if [ -e /usr/bin/hg ] ; then
  alias hgs="hg status|grep -v '^?'"
fi

# Git
if [ -e /usr/bin/git ] ; then
  alias gits="git status|grep -v '^?'"
fi

# Mpd
if [ -e /usr/bin/mpc ] ; then
  alias mpc="nocorrect mpc"
fi

# Firefox
if [ -e /usr/bin/firefox ] ; then
  alias ff="firefox -no-remote -ProfileManager &>/dev/null &!"
fi

# Chrome/chromium
for i in chrome chromium google-chrome chromium-browser; do
  command -v $i &>/dev/null

  if [ $? -eq 0 ] ; then
    alias chrome="$i &>/dev/null &!"
    alias chromeunsafe="$i --disable-web-security --user-data-dir=/tmp --allow-file-access-from-files --enable-unrestricted-ssl3-fallback --ignore-certificate-errors --temp-profile &>/dev/null &!"
  fi
done

# Xephyr
if [ -e /usr/bin/Xephyr ] ; then
  XEPHYR_OPTS="-ac -noreset +extension RANDR +xinerama"
    #-keybd ephyr,,,xkbmodel=evdev,xkblayout=de"
  alias xeph1024="Xephyr $XEPHYR_OPTS -name xeph1024 -screen 1024x600 :2 &>/dev/null &!"
  alias xeph800="Xephyr $XEPHYR_OPTS -name xeph800 -screen 800x800 :2 &!"
  alias xeph640="Xephyr $XEPHYR_OPTS -name xeph640 -screen 640x480 :2 &!"
fi

# GVim
if [ -e /usr/bin/gvim ] ; then
  alias gvim="gvim &>/dev/null &!"
fi

# Keychain
if [ -f /usr/bin/keychain ] ; then
  alias kc="keychain -q --nocolor id_rsa && source $HOME/.keychain/$HOST-sh"
fi

# Mplayer
if [ -f /usr/bin/mplayer ] ; then
  alias dts="mplayer -ac hwdts,hwac3, -ao alsa:device=spdif"
  alias mp="mplayer -vo x11 -no-audio -zoom -fs"
fi

# subtle
if [ -f /usr/bin/subtle ] ; then
  alias sirb='ripl -r"subtle/subtlext"'
fi

if [ -f $HOME/projects/subtle-contrib/ruby/vitag.rb ] ; then
  alias vitag="ruby $HOME/projects/subtle-contrib/ruby/vitag.rb"
fi

# ImageMagick
if [ -f /usr/bin/import ] ; then
  alias import="import +repage"
fi

# Rsync
if [ -f /usr/bin/rsync ]; then
  alias rsync="rsync -avh --progress"
fi

# Java
if [ -e "/usr/lib/jvm/default-java" ] ; then
  export JAVA_HOME="/usr/lib/jvm/default-java"
fi

# PA
alias louder="pactl -- set-sink-volume 0 "

# Twttr
if [ -e "/usr/bin/psql" ] ; then
  alias tsql="psql -U twitter twittr -h localhost"
fi  

# xrandr
if [ -e "/usr/bin/xrandr" ] ; then
  alias xrandr3="xrandr \
    --output eDP-1 --primary --mode 1366x768 --pos 0x0 \
    --output DP-2-2 --mode 1920x1200 --pos 768x0 --right-of eDP-1 \
    --output DP-2-3 --mode 1920x1080 --pos 2688x0 --right-of DP-2-2 --rotate left --dpi 96"

  alias xrandr2="xrandr \
    --output eDP-1 --primary --mode 1366x768 --pos 0x0 \
    --output DP-2-2 --mode 1920x1080 --pos 768x0 --right-of eDP-1 --dpi 96"
fi