*
This commit is contained in:
cho
2024-01-27 15:42:16 +07:00
parent 0e6199ab8b
commit 9ceb9dbd33
47 changed files with 4633 additions and 267 deletions

View File

@ -1,66 +1,51 @@
#!/bin/sh
# Use neovim for vim if present.
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
# Use $XINITRC variable if file exists.
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC"
# sudo not required for some system commands
for command in mount umount sv pacman updatedb su shutdown poweroff reboot ; do
for command in mount umount updatedb su shutdown poweroff reboot ; do
alias $command="sudo $command"
done; unset command
se() { cd ~/.local/bin; $EDITOR $(fzf) ;}
# Verbosity and settings that you pretty much just always are going to want.
alias \
e="emacsclient -tty -a ''" \
emc="setsid -f emacsclient -c -a '' >/dev/null 2>&1" \
emo="emacsclient" \
kem="emacsclient -e '(kill-emacs)'" \
vimdiff="nvim -d" \
cp="cp -iv" \
mv="mv -iv" \
rm="rm -vI" \
bc="bc -ql" \
pg="ps -aux | grep --color=auto" \
mkd="mkdir -pv" \
ffmpeg="ffmpeg -hide_banner"
wedit(){
which $@ >/dev/null 2>&1 && [ -n "$1" ] && vim $(which $@) || printf "file doesn't exist.\n"
}
# Colorize commands when possible.
alias \
ffmpeg="ffmpeg -hide_banner" \
ls="ls -hN --color=auto --group-directories-first" \
grep="grep --color=auto" \
diff="diff --color=auto" \
ccat="highlight --out-format=ansi" \
ip="ip -color=auto"
# These common commands are just too long! Abbreviate them.
alias \
ip="ip -color=auto" \
ka="killall" \
g="git" \
sdn="shutdown -h now" \
e="$EDITOR" \
v="nvim" \
z="zathura" \
i="nsxiv -a"
alias \
magit="nvim -c MagitOnly" \
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
weath="curl wttr.in"
# misc
alias \
d="sdcv" \
i="nsxiv -a" \
pg="ps -aux | grep --color=auto" \
weath="curl wttr.in" \
ytmus="yt-dlp --embed-metadata --embed-thumbnail -xc -f 'bestaudio[ext=m4a]'" \
ytvid="yt-dlp --embed-metadata --embed-thumbnail --embed-chapters --write-auto-subs -f bestvideo'[height<=1080]''[ext=mp4]'+bestaudio'[ext=m4a]'/best'[ext=mp4]'/best" \
t="todo.sh -t -d $HOME/notebook/todo/todo.cfg" \
fj="firejail --profile=$HOME/.config/firejail/game.profile" \
dj="dijo" \
hgs="hugo server --noHTTPCache --disableFastRender"
hgs="hugo server --noHTTPCache --disableFastRender" \
left='uxnemu ~/.local/uxn/left.rom' \
bouc='uxnemu ~/.local/uxn/bouc.rom' \
catclock='uxnemu ~/.local/uxn/catclock.rom' \
b='$BROWSER'\
sc='sc-im'\
l='ledger -f ~/notebook/ac/ac.ledger'
# ytfzf
#alias \
# ytfzf="ytfzf --thumb-viewer=imv" \
# ytfzf-video="ytfzf --detach -t" \
# ytfzf-audio="ytfzf -m" \
# ytfzf-history="ytfzf --detach -H"
wedit(){
which $@ >/dev/null 2>&1 && [ -n "$1" ] && $EDITOR $(which $@) || printf "file doesn't exist.\n"
}