#!/usr/bin/env bash
# shellcheck disable=SC2139

unalias -a

alias open="xdg-open"
alias l="ls -lahp --color"
alias copy="tr -d '\\n' | xclip -sel clip"
alias vpn="sudo openvpn --config $DOTFILES/VPN/euandreh.ovpn"
# Source: https://unix.stackexchange.com/questions/25327/watch-command-alias-expansion#25329
alias watch="watch --color "
alias mr="mr -s"
alias sbcl="rlwrap sbcl"
alias ncdu="ncdu --color dark"
alias mm="sync-mail.sh"
alias m="sync-mail.sh --fast"
alias sqlite="rlwrap sqlite3"
alias p='ping euandre.org -c 3'
alias playerctl="playerctl --player=\"\$(cat ~/.cache/andreh/mpris-player.txt)\""
alias fim="play $DOTFILES/bash/Positive.ogg &> /dev/null"
alias mux="tmuxinator start"
alias s="git status"
alias d="git diff"
alias ds="git diff --staged"

u() {
  pushd ~/annex > /dev/null || exit 1;
  git annex info --fast | grep available;
  popd > /dev/null || exit 1;
}
export -f u

alias reload="source $DOTFILES/bash/reload.sh"
alias rr="source $DOTFILES/bash/reload.sh"
alias r="source ~/.bashrc"

alias ag="ag --hidden"
alias jk-shell="bundix && nix-shell -E '((import <nixpkgs> {}).bundlerEnv { name=\"jekyll-env\"; gemdir = ./.; }).env'"
alias grep='grep --color=always'
alias td='pushd $(mktemp -d)'
# https://linuxhandbook.com/run-alias-as-sudo/
alias sudo='sudo '
