#!/bin/sh
alias sxg="startx '$XDG_CONFIG_HOME/X11/xinitrc'"

if [ -s "${XDG_CONFIG_HOME}/ssh/config" ]
then
	    SSH_CONFIG="-F ${XDG_CONFIG_HOME}/ssh/config"
fi
if [ -s "${XDG_CONFIG_HOME}/ssh/id_rsa" ]
then
	SSH_ID="-i ${XDG_CONFIG_HOME}/ssh/id_rsa"
fi
if [ -s "${XDG_CONFIG_HOME}/ssh/id_ed25519" ]
then
	SSH_ID="-i ${XDG_CONFIG_HOME}/ssh/id_ed25519"
fi


alias ssh="ssh -o UserKnownHostsFile='${XDG_CONFIG_HOME}/ssh/known_hosts' $SSH_CONFIG $SSH_ID "
alias scp="scp -o UserKnownHostsFile='${XDG_CONFIG_HOME}/ssh/known_hosts' $SSH_CONFIG $SSH_ID "
alias ssh-copy-id="ssh-copy-id $SSH_ID"
alias zsh-update-plugins="find "$ZDOTDIR/plugins" -type d -exec test -e '{}/.git' ';' -print0 | xargs -I {} -0 git -C {} pull -q"

# alias lvim='nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim"'

# get fastest mirrors
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"

# Colorize grep output (good for log files)
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'

# confirm before overwriting something
alias mv='mv -i'
alias rm='rm -i'

# easier to read disk
alias df='df -h'     # human-readable sizes
alias free='free -m' # show sizes in MB

# get top process eating memory
alias psmem='ps auxf | sort -nr -k 4 | head -5'

# get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3 | head -5'

# gpg encryption
# verify signature for isos
alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
# receive the key of a developer
alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"

# For when keys break
alias archlinx-fix-keys="sudo pacman-key --init && sudo pacman-key --populate archlinux && sudo pacman-key --refresh-keys"
alias monerohot="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host 127.0.0.1 --daemon-port 18081 --wallet-file /home/moo/.config/monero-wallet/moo/moo --log-file ~/.config/monero.log"

alias monerocold="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host 127.0.0.1 --daemon-port 18081 --wallet-file /home/moo/.config/monero-wallet/view-safe --log-file ~/.config/monero.log"
alias moneromine="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host 127.0.0.1 --daemon-port 18081 --wallet-file /home/moo/.config/monero-wallet/mining-only --log-file ~/.config/monero.log"

alias monerohot2="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host xmr-de-1.boldsuck.org --daemon-port 18081 --wallet-file /home/moo/.config/monero-wallet/moo/moo --log-file ~/.config/monero.log"

alias monerohot3="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host uwillrunanodesoon.moneroworld.com:18089 --wallet-file /home/moo/.config/monero-wallet/moo/moo --log-file ~/.config/monero.log"

alias monerohot3view="/home/moo/monero/build/Linux/_HEAD_detached_at_v0.18.3.3_/release/bin/monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host uwillrunanodesoon.moneroworld.com:18089 --wallet-file /home/moo/.config/monero-wallet/hot-view-only/hot-view-only --log-file ~/.config/monero.log"

alias monerohot3offline="/home/moo/monero/build/Linux/_HEAD_detached_at_v0.18.3.3_/release/bin/monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --wallet-file /home/moo/.config/monero-wallet/hot-wallet-offline/hot-wallet-offline --log-file ~/.config/monero.log"

alias monerohotmine="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host 173.80.117.79 --daemon-port 18089 --wallet-file /home/moo/.config/monero-wallet/moo/moo --log-file ~/.config/monero.log"
alias monerohot5view="/run/media/moo/unlocked-universe/otherthings/dox/projects/monero/build/Linux/_HEAD_detached_at_v0.18.3.3_/release/bin/monero-wallet-cli --proxy 192.168.0.138:9050 --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host sisjvizpqhu6plxw3xai67cqjvlbxkfy2kcc53f6bplzdabretuybzad.onion --daemon-port 18081 --wallet-file /home/moo/.config/monero-wallet/hot-view-only/hot-view-only --log-file ~/.config/monero.log"

alias monerohot5="monero-wallet-cli --proxy 192.168.0.138:9050 --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host sisjvizpqhu6plxw3xai67cqjvlbxkfy2kcc53f6bplzdabretuybzad.onion --daemon-port 18081 --wallet-file /home/moo/.config/monero-wallet/moo/moo --log-file ~/.config/monero.log"
alias monerohot6="monero-wallet-cli --proxy 127.0.0.1:9050 --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host sisjvizpqhu6plxw3xai67cqjvlbxkfy2kcc53f6bplzdabretuybzad.onion --wallet-file /home/moo/.config/monero-wallet/moo/moo --log-file ~/.config/monero.log"

#alias monerocoldmine="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host 173.80.117.79 --daemon-port 18081 --wallet-file /home/moo/.config/monero-wallet/view-safe --log-file ~/.config/monero.log"
#
alias monerohotminetwo="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host 173.80.117.79:18089 --wallet-file /home/moo/.config/monero-wallet/moo/moo --log-file ~/.config/monero.log"
#
alias monerocoldminetwo="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host 173.80.117.79:18089 --wallet-file /home/moo/.config/monero-wallet/view-safe --log-file ~/.config/monero.log"

alias monerocoldmine="monero-wallet-cli --shared-ringdb-dir=/home/moo/.config/shared-db --trusted-daemon --daemon-host 173.80.117.79 --daemon-port 18089 --wallet-file /home/moo/.config/monero-wallet/view-safe --log-file ~/.config/monero.log"

alias randpw2="< /dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c4096 > 't.txt'"
alias randpw3="< /dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c4096 | gpg2 -o t.gpg -e -r the7772"
alias randpwsmol="< /dev/urandom tr -dc '12345!@%^qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c128 > 't.txt'"
alias randpw4="< /dev/urandom tr -dc '12345-_qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c18 | gpg2 -o t.gpg -e -r the7772"
alias mullvad="curl https://am.i.mullvad.net/json"

CD() { eval "cd -- $(fzf < /home/moo/.local/tmp/bookmarks)"; }
ffp() {
	find / -type f 2>/dev/null | fzf-ueberzogen --multi --preview 'fzf-preview {}' > /tmp/.pass
}
fdsx() {
	sxiv -r "$(find / -type d 2>/dev/null | fzf)"
}
ff() {
	find / -type f 2>/dev/null | fzf > /tmp/.pass
}
fdr() {
	find / -type d 2>/dev/null | fzf > /tmp/.pass
}
	#cd "$(find / -type d 2>/dev/null | fzf)"
fcd() {
	cd "$(find / -type d 2>/dev/null | fzf --preview='tree -C {} | head -n 50' --preview-window=70%,border-double,top)"
}
ffs() {
        find / -type f 2>/dev/null | fzf
}
#fcd() {
# cd "$(find ./"$1" -type d -not -path '*/.config/librewolf/main/*' -not -path '*/.config/libreoffice/*' -not -path '*/.config/lf/src/lf-r27/*' | fzf)"
#}
drax() {
 dragon -a -x $(find ./"$1" -type f | fzf-ueberzogen --multi --preview 'fzf-preview {}')
}
dra() {
 dragon -a $(find ./"$1" -type f | fzf-ueberzogen --multi --preview 'fzf-preview {}')
}
dr() {
 dragon $(find ./"$1" -type f | fzf-ueberzogen --multi --preview 'fzf-preview {}')
}
fmv() {
	MOV=$(find . -type f | fzf --multi --preview 'fzf-preview {}')
	if [[ $MOV != '' ]]; 
		then
		vimv $MOV
	else
		clear;
	fi
}
fcp() {
	COP=$(find . -type f | fzf --multi --preview 'fzf-preview {}')
	if [[ $COP != '' ]]; 
		then
		vimcp $COP
	else
		clear;
	fi
}

yttompv() {
 ytfzf -L | grep https:// | cat > $HOME/.local/media/vids/yt/watch.list && devour mpv --playlist="$HOME/.local/media/vids/yt/watch.list"
}
alias ls='ls --color=auto'
