2021-02-06 23:41:32 +01:00
#!/usr/bin/env bash
2021-05-23 03:00:44 +02:00
export SCREENSHOT_DIR='~/pictures/screenshots'
2021-02-06 23:41:32 +01:00
# ░█▀█░█▀▄░█▀█░█▀▀░█▀▄░█▀█░█▄█░█▀▀
# ░█▀▀░█▀▄░█░█░█░█░█▀▄░█▀█░█░█░▀▀█
# ░▀░░░▀░▀░▀▀▀░▀▀▀░▀░▀░▀░▀░▀░▀░▀▀▀
alias m="ncmpcpp"
2021-05-22 17:32:06 +02:00
2021-05-23 03:00:44 +02:00
if command -v nvim &> /dev/null; then
2021-05-22 17:32:06 +02:00
alias vim="nvim"
alias vi="nvim"
2021-05-23 03:00:44 +02:00
elif command -v vim &> /dev/null; then
2021-05-22 17:32:06 +02:00
alias nvim="vim"
alias vi="vim"
2021-05-23 03:00:44 +02:00
elif command -v vi &> /dev/null; then
2021-05-22 17:32:06 +02:00
alias nvim="vi"
alias vim="vi"
else
2021-05-23 03:00:44 +02:00
echo -e "\033[31m[ERROR] No vim program found on the system! Couldn't bind aliases!\033[0m"
fi
if command -v ipython &> /dev/null; then
alias p="ipython"
fi
if command -v youtube-dl &> /dev/null; then
alias youtube-dl-list='youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio" -o "%(playlist_index)s-%(title)s.%(ext)s"'
alias music-dl='youtube-dl --extract-audio -f "bestaudio[ext=m4a]/best""'
alias music-dl-list='youtube-dl --extract-audio -f "bestaudio[ext=m4a]/best" -o "%(playlist_index)s-%(title)s.%(ext)s"'
fi
if command -v maim &> /dev/null; then
alias skusho='maim -u -k $(echo $SCREENSHOT_DIR)/$(date +%s).png'
if command -v xclip &> /dev/null; then
alias skushoclip='maim -k -s -u | xclip -selection clipboard -t image/png -i'
fi
2021-05-22 17:32:06 +02:00
fi
2021-05-23 03:00:44 +02:00
if command -v rsync &> /dev/null; then
alias cp='rsync --progress -h'
fi
2021-02-06 23:41:32 +01:00
# ░█▀▀░█▀█░█░░░█▀█░█▀▄
# ░█░░░█░█░█░░░█░█░█▀▄
# ░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀
2021-05-23 03:00:44 +02:00
if command -v exa &> /dev/null; then
2021-05-22 17:32:06 +02:00
alias ls='exa'
alias ll='exa --long --header --git'
alias sl='exa -a --long --header --git'
alias la='exa -a'
else
alias ls='ls --group-directories-first --color=auto'
alias ll='ls -alFh --group-directories-first --color=auto'
alias la='ls -A --group-directories-first --color=auto -F'
fi
2021-02-06 23:41:32 +01:00
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
2021-05-23 03:00:44 +02:00
alias echo-colors='for x in 0 1 4 5 7 8; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo "";'
2021-02-06 23:41:32 +01:00
# ░█▄█░▀█▀░█▀▀░█▀▀
# ░█░█░░█░░▀▀█░█░░
# ░▀░▀░▀▀▀░▀▀▀░▀▀▀
# Cd to git folder
2021-05-23 03:00:44 +02:00
alias gt='cd ~/git'
2021-02-06 23:41:32 +01:00
# Make ftp server
2021-05-23 03:00:44 +02:00
alias makeftp='python -m pyftpdlib --directory=$HOME/ --port=2121'
2021-02-06 23:41:32 +01:00
# Get current Fcitx mode
2021-05-23 03:00:44 +02:00
alias get-fcitx-mode='qdbus "org.fcitx.Fcitx" "/inputmethod" "GetCurrentIM"'
2021-02-06 23:41:32 +01:00
2021-05-23 03:00:44 +02:00
c-file() {
2021-02-06 23:41:32 +01:00
nvim $($HOME/.scripts/rofi/config-selector.py)
}
2021-05-23 03:00:44 +02:00
alias openfile='~/.scripts/rofi/config-selector.py | xargs nvim'
2021-02-06 23:41:32 +01:00
2021-05-23 03:00:44 +02:00
# alias tangle-doom-emacs='cd $HOME/.doom.d && $HOME/.emacs.d/bin/org-tangle config.org && cd -'
2021-02-06 23:41:32 +01:00
alias xr='xmonad --recompile'
# TODO: Update to paru
alias xmr='yay -S xmobar-git --answerclean A --answerdiff N'
alias xxmr='xr; xmr'
2021-05-23 03:00:44 +02:00
alias killall-tmux='tmux ls | awk '{print $1}' | sed 's/://g' | xargs -I{} tmux kill-session -t {}'
2021-02-06 23:41:32 +01:00
alias cd..='cd ..'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
2021-05-23 03:00:44 +02:00
alias q='exit'
2021-02-06 23:41:32 +01:00
2021-05-23 03:00:44 +02:00
# Supposed to be used as a pipe: "cat file | rainbow"
alias rainbow='toilet -f pagga | lolcat'
2021-02-06 23:41:32 +01:00
2021-05-23 03:00:44 +02:00
if [[ -f ~/.scripts/dropbox.py ]]; then
alias dp="python ~/.scripts/dropbox.py"
fi
2021-02-06 23:41:32 +01:00
2021-05-23 03:00:44 +02:00
if [[ -f ~/.aliases.private ]]; then
source ~/.aliases.private
fi
2021-02-06 23:41:32 +01:00
2021-05-23 03:00:44 +02:00
if [[ -f ~/.aliases.desktop ]]; then
source ~/.aliases.desktop
fi
2021-02-06 23:41:32 +01:00
2021-05-23 03:00:44 +02:00
if [[ -f ~/.aliases.laptop ]]; then
source ~/.aliases.laptop
2021-05-22 17:32:06 +02:00
fi