2024-01-29 14:16:07 +01:00
|
|
|
#!/bin/sh
|
2023-11-20 14:30:34 +01:00
|
|
|
# shellcheck disable=SC2142
|
2023-03-29 16:15:06 +02:00
|
|
|
# sudo not required for some system commands
|
2024-01-04 12:45:49 +01:00
|
|
|
for command in mount umount xbps-install xbps-remove updatedb su shutdown poweroff reboot; do
|
2024-01-13 15:10:31 +01:00
|
|
|
# shellcheck disable=SC2139
|
|
|
|
command -v $command 1>/dev/null 2>&1 && alias $command="sudo $command"
|
2023-03-29 16:15:06 +02:00
|
|
|
done
|
|
|
|
unset command
|
|
|
|
|
2024-01-04 12:45:49 +01:00
|
|
|
# Colorization
|
2023-03-29 16:15:06 +02:00
|
|
|
alias \
|
2024-01-13 15:10:31 +01:00
|
|
|
ls="ls --color=auto --group-directories-first" \
|
|
|
|
grep="grep --color=auto" \
|
|
|
|
diff="diff --color=auto" \
|
|
|
|
ccat="highlight --out-format=ansi" \
|
|
|
|
grep="grep --color=auto" \
|
|
|
|
diff="diff --color=auto" \
|
|
|
|
ip="ip -color=auto"
|
2023-03-29 16:15:06 +02:00
|
|
|
|
2024-01-04 12:45:49 +01:00
|
|
|
# Common flags
|
2023-03-29 16:15:06 +02:00
|
|
|
alias \
|
2024-01-13 15:10:31 +01:00
|
|
|
vim="nvim" \
|
|
|
|
cp="cp -iv" \
|
|
|
|
mv="mv -iv" \
|
|
|
|
rm="rm -vI" \
|
|
|
|
bc="bc -ql" \
|
|
|
|
mkd="mkdir -pv" \
|
|
|
|
tldr="tldr -s" \
|
|
|
|
ffmpeg="ffmpeg -hide_banner" \
|
|
|
|
nvidia-settings="nvidia-settings --config=\$XDG_CONFIG_HOME/nvidia/settings"
|
2023-03-29 16:15:06 +02:00
|
|
|
|
2024-01-04 12:45:49 +01:00
|
|
|
# Shortening
|
2023-03-29 16:15:06 +02:00
|
|
|
alias \
|
2024-01-13 15:10:31 +01:00
|
|
|
ka="killall" \
|
2024-02-08 17:25:51 +01:00
|
|
|
ll="ls -lhpAN --color=auto --group-directories-first" \
|
|
|
|
subup="git submodule update --remote --recursive --merge"
|
2023-03-29 16:15:06 +02:00
|
|
|
|
2024-01-04 12:45:49 +01:00
|
|
|
# Quasi functions
|
2023-03-29 16:15:06 +02:00
|
|
|
alias \
|
2024-01-13 15:10:31 +01:00
|
|
|
xgetkeys="xev | sed -ne '/^KeyPress/,/^$/p'" \
|
|
|
|
whed='() { $EDITOR $(which "$1") }' \
|
|
|
|
xpick="xprop | awk '
|
2023-03-29 16:15:06 +02:00
|
|
|
/^WM_CLASS/{sub(/.* =/, \"instance:\"); sub(/,/, \"\nclass:\"); print}
|
|
|
|
/^WM_NAME/{sub(/.* =/, \"title:\"); print}'"
|
2024-01-04 12:45:49 +01:00
|
|
|
|
2024-01-13 15:10:31 +01:00
|
|
|
# Void specific aliases
|
2024-01-04 12:45:49 +01:00
|
|
|
alias \
|
2024-01-13 15:10:31 +01:00
|
|
|
x="xbps-install" \
|
|
|
|
xr="xbps-remove" \
|
|
|
|
xsi="xpkg -a |\
|
2024-01-04 12:45:49 +01:00
|
|
|
fzf -m --preview 'xq {1} | \\grep -e pkgver -e license -e short_desc -e installed_size -e maintainer -e repository -e homepage' --preview-window=right:66%:wrap |\
|
|
|
|
xargs -ro xi"
|
|
|
|
|