dots

git clone git://mattcarlson.org/repos/dots.git
Log | Files | Refs

aliasrc (4799B)


      1 #!/bin/sh
      2 #
      3 # aliasrc
      4 
      5 # posix
      6 alias \
      7     bc='bc -l'        \
      8     cp='cp -R'        \
      9     ls='ls -ls'       \
     10     mkdir='mkdir -p'  \
     11     more='less'       \
     12     rm='rm -iR'       \
     13     rmdir='rmdir -p'
     14 
     15 # gnu/linux
     16 if uname -s | grep -i 'linux' >/dev/null 2>&1; then
     17     alias \
     18          bc='bc -lq'                                          \
     19          cp='cp -vR'     					                  \
     20          def='sdcv -u '\''en-wiktionary'\'''                  \
     21          df='df -hT'     					                  \
     22          diff='diff --color=auto'                             \
     23          du='du -h'                  			              \
     24          echo='echo -en'             			              \
     25          egrep='egrep --color=auto'			                  \
     26          fgrep='fgrep --color=auto'			                  \
     27          ft='grep -inwIR'                                     \
     28          grep='grep --color=auto'                             \
     29          ls='ls -ahls --color=auto --group-directories-first' \
     30          mv='mv -v'                 			              \
     31          o='open.sh'                                          \
     32          paru='paru --sudo doas'                              \
     33          rmdir='rmdir -pv --ignore-fail-on-non-empty'         \
     34          vi='vim'                                             \
     35          vm='qemu-system-x86_64                               \
     36              -cpu host                                        \
     37              -enable-kvm                                      \
     38              -k de                                            \
     39              -m 4096                                          \
     40              -machine type=pc,accel=kvm                       \
     41              -net nic                                         \
     42              -net user,hostfwd=tcp::10022-:22                 \
     43              -smp $(nproc)                                    \
     44              -usb                                             \
     45              -vga std'
     46 
     47 fi
     48 
     49 # directories
     50 alias \
     51      ...='cd ../../'             \
     52      ....='cd ../../../'         \
     53      .....='cd ../../../../'     \
     54      ......='cd ../../../../../'
     55 
     56 # git
     57 alias \
     58      ga='git add'                  \
     59      gb='git branch'               \
     60      gba='git branch -a'           \
     61      gbv='git branch -v'           \
     62      gca='git commit --amend'      \
     63      gch='git checkout'            \
     64      gcm='git commit -m'           \
     65      gd='git diff'                 \
     66      gdc='git diff --cached'       \
     67      gf='git fetch'                \
     68      gp='git push'                 \
     69      gpl='git pull'                \
     70      gplo='git pull origin'        \
     71      gpo='git push origin'         \
     72      gpom='git push origin master' \
     73      gr='git rebase'               \
     74      gs='git status'               \
     75      gst='git stash'               \
     76      gsta='git stash apply'        \
     77      gstc='git stash clear'        \
     78      gstl='git stash list'         \
     79      gstp='git stash pop'
     80 
     81 # dots
     82 alias dots='/usr/bin/git --git-dir=${HOME}/.dots/ --work-tree=${HOME}'
     83 
     84 # sync mail on mail exit when entered thru cmd line
     85 alias ${MAIL_CLIENT}='"${HOME}/.local/bin/bar/mail.sh" -o'
     86 
     87 # brightness
     88 alias brightness='xrandr --output "${MONITOR}" --mode 1920x1080 --rate 144 --brightness'
     89 
     90 # youtube
     91 # NOTE: since 03 december 2021, youtube-dl should be a symlink to yt-dlp
     92 #       youtube-dl seems to be dead (last commit 01 july 2021) and there are unresolved issues (e.g., bandwidth throttling)
     93 #       yt-dlp is a fork of youtube-dl and seems to be a perfect stand-in for most use cases
     94 #       all programs that rely on youtube-dl should work
     95 #       https://github.com/yt-dlp/yt-dlp
     96 alias \
     97     yt='youtube-dl -i -o "${DOWNLOADS_DIR}/%(uploader)s/%(title)s.%(ext)s" --add-metadata'                                                                    \
     98     yta='yt -f bestaudio/best -x'                                                                                                                             \
     99     yts='youtube-dl --sub-lang en --write-sub --convert-subs=srt --skip-download'                                                                             \
    100     ytp='youtube-dl -i -o "${DOWNLOADS_DIR}/%(uploader)s/%(playlist_index)s-%(title)s.%(ext)s" --add-metadata'                                                \
    101     ytpa='ytp -f bestaudio/best -x'                                                                                                                           \
    102     ytps='youtube-dl --sub-lang en --write-sub --convert-subs=srt --skip-download -i -o "${DOWNLOADS_DIR}/%(uploader)s/%(playlist_index)s-%(title)s.%(ext)s"' \
    103     ytall='yt -cw -f best'                                                                                                                                    \
    104     ytw='${YOUTUBE_CLIENT}'