#!/bin/sh # Use neovim for vim if present. [ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d" # use x-clip if X11 and wl-copy if Wayland, as clipboard [ "$XDG_SESSION_TYPE" = "x11" ] && CLIP="xclip -sel c" || [ "$XDG_SESSION_TYPE" = "wayland" ] && CLIP="wl-copy" # auto add sudo in front of commands for command in mount umount pacman updatedb su; do alias $command="sudo $command" done unset command ##aliases #some aliases for launching applications alias \ b='brave' \ bb='brave --incognito' \ bbb='brave --tor' \ github='brave https://github.com/justsaumit' \ ff='librewolf' \ v='nvim' \ sv='sudo nvim' \ vim='nvim' \ r='ranger' \ sr='sudo ranger' \ ncmpcpp='ncmpcpp -b .config/ncmpcpp/keybindings' \ jds='export _JAVA_AWT_WM_NONREPARENTING=1' \ jd='jdownloader' \ yt='ytfzf -lts' \ ytq='ytfzf -faH' \ leaf='notepadqq' \ qb='qbittorrent' \ jn='jupyter-notebook' \ polkit='/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1' #git #to escape single quotes -> replace ' with '\'' #The following wont work: #cut -d ' ' -f4 #awk '{print "$2"}' #cut -d\ -f4 alias \ g1='git add "$(git status -s | fzf | cut -b 1-3 --complement)"' \ gr='git restore --staged "$(git status -s | fzf | cut -b 1-3 --complement)"' \ g2='git commit -S -m' \ g3='git push "$(git remote show | fzf)" HEAD' \ gs='git status' \ gd='git diff --staged' \ gu='git remote update && git status -uno' \ glg="git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n''%C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all" #useful command line substitutions alias \ space='ncdu' \ h='cat $HISTFILE |fzf|"$CLIP"' \ sha='shasum -a 256' \ untar='tar -zxvf' \ untar2='tar xvf' \ cp='cp -iv' \ mv='mv -iv' \ mkd='mkdir -pv' \ myip="curl ipinfo.io/ip && echo """ \ myipc='curl -s ipinfo.io/ip | xargs -I {} geoiplookup {}' \ neofetch='neofetch --ascii .config/neofetch/arch-ascii.txt' \ ranger='ranger --choosedir=$HOME/.rangerdir; LASTDIR=`cat $HOME/.rangerdir`; cd "$LASTDIR"' \ recentpacks="grep -i installed /var/log/pacman.log |tac| fzf | cut -d' ' -f4 | "$CLIP" " \ scr='ffmpeg -f x11grab -i :0.0 out.mp4' \ ssw='IMG="pic-sel-$(date +%y-%m-%d--%H-%M-%S).png" && grim -g "$(slurp)" "$GRIM_DEFAULT_DIR/$IMG" && wl-copy < "$GRIM_DEFAULT_DIR/$IMG"' \ pas='pulseaudio --start' \ pak='pulseaudio --kill' \ pwr='systemctl --user restart wireplumber pipewire pipewire-pulse' \ pm='pulsemixer' \ ssha="echo 'ssh-keygen -t ed25519 -a 100 -f ~/.ssh/ -C '" \ br='brightnessctl set ' \ rs='redshift -P -O' \ prime='prime-run ' \ st='cd ~/.local/src/st' \ dwm='cd ~/.local/src/dwm' \ dwmblocks='cd ~/.local/src/dwmblocks' \ calc='quich' \ wlc='wl-copy' \ wlk='wl-copy' \ pw='pomodoro work' \ pb='pomodoro break' \ rm='trash -v' \ listdel='trash-list' \ restore='trash-restore' \ empty='trash-empty' \ q='exit'