dotfiles

custom dotfiles
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

aliases.zsh (4577B)


      1 # ALIASES
      2 alias ll="ls -lahF --color=auto"
      3 alias ls="ls -hF --color=auto"
      4 alias lsl="ls -lhF --color=auto"
      5 alias "cd.."="cd ../"
      6 alias up="cd ../"
      7 alias rmrf="rm -rf"
      8 alias psef="ps -ef"
      9 alias mkdir="mkdir -p"
     10 alias cp="cp -r"
     11 alias scp="scp -r"
     12 alias mkdir="mkdir -p"
     13 alias xsel="xsel -b"
     14 alias fuck='sudo $(fc -ln -1)'
     15 alias v="vim"
     16 alias vi="vim"
     17 alias emacs="vim"
     18 alias g="git"
     19 alias ga="git add"
     20 alias gb="git branch | grep \*"
     21 alias gc="git commit -S -m"
     22 alias gs="git status"
     23 alias gd="git diff"
     24 alias gf="git fetch"
     25 alias gm="git merge"
     26 alias gr="git rebase"
     27 alias gp="git push"
     28 alias gu="git unstage"
     29 alias gg="git log --graph"
     30 alias gco="git checkout"
     31 alias gpr="git request-pull"
     32 alias ag="ag --color --color-line-number '0;35' --color-match '46;30' --color-path '4;36'"
     33 alias tree='tree -CAFa -I "CVS|*.*.package|.svn|.git|.hg|node_modules|bower_components" --dirsfirst'
     34 alias rock="mpd .mpd/mpd.conf ; ncmpcpp"
     35 alias mixer="alsamixer"
     36 alias term="urxvtc -hold -e " #used for run menu
     37 alias pacman="sudo pacman"
     38 alias update="pacman -Syu"
     39 alias systemctl="sudo systemctl"
     40 alias :q="sudo systemctl poweroff"
     41 #alias disks='echo "╓───── m o u n t . p o i n t s"; echo "╙────────────────────────────────────── ─ ─ "; lsblk -a; echo ""; echo "╓───── d i s k . u s a g e"; echo "╙────────────────────────────────────── ─ ─ "; sudo df -h -x tmpfs -x devtmpfs;'
     42 alias disks='echo "┌──┄";echo "├┄ m o u n t . p o i n t s"; echo "└──┄┄────┄┄"; lsblk -a; echo ""; echo "┌──┄";echo "├┄ d i s k . u s a g e"; echo "└──┄┄────┄┄"; sudo df -h -x tmpfs -x devtmpfs;'
     43 alias record="ffmpeg -f x11grab -s 1366x768 -an -r 16 -loglevel quiet -i :0.0 -b:v 5M -y" #pass a filename
     44 alias gifview="gifview -a"
     45 alias reboot="sudo reboot"
     46 alias vh="nc vhbin.net 9999"
     47 alias kb="keybase"
     48 alias dd="dd status=progress"
     49 alias docker="sudo docker"
     50 alias docker-compose="sudo docker-compose"
     51 alias ncmpcpp="ncmpcpp -q"
     52 alias song="ncmpcpp --current-song='$7%a - $8{%n} {%t} $R [{%l}] ' | cut -d '%' -f 1"
     53 alias jobs="jobs -l"
     54 alias dnf="sudo dnf"
     55 alias irc="TERM=screen-256color dtach -A /tmp/irc irssi"
     56 alias ap="ansible-playbook"
     57 alias tf="terraform"
     58 alias tfi="terraform init"
     59 alias tfa="terraform apply --auto-approve"
     60 alias tfp="terraform plan"
     61 alias tfd="terraform destroy"
     62 alias tor="cd ~/src/warez/tor/ ; ./start-tor-browser.desktop"
     63 alias failover="sudo ip link set enp5s0 down"
     64 alias failback="sudo ip link set enp5s0 up"
     65 alias netctl="sudo netctl"
     66 alias feh="feh -g 640x480"
     67 alias rum.sh="nc rum.sh 9999"
     68 alias headsetbatt="bluetooth_battery 34:DF:2A:5F:04:2C"
     69 alias headset="echo 'connect 34:DF:2A:5F:04:2C' | bluetoothctl"
     70 alias bton="echo 'power on' | bluetoothctl"
     71 alias btoff="echo 'power off' | bluetoothctl"
     72 alias moebius="cd $HOME/src/warez/moebius ; /usr/bin/npm start"
     73 alias cointop="$HOME/src/go/bin/cointop --hide-statusbar"
     74 alias nodisturb="dunstctl set-paused true"
     75 alias disturb="dunstctl set-paused false"
     76 alias sacc="PAGER=less sacc"
     77 alias buku="buku --np"
     78 alias tin="NNTPSERVER=eu.newsdemon.com ~/src/warez/tin/tin-latest/src/tin -r -A"
     79 
     80 alias -s md=vim
     81 alias -s {png,jpg,jpeg}=sxiv
     82 alias -s pdf=zathura
     83 alias -s mp4=mpv
     84 
     85 email() {
     86   echo $3 | mutt -s $2 $1
     87 }
     88 
     89 # colorised cat
     90 c() {
     91   for file in "$@"
     92   do
     93     pygmentize -O style=sourcerer -f console256 -g "$file" 
     94   done
     95 }
     96 
     97 # colorised less
     98 #l() {
     99 #  pygmentize -O style=sourcerer -f console256 -g $1 | less -r 
    100 #}
    101 
    102 # read markdown files like manpages
    103 md() {
    104     pandoc -s -f markdown -t man "$*" | man -l -
    105 }
    106 
    107 # read webpage as manpage
    108 webman() {
    109 	curl -L "$@" | pandoc -s -f html -t man | man -l -
    110 }
    111 
    112 # read anything as manpage
    113 nam() {
    114 	pandoc -s -t man "$*" | man -l -
    115 }
    116 
    117 # connect to tmux on ssh
    118 ssux() {
    119 	TERM=screen ssh -t "$@" 'tmux attach || tmux new' || ssh "$@"
    120 }
    121 
    122 # record the primary screen
    123 screencast() {
    124 	RESOLUTION=$(xrandr | grep "*" | awk '{print $1}' | head -n1)
    125 	echo "recording..."
    126 	ffmpeg -f x11grab -s ${RESOLUTION} -an -r 16 -loglevel quiet -i :0.0 -b:v 5M -y ${HOME}/lib/videos/recordings/screencasts/$(date +%Y%m%d)-${1}.webm
    127 }
    128 
    129 # take picture with webcam
    130 webcapture() {
    131 	NUM=$(ls -l $HOME/tmp/*webcapture*|wc -l)
    132 	NUM=$(( NUM + 1 ))
    133 	ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 -ss 0:0:2 -frames 1 $HOME/tmp/$(date +%Y%m%d)-webcapture-${NUM}.png
    134 }
    135 
    136 # sets terminal title
    137 # useful for unhide
    138 title() {
    139 	printf "\033]2;${1}\007"
    140 }