75 lines
1.9 KiB
Plaintext
75 lines
1.9 KiB
Plaintext
# zsh specific
|
|
if [[ "$SHELL" =~ "zsh$" ]]; then
|
|
alias -g G='| rg -i'
|
|
alias -g L='| less'
|
|
fi
|
|
|
|
# general
|
|
alias c='clear'
|
|
alias t='tmux a || tmux'
|
|
alias o='xdg-open' # to change a mime use: `xdg-mime default APPLICATION HANDLE`
|
|
alias gg='git grep $1'
|
|
alias tex='nix-shell ~/.dots/tex.nix'
|
|
alias texmk="latexmk -xelatex -shell-escape"
|
|
alias mktex=texmk
|
|
alias lg="lazygit"
|
|
|
|
alias cdt='mkdir /tmp/$(cat /proc/sys/kernel/random/uuid); cd $_'
|
|
|
|
alias l='ls -lFh --color'
|
|
alias la='ls -lAFh --color'
|
|
alias ll='ls -l --color'
|
|
|
|
alias rm='rm -i'
|
|
alias cp='cp -i'
|
|
alias mv='mv -i'
|
|
|
|
alias gg='git grep'
|
|
|
|
alias truecolor='curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash'
|
|
alias nssh='SSH_AUTH_SOCK= ssh'
|
|
alias cpu='watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo"'
|
|
alias fixagent='eval $(tmux show-env -s | grep "^SSH_")'
|
|
|
|
# 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'
|
|
|
|
# functions
|
|
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
|
|
# }
|