# fzf export FZF_DEFAULT_COMMAND='find .' export FZF_DEFAULT_OPTS=' --layout=reverse --color=fg:#5c6a72,bg:#FDF6E3,hl:#8da101 --color=fg+:#5c6a72,bg+:#eee8d5,hl+:#8da101 --color=info:#5c6a72,prompt:#5c6a72,pointer:#5c6a72 --color=marker:#5c6a72,spinner:#5c6a72,header:#5c6a72' if [[ -d ~/.vim/plugged/fzf ]]; then [[ -x $(which fzf 2> /dev/null) ]] || export PATH=$PATH:$HOME/.vim/plugged/fzf/bin if [[ "$SHELL" =~ "bash$" ]]; then source ~/.vim/plugged/fzf/shell/completion.bash source ~/.vim/plugged/fzf/shell/key-bindings.bash fi if [[ "$SHELL" =~ "zsh$" ]]; then source ~/.vim/plugged/fzf/shell/completion.zsh source ~/.vim/plugged/fzf/shell/key-bindings.zsh fi fi # zsh specific if [[ "$SHELL" =~ "zsh$" ]]; then alias -g G='| rg -i' alias -g L='| less' fi # alpabetically sorted alias c='clear' alias cb='cargo build' alias cdt='mkdir /tmp/$(cat /proc/sys/kernel/random/uuid); cd $_' alias cp='cp -i' alias cpu='watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo"' alias cr='cargo run' alias d='docker' alias dc='docker compose' alias fixagent='eval $(tmux show-env -s | grep "^SSH_")' alias g='git' alias gg='git grep' alias l='ls -lFh --color' alias la='ls -lAFh --color' alias ll='ls -l --color' alias mktex="latexmk -xelatex -shell-escape" alias mv='mv -i' alias nssh='SSH_AUTH_SOCK= ssh' alias o='xdg-open' # to change a mime use: `xdg-mime default APPLICATION HANDLE` alias rm='rm -i' alias t='tmux a || tmux -u' alias texmk="latexmk -xelatex -shell-escape" alias texsh='nix-shell ~/.dots/tex.nix' alias truecolor='curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash' alias v='vim' alias whatsmyip='curl https://ipinfo.io/ip; echo' # nmcli alias con='nmcli con' alias conup='nmcli con up id' alias condown='nmcli con down id' alias conscan='nmcli dev wifi' alias conedit='nm-connection-editor' # password hash (sed needed when using in docker-compose) pwhash() { name=$1 if [ -z $name ]; then echo "Please enter a username." return fi echo $(htpasswd -nB ${name}) | sed -e s/\\$/\\$\\$/g } # ocr ocr() { file=$1 if [ -z $file ]; then echo "Please input a file." return fi name=${file%%.*} ocrmypdf -l ger+eng --output-type pdf $file ${name}.ocr.pdf } # deprecated conservation() { location='/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode' if [ -z $1 ]; then cat $location elif [ $1 = '0' ] || [ $1 = '1' ]; then echo $1 | sudo tee $location else echo 'Invalid option' fi } power() { location='/sys/firmware/acpi/platform_profile' if [ -z $1 ]; then echo "Current:" $(cat $location) echo "Can be one of:" $(cat /sys/firmware/acpi/platform_profile_choices) elif [ $1 = 'low-power' ] || [ $1 = 'balanced' ] || [ $1 = 'performance' ]; then echo $1 | sudo tee $location else echo 'Invalid option' fi }