1
0
Fork 0
dotfiles/.config/shell/aliasrc

65 lines
2.0 KiB
Plaintext
Raw Normal View History

2022-07-04 21:36:33 +02:00
#!/bin/sh
# Use $XINITRC variable if file exists.
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
# sudo not required for some system commands
2022-08-01 18:04:11 +02:00
for command in mount umount sv pacman apt updatedb su shutdown poweroff reboot ; do
2022-09-15 20:27:44 +02:00
alias $command="sudo $command"
2022-07-04 21:36:33 +02:00
done; unset command
# Verbosity and settings that you pretty much just always are going to want.
alias \
2022-09-15 20:27:44 +02:00
cp="cp -iv" \
mv="mv -iv" \
rm="rm -vI" \
bc="bc -ql" \
mkd="mkdir -pv" \
ffmpeg="ffmpeg -hide_banner" \
exa="exa -abghHliS" \
2022-07-22 13:09:59 +02:00
duf="duf -all" \
2022-08-01 18:04:11 +02:00
ls="ls -hN --color=auto --group-directories-first" \
2022-09-15 20:27:44 +02:00
grep="grep --color=auto" \
diff="diff --color=auto" \
2022-08-01 18:04:11 +02:00
2022-07-04 21:36:33 +02:00
# Colorize commands when possible.
alias \
2022-09-15 20:27:44 +02:00
ls="ls -hN --color=auto --group-directories-first" \
grep="grep --color=auto" \
diff="diff --color=auto" \
ccat="highlight --out-format=ansi" \
2022-08-01 18:04:11 +02:00
ip="ip -color=auto"
2022-07-04 21:36:33 +02:00
# These common commands are just too long! Abbreviate them.
alias \
2022-09-15 20:27:44 +02:00
ka="killall" \
2022-07-22 13:09:59 +02:00
e="$EDITOR" \
2022-08-01 18:04:11 +02:00
z="zathura" \
2022-09-15 20:27:44 +02:00
p="pacman" \
2022-08-08 17:42:48 +02:00
ar="apt remove" \
are="apt reinstall" \
2022-08-01 18:04:11 +02:00
ai="apt install" \
aur="apt autoremove" \
2022-09-21 21:46:55 +02:00
au="apt upgrade" \
kssh="kitty +kitten ssh"
2022-07-22 13:09:59 +02:00
2022-07-04 21:36:33 +02:00
# Misc.
alias \
2022-09-15 20:27:44 +02:00
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \
remvirt="virt-manager -c 'qemu+ssh://luca@192.168.178.200/system'" \
vim="nvim" \
2022-07-22 13:09:59 +02:00
wikidown='rclone sync cloud:files/luca/Notes ~/Documents/vimwiki' \
2022-08-03 11:38:01 +02:00
wikiup='rclone sync ~/Documents/vimwiki cloud:files/luca/Notes' \
cam="mpv --untimed --no-cache --no-osc --no-input-default-bindings --profile=low-latency --input-conf=/dev/null --title=webcam $(ls /dev/video[0,2,4,6,8] | tail -n 1)" \
2022-09-21 21:46:55 +02:00
ahv="export ANSIBLE_VAULT_PASSWORD_FILE=~/.ansible/secrets/ansible-homelab && ansible-vault" \
xpick=" xprop | awk '
/^WM_CLASS/{sub(/.* =/, \"instance:\"); sub(/,/, \"\nclass:\"); print}
/^WM_NAME/{sub(/.* =/, \"title:\"); print}'"
2022-09-27 18:34:34 +02:00
# Functions
whed () {
$EDITOR "$(which "$1")"
}