diff options
Diffstat (limited to 'fedora/.config/shell')
| -rw-r--r-- | fedora/.config/shell/aliasrc | 1114 | ||||
| -rw-r--r-- | fedora/.config/shell/bm-files | 4 | ||||
| -rw-r--r-- | fedora/.config/shell/git-aliasrc | 415 | ||||
| -rw-r--r-- | fedora/.config/shell/inputrc | 31 | ||||
| -rw-r--r-- | fedora/.config/shell/profile | 263 |
5 files changed, 1005 insertions, 822 deletions
diff --git a/fedora/.config/shell/aliasrc b/fedora/.config/shell/aliasrc index 7d9e652..689699d 100644 --- a/fedora/.config/shell/aliasrc +++ b/fedora/.config/shell/aliasrc @@ -2,377 +2,743 @@ # balias - blank aliases (completed without space) # ialias - ignored aliases (not completed) -# sudo not required for some system commands -for command in blkid lsblk mount umount dnf poweroff reboot shutdown su updatedb; do - alias $command="sudo $command" -done -unset command - -case "$(readlink -f /sbin/init)" in -*systemd*) - # journal - alias -g jctl='journalctl -xe' - alias -g jctlou='sudo journalctl -b -n 200 -f' - alias -g rpi='systemctl --user restart wireplumber pipewire pipewire-pulse pipewire-jack' - alias -g sctl='systemctl' - alias -g sctlss='systemctl status' - alias -g sctle='systemctl enable' - alias -g sctld='systemctl disable' - alias -g sctlr='systemctl restart' - alias -g sctls='systemctl start' - alias -g sctlt='systemctl stop' - alias -g sctldr='systemctl daemon-reload' - alias -g tctl='timedatectl' - ;; -esac - -# Go back -alias ...='../..' -alias ....='../../..' -alias .....='../../../..' - -# bash -alias sbp="source ~/.config/bash/bash_profile" -alias sbs="source ~/.config/bash/bashrc" - -# cd -alias cf='cd "$(dirname "$(readlink -f health.lua)")"' -alias pd='cd -' - -# chmod -alias che='find . -type f -exec chmod +x {};' -alias chfd='find . -type d -exec chmod 755 {}; -o -type f -exec chmod 644 {};' -alias cx='chmod a+x' -alias 000='chmod -R 000' -alias 600='chmod -R 600' -alias 644='chmod -R 644' -alias 666='chmod -R 666' -alias 755='chmod -R 755' -alias 777='chmod -R 777' - -# copy -alias CC='$(fc -l -n -1) | xclip -selection clipboard' -ialias cp='cp -iv' -alias pwdc='pwd | xclip -selection clipboard' - -# count -alias countfiles="for t in files links directories; do echo \`find . -type \${t:0:1} | wc -l\` \$t; done 2> /dev/null" - -# cpu -alias cpu="grep 'cpu ' /proc/stat | awk '{usage=(\$2+\$4)*100/(\$2+\$4+\$5)} END {print usage}' | awk '{printf(\"%.1f\n\", \$1)}'" - -# curl -ialias curl='curl --silent --show-error' -balias clh='curl localhost:' -balias clh8='curl localhost:8080' -balias clh9='curl localhost:9080' -balias c100='curl 192.168.99.100:' - -# date -alias da="date '+%Y-%m-%d %A %T %Z'" - -# delete -alias _fd='find . -type f -name "._*" -print0 | xargs -0 rm -f' -alias _fp='find . -type f -name "._*" -print' - -# diff -ialias diff='diff --color' - -# disk -alias diskspace="du -S | sort -n -r |more" -alias folders="du -h --max-depth=1" -alias folderssort="find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn" -alias tree="tree -CAhF --dirsfirst" -alias treed="tree -CAFd" -alias mountedinfo="df -hT" - -# docker -alias dk='docker' -alias dkp='docker ps' -alias dkpa='docker ps -a' -alias dkpaq='docker ps -a -q' -alias dkb='docker build -t' -alias dkbnc='docker build --no-cache -t' -alias dkr='docker run --rm' -alias dkrti='docker run --rm -ti' -alias dkrd='docker run -d' -alias dkrp8='docker run --rm -p 8080:8080' -alias dkrp9='docker run --rm -p 9080:9080' -alias dks='docker start' -alias dkt='docker stop' -alias dktt='docker stop $(docker ps -q)' -alias dkk='docker kill' -alias dkkk='docker kill $(docker ps -q)' -alias dkrm='docker rm' -alias dkri='docker rmi' -alias dke='docker exec -ti' -alias dkl='docker logs -f' -alias dki='docker images' -alias dkpu='docker pull' -alias dkph='docker push' -alias dkin='docker inspect' -alias dkn='docker network' -alias dkc='docker-compose' -alias dkcu='docker-compose up' -alias dkclean='docker ps -q -a -f status=exited | xargs -r docker rm && docker images -q -f dangling=true | xargs -r docker rmi' - -# find -balias fdn='find . -name "' -alias f="find . | grep " - -# grep -ialias -g grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}' -alias grepi='grep -i' -alias grepr='grep -r' -alias grepri='grep -ri' -alias grepw='grep -R -i --include="*"' -alias grepb='grep -R -i --include="*" --exclude-dir="zsh"' -alias -g Gg='| grep' -alias -g Gi='| grep -i' -alias -g GH='| grep HTTP' - -# hash -alias h='hash -rf' - -# hexdump -alias hx='hexdump -C' - -# history -alias h="history | grep " - -# ip -ialias ip='ip -color=auto' -alias whatsmyip='curl -s ifconfig.me | xargs' -alias ipview="netstat -anpl | grep :80 | awk '{print $5}' | cut -d':' -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *$//'" - -# killall -alias ka='killall' -alias k9='kill -9' -alias k15='kill -15' - -# logs -alias logs="sudo find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f" - -# ls: eza or built-in -[ -x "$(command -v eza)" ] && { - ialias l='eza --icons --group-directories-first' - ialias la='eza --icons -aa --group-directories-first' - ialias lh='eza --icons -aa --group-directories-first' - ialias ll='eza -gl --icons --group-directories-first' - ialias lla='eza -glaa --icons --group-directories-first' - ialias lm='eza -glA --group-directories-first | more' - ialias lr='eza --icons -R --group-directories-first' - ialias ls='eza --icons -A --group-directories-first' - ialias lsb='eza --icons -b --group-directories-first' - ialias lsby='eza --icons -B --group-directories-first' - ialias lld='eza --icons -Dl --group-directories-first' - ialias llda='eza --icons -aaDl --group-directories-first' - ialias llf='eza --icons -fl' - ialias llfa='eza --icons -aafl' - ialias llsa='eza --icons -l -s=accessed' - ialias llsaa='eza --icons -aal -s=accessed' - ialias llsc='eza --icons -l -s=created' - ialias llsca='eza --icons -aal -s=created' - ialias llse='eza --icons -l -s=extension' - ialias llsea='eza --icons -aal -s=extension' - ialias llsm='eza --icons -l -s=modified' - ialias llsma='eza --icons -aal -s=modified' - ialias llsn='eza --icons -l -s=name' - ialias llsna='eza --icons -aal -s=name' - ialias llss='eza --icons -l -s=size' - ialias llssa='eza --icons -aal -s=size' - ialias llst='eza --icons -l -s=type' - ialias llsta='eza --icons -aal -s=type' - ialias lt='eza --icons -T -L' - ialias ltd='eza --icons -TD -L' - ialias ltdr='eza --icons -TDr -L' - ialias ltr='eza --icons -Tr -L' -} || { - ialias l='/usr/bin/ls -h --color=always --group-directories-first' - ialias la='/usr/bin/ls -alh --color=always --group-directories-first' - ialias ll='/usr/bin/ls -lh --color=always --group-directories-first' - ialias lla='/usr/bin/ls -aFls --color=always --group-directories-first' - ialias llf='/usr/bin/ls -Fls --color=always --group-directories-first' - ialias lm='/usr/bin/ls -alh --color=always --group-directories-first | more' - ialias lr='/usr/bin/ls -hlR --color=always --group-directories-first' - ialias lra='/usr/bin/ls -ahlR --color=always --group-directories-first' - ialias ls='/usr/bin/ls -AFh --color=always --group-directories-first' - ialias llsa='/usr/bin/ls -hlru --color=always --group-directories-first' - ialias llsc='/usr/bin/ls -hclr --color=always --group-directories-first' - ialias lld='/usr/bin/ls -l --color=always | grep "^d"' - ialias llda='/usr/bin/ls -la --color=always | grep "^d"' - ialias llse='/usr/bin/ls -BhlX --color=always --group-directories-first' - ialias llsf='/usr/bin/ls -l --color=always | grep -v "^d"' - ialias llsfa='/usr/bin/ls -la --color=always | grep -v "^d"' - ialias llsm='/usr/bin/ls -hlr --time=ctime --color=always --group-directories-first' - ialias llsn='/usr/bin/ls -alp --color=always --group-directories-first' - ialias llss='/usr/bin/ls -hlrS --color=always --group-directories-first' - ialias llst='/usr/bin/ls -hlrt --color=always --group-directories-first' - ialias lw='/usr/bin/ls -Ahx --color=always --group-directories-first' -} - -# mime -alias mimereset="update-desktop-database ${XDG_DATA_HOME:-${HOME}/.local/share}/applications" - -# mkdir -ialias mkdir='mkdir -pv' - -# modified commands -alias grep="/usr/bin/grep $GREP_OPTIONS" -alias cp="cp -i" -alias freshclam="sudo freshclam" -alias less="less -R" -alias mkdir="mkdir -p" -alias multitail="multitail --no-repeat -c" -alias mv="mv -i" -alias ping="ping -c 10" -alias ps="ps auxf" -alias rm="rm -iv" - -# move -ialias mv='mv -iv' - -# nginx -alias ngx="cd /etc/nginx" - -# vim -alias v='$EDITOR' -alias v.='$EDITOR .' -alias ve='$EDITOR -c enew' -alias vis="$EDITOR '+set si'" -alias vll='lastvim -l' -alias vln='$EDITOR -c '\''execute "edit " . v:oldfiles[0] | normal ''0'\' - -# ports -alias openports="netstat -nape --inet" - -# ps -ialias ps='ps auxf' -alias psj='ps aux | grep "[j]ava"' -balias psg='ps auxf | grep' -alias topcpu='/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10' - -# python -alias py='python3' - -# realpath -alias rp='realpath' - -# remove -ialias rm='rm -vI' - -# rsync -alias rsc='rsync -vrazPlu' -alias rscd='rsync -vrazPlu --delete' -alias rscr='rsync -vrazPlu --remove-source-files' - -# rules -alias rrr='sudo udevadm control --reload-rules' - -# scp -ialias scp='scp -r' - -# sha1 -alias sha1='openssl sha1' - -# shell -alias tobash="sudo chsh $USER -s /bin/bash && 'Now log out.'" -alias tozsh="sudo chsh $USER -s /bin/zsh && 'Now log out.'" -alias tofish="sudo chsh $USER -s /bin/fish && 'Now log out.'" - -# shellcheck -alias shck='shellcheck --color=always' - -# shortcut -alias ref='shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc' - -# sudo -alias su='sudo su -l root' -alias sm='setopt no_nomatch && rm -rf *.rej *.orig >/dev/null 2>&1' -alias smi='setopt no_nomatch && rm -rf *.rej *.orig >/dev/null 2>&1 && unsetopt no_nomatch; sudo make clean install; rm -f config.h' - -# suffix -alias -s {pdf,PDF}='background mupdf' -alias -s {jpg,JPG,png,PNG}='background gpicview' -alias -s {ods,ODS,odt,ODT,odp,ODP,doc,DOC,docx,DOCX,xls,XLS,xlsx,XLSX,xlsm,XLSM,ppt,PPT,pptx,PPTX,csv,CSV}='background libreoffice' -alias -s {html,HTML}='background chromium' -alias -s {mp4,MP4,mov,MOV,mkv,MKV}='background vlc' -alias -s {zip,ZIP,war,WAR}="unzip -l" -alias -s {jar,JAR}="java -jar" -alias -s gz="tar -tf" -alias -s {tgz,TGZ}="tar -tf" - -# tar -alias txf='tar -xf' -alias ttf='tar -tf' -alias mktar="tar -cvf" -alias mkbz2="tar -cvjf" -alias mkgz="tar -cvzf" -alias untar="tar -xvf" -alias unbz2="tar -xvjf" -alias ungz="tar -xvzf" - -# tmux -alias sts='tmux source $XDG_CONFIG_HOME/tmux/tmux.conf' -alias ta='tmux a' -alias tmc='tmuxcreate' -alias tmka='tmux kill-session -a' -alias tmls='tmux ls' -alias tmo='tmuxopen' -alias tmpk='command pkill tmux' -alias tm.='tmux new -s "$(basename $PWD)"' - -# tor -alias torh="cat /var/lib/tor/hidden_service/hostname" - -# trash -alias trd='trash-rm' -alias tre='trash-empty' -alias trl='trash-list' -alias trp='trash-put' -alias trr='trash-restore' - -# tree -ialias tree='tree -a -I ".svn|.git|.hg|.idea"' -alias tree2='tree -L 2' -alias tree3='tree -L 3' - -# unix -alias -g md='mkdir -p' -alias -g wh='which' -alias -g wt='while true; do' -alias -g s1='sleep 1' -alias -g s2='sleep 2' -alias -g s01='sleep 0.1' -alias -g s05='sleep 0.5' -alias -g A1="| awk '{print \$1}'" -alias -g L='| less' -alias -g H='| head' -alias -g H2='| head -n 20' -alias -g X='| xargs -I@' -alias -g C='| xclip -selection clipboard' -alias -g Fj='| jq .' -alias -g Fy='| yq .' -alias -g Fx='| xmllint --format -' -alias -g V='| vim -' - -# unzip -alias uz='unzip' -alias uzl='unzip -l' - -# vim -alias vi='vim' -alias vi.='vim .' - -# watch -alias w1='watch -n 1' - -# wget -ialias wget --hsts-file="${XDG_CACHE_HOME:-${HOME}/.cache}/wget-hsts" - -# xprog -alias progn='xprop | awk '\''/^WM_CLASS/{sub(/.* = /, "instance:"); sub(/, /, "\nclass:"); print} /^WM_NAME/{sub(/.* = /, "title:"); print}'\''' - -# zsh -alias sps="source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile" -alias szs="source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc" +if [ -n "$BASH_VERSION" ]; then + # ------------------------------ + # BASH-compatible aliases & functions + # ------------------------------ + + # helper: safe alias creation + _a() { alias "$1"="$2"; } + + # sudo not required for some system commands + for command in blkid lsblk mount umount dnf poweroff reboot shutdown su updatedb; do + alias "$command"="sudo $command" + done + + # systemd checks (keep as in original) + case "$(readlink -f /sbin/init)" in + *systemd*) + # journal-like commands as functions (replaces zsh global aliases) + jctl() { journalctl -xe "$@"; } + jctlou() { sudo journalctl -b -n 200 -f "$@"; } + rpi() { systemctl --user restart wireplumber pipewire pipewire-pulse pipewire-jack "$@"; } + + # systemctl helpers + sctl() { systemctl "$@"; } # general wrapper + sctlss() { systemctl status "$@"; } + sctle() { systemctl enable "$@"; } + sctld() { systemctl disable "$@"; } + sctlr() { systemctl restart "$@"; } + sctls() { systemctl start "$@"; } + sctlt() { systemctl stop "$@"; } + sctldr() { systemctl daemon-reload "$@"; } + + tctl() { timedatectl "$@"; } + ;; + esac + + # navigation + alias ...='../..' + alias ....='../../..' + alias .....='../../../..' + + # bash profile helpers + alias sbp="source ~/.config/bash/bash_profile" + alias sbs="source ~/.config/bash/bashrc" + + # cd helpers + cf() { cd "$(dirname "$(readlink -f health.lua)")" || return; } + alias pd='cd -' + + # chmod helpers (keep behavior) + alias che='find . -type f -exec chmod +x {} \;' + # chfd: set directories 755, files 644 (safe implementation) + chfd() { find . -type d -exec chmod 755 {} \; -o -type f -exec chmod 644 {} \;; } + alias cx='chmod a+x' + alias 000='chmod -R 000' + alias 600='chmod -R 600' + alias 644='chmod -R 644' + alias 666='chmod -R 666' + alias 755='chmod -R 755' + alias 777='chmod -R 777' + + # copy / clipboard + # last command copy (approx): copy last history entry to clipboard + CC() { eval "$(fc -ln -1)" | xclip -selection clipboard; } + alias cp='cp -iv' + alias pwdc='pwd | xclip -selection clipboard' + + # count files/links/dirs + alias countfiles='for t in files links directories; do echo "$(find . -type ${t:0:1} | wc -l) $t"; done 2>/dev/null' + + # cpu usage + cpu() { awk '/^cpu /{usage=($2+$4)*100/($2+$4+$5)} END{printf "%.1f\n",usage}' /proc/stat; } + + # curl + alias curl='curl --silent --show-error' + alias clh='curl localhost:' + alias clh8='curl localhost:8080' + alias clh9='curl localhost:9080' + alias c100='curl 192.168.99.100:' + + # date + alias da="date '+%Y-%m-%d %A %T %Z'" + + # delete helpers + alias _fd='find . -type f -name "._*" -print0 | xargs -0 rm -f' + alias _fp='find . -type f -name "._*" -print' + + # diff + alias diff='diff --color' + + # disk + alias diskspace="du -S | sort -n -r | more" + alias folders="du -h --max-depth=1" + alias folderssort="find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn" + alias tree="tree -CAhF --dirsfirst" + alias treed="tree -CAFd" + alias mountedinfo="df -hT" + + # docker + alias dk='docker' + alias dkp='docker ps' + alias dkpa='docker ps -a' + alias dkpaq='docker ps -a -q' + alias dkb='docker build -t' + alias dkbnc='docker build --no-cache -t' + alias dkr='docker run --rm' + alias dkrti='docker run --rm -ti' + alias dkrd='docker run -d' + alias dkrp8='docker run --rm -p 8080:8080' + alias dkrp9='docker run --rm -p 9080:9080' + alias dks='docker start' + alias dkt='docker stop' + alias dktt='docker stop $(docker ps -q)' + alias dkk='docker kill' + alias dkkk='docker kill $(docker ps -q)' + alias dkrm='docker rm' + alias dkri='docker rmi' + alias dke='docker exec -ti' + alias dkl='docker logs -f' + alias dki='docker images' + alias dkpu='docker pull' + alias dkph='docker push' + alias dkin='docker inspect' + alias dkn='docker network' + alias dkc='docker-compose' + alias dkcu='docker-compose up' + alias dkclean='docker ps -q -a -f status=exited | xargs -r docker rm && docker images -q -f dangling=true | xargs -r docker rmi' + + # find + alias fdn='find . -name "' + f() { find . | grep "$*"; } + + # grep: replace zsh global and colored exclude + alias grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}' + alias grepi='grep -i' + alias grepr='grep -r' + alias grepri='grep -ri' + alias grepw='grep -R -i --include="*"' + alias grepb='grep -R -i --include="*" --exclude-dir="zsh"' + # global-like helpers implemented as functions that read stdin: + Gg() { grep "$@"; } # usage: somecommand | Gg pattern + Gi() { grep -i "$@"; } + GH() { grep -i "HTTP" "$@"; } + + # hash + alias h='hash -r' + + # hexdump + alias hx='hexdump -C' + + # history + Hgrep() { history | grep "$*"; } # note: alias h was used earlier; avoid conflict + + # ip + alias ip='ip -color=auto' + alias whatsmyip='curl -s ifconfig.me | xargs' + ipview() { netstat -anpl | grep :80 | awk '{print $5}' | cut -d':' -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *$//'; } + + # killall + alias ka='killall' + alias k9='kill -9' + alias k15='kill -15' + + # logs + logs() { sudo find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e 's/:$//g' | grep -v '[0-9]$' | xargs tail -f; } + + # ls: use eza if available else fallback to ls + if command -v eza >/dev/null 2>&1; then + alias l='eza --icons --group-directories-first' + alias la='eza --icons -aa --group-directories-first' + alias lh='eza --icons -aa --group-directories-first' + alias ll='eza -gl --icons --group-directories-first' + alias lla='eza -glaa --icons --group-directories-first' + alias lm='eza -glA --group-directories-first | more' + alias lr='eza --icons -R --group-directories-first' + alias ls='eza --icons -A --group-directories-first' + else + alias l='/usr/bin/ls -h --color=always --group-directories-first' + alias la='/usr/bin/ls -alh --color=always --group-directories-first' + alias ll='/usr/bin/ls -lh --color=always --group-directories-first' + alias lla='/usr/bin/ls -aFls --color=always --group-directories-first' + alias llf='/usr/bin/ls -Fls --color=always --group-directories-first' + alias lm='/usr/bin/ls -alh --color=always --group-directories-first | more' + alias lr='/usr/bin/ls -hlR --color=always --group-directories-first' + alias ls='/usr/bin/ls -AFh --color=always --group-directories-first' + fi + + # mime + alias mimereset='update-desktop-database ${XDG_DATA_HOME:-${HOME}/.local/share}/applications' + + # mkdir + alias mkdir='mkdir -pv' + function mkdir() { command mkdir -pv "$@"; } + + # modified commands (keep cautious variants) + alias grep="/usr/bin/grep $GREP_OPTIONS" + alias freshclam="sudo freshclam" + alias less="less -R" + alias multitail="multitail --no-repeat -c" + alias mv="mv -i" + alias ping="ping -c 10" + alias ps="ps auxf" + alias rm="rm -iv" + + # move + alias mv='mv -iv' + + # nginx + alias ngx="cd /etc/nginx" + + # vim helpers + alias v="$EDITOR" + alias 'v.'="$EDITOR ." + alias ve="$EDITOR -c enew" + vis() { $EDITOR '+set si' "$@"; } + vll() { lastfiles -l "$@"; } + vln() { $EDITOR -c "execute 'edit ' . v:oldfiles[0] | normal '0'" "$@"; } + + # ports + alias openports="netstat -nape --inet" + + # ps + alias ps='ps auxf' + alias psj='ps aux | grep "[j]ava"' + psg() { ps auxf | grep "$*"; } + alias topcpu='/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10' + + # python + alias py='python3' + + # realpath + alias rp='realpath' + + # remove + alias rm='rm -vI' + + # rsync + alias rsc='rsync -vrazPlu' + alias rscd='rsync -vrazPlu --delete' + alias rscr='rsync -vrazPlu --remove-source-files' + + # rules + alias rrr='sudo udevadm control --reload-rules' + + # scp + alias scp='scp -r' + + # sha1 + alias sha1='openssl sha1' + + # shell switching helpers (need sudo) + alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'" + alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'" + alias tofish="sudo chsh $USER -s /bin/fish && echo 'Now log out.'" + + # shellcheck + alias shck='shellcheck --color=always' + + # ref/shortcut loader (keep as in original) + ref() { bmshortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc; } + + # sudo helpers + alias su='sudo su -l root' + sm() { rm -rf -- *.rej *.orig >/dev/null 2>&1 || true; } + smi() { rm -rf -- *.rej *.orig >/dev/null 2>&1; sudo make clean install; rm -f config.h; } + + # -------- suffix alias replacement: provide 'open' function ---------- + # zsh's "alias -s ext='cmd'" doesn't exist in bash. + # Use `open` (or 'of') to open files by extension: + openf() { + for f in "$@"; do + case "${f##*.}" in + pdf|PDF) mupdf "$f" & ;; + jpg|JPG|png|PNG) gpicview "$f" & ;; + ods|ODS|odt|ODT|odp|ODP|doc|DOC|docx|DOCX|xls|XLS|xlsx|XLSX|xlsm|XLSM|ppt|PPT|pptx|PPTX|csv|CSV) + libreoffice "$f" & ;; + html|HTML) chromium "$f" & ;; + mp4|MP4|mov|MOV|mkv|MKV) vlc "$f" & ;; + zip|ZIP|war|WAR) unzip -l "$f" ;; + jar|JAR) java -jar "$f" ;; + gz) tar -tf "$f" ;; + tgz|TGZ) tar -tf "$f" ;; + *) ${EDITOR:-vi} "$f" ;; + esac + done + } + alias of='openf' + alias open='openf' + + # tarring helpers + alias txf='tar -xf' + alias ttf='tar -tf' + alias mktar="tar -cvf" + alias mkbz2="tar -cvjf" + alias mkgz="tar -cvzf" + alias untar="tar -xvf" + alias unbz2="tar -xvjf" + alias ungz="tar -xvzf" + + # tmux + alias sts='tmux source $XDG_CONFIG_HOME/tmux/tmux.conf' + alias ta='tmux a' + alias tmc='tmuxcreate' + alias tmka='tmux kill-session -a' + alias tmls='tmux ls' + alias tmo='tmuxopen' + alias tmpk='command pkill tmux' + tm_new() { tmux new -s "$(basename "$PWD")"; } + alias tm.='tm_new' + + # trash + alias trd='trash-rm' + alias tre='trash-empty' + alias trl='trash-list' + alias trp='trash-put' + alias trr='trash-restore' + + # tree + alias tree='tree -a -I ".svn|.git|.hg|.idea"' + alias tree2='tree -L 2' + alias tree3='tree -L 3' + + # small unix helpers (converted global aliases -> functions) + md() { mkdir -p "$@"; } + wh() { which "$@"; } + wt() { while true; do "$@"; done } # usage differs from zsh's global alias + s1() { sleep 1; } + s2() { sleep 2; } + s01() { sleep 0.1; } + s05() { sleep 0.5; } + A1() { awk '{print $1}' "$@"; } + L() { less "$@"; } + H() { head "$@"; } + H2() { head -n 20 "$@"; } + X() { xargs -I@ "$@"; } # limited replacement + C() { xclip -selection clipboard "$@"; } + Fj() { jq . "$@"; } + Fy() { yq . "$@"; } + Fx() { xmllint --format "$@"; } + V() { vim - "$@"; } + + # unzip + alias uz='unzip' + alias uzl='unzip -l' + + # vim + alias vi='vim' + alias 'vi.'='vim .' + + # watch + alias w1='watch -n 1' + + # wget + # keep hsts path variable + alias wget="wget --hsts-file='${XDG_CACHE_HOME:-${HOME}/.cache}/wget-hsts'" + + # xprop helper + progn() { xprop | awk '/^WM_CLASS/{sub(/.* = /, "instance:"); sub(/, /, "\nclass:"); print} /^WM_NAME/{sub(/.* = /, "title:"); print}'; } + + # zsh sourcing helpers (just source config) + sps() { source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile; } + szs() { source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc; } +else + # ------------------------------ + # ZSH-compatible aliases & functions + # ------------------------------ + # sudo not required for some system commands + for command in blkid lsblk mount umount dnf poweroff reboot shutdown su updatedb; do + alias $command="sudo $command" + done + unset command + + case "$(readlink -f /sbin/init)" in + *systemd*) + # journal + alias -g jctl='journalctl -xe' + alias -g jctlou='sudo journalctl -b -n 200 -f' + alias -g rpi='systemctl --user restart wireplumber pipewire pipewire-pulse pipewire-jack' + alias -g sctl='systemctl' + alias -g sctlss='systemctl status' + alias -g sctle='systemctl enable' + alias -g sctld='systemctl disable' + alias -g sctlr='systemctl restart' + alias -g sctls='systemctl start' + alias -g sctlt='systemctl stop' + alias -g sctldr='systemctl daemon-reload' + alias -g tctl='timedatectl' + ;; + esac + + # Go back + alias ...='../..' + alias ....='../../..' + alias .....='../../../..' + + # bash + alias sbp="source ~/.config/bash/bash_profile" + alias sbs="source ~/.config/bash/bashrc" + + # cd + alias cf='cd "$(dirname "$(readlink -f health.lua)")"' + alias pd='cd -' + + # chmod + alias che='find . -type f -exec chmod +x {};' + alias chfd='find . -type d -exec chmod 755 {}; -o -type f -exec chmod 644 {};' + alias cx='chmod a+x' + alias 000='chmod -R 000' + alias 600='chmod -R 600' + alias 644='chmod -R 644' + alias 666='chmod -R 666' + alias 755='chmod -R 755' + alias 777='chmod -R 777' + + # copy + alias CC='$(fc -l -n -1) | xclip -selection clipboard' + ialias cp='cp -iv' + alias pwdc='pwd | xclip -selection clipboard' + + # count + alias countfiles="for t in files links directories; do echo \`find . -type \${t:0:1} | wc -l\` \$t; done 2> /dev/null" + + # cpu + alias cpu="grep 'cpu ' /proc/stat | awk '{usage=(\$2+\$4)*100/(\$2+\$4+\$5)} END {print usage}' | awk '{printf(\"%.1f\n\", \$1)}'" + + # curl + ialias curl='curl --silent --show-error' + balias clh='curl localhost:' + balias clh8='curl localhost:8080' + balias clh9='curl localhost:9080' + balias c100='curl 192.168.99.100:' + + # date + alias da="date '+%Y-%m-%d %A %T %Z'" + + # delete + alias _fd='find . -type f -name "._*" -print0 | xargs -0 rm -f' + alias _fp='find . -type f -name "._*" -print' + + # diff + ialias diff='diff --color' + + # disk + alias diskspace="du -S | sort -n -r |more" + alias folders="du -h --max-depth=1" + alias folderssort="find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn" + alias tree="tree -CAhF --dirsfirst" + alias treed="tree -CAFd" + alias mountedinfo="df -hT" + + # docker + alias dk='docker' + alias dkp='docker ps' + alias dkpa='docker ps -a' + alias dkpaq='docker ps -a -q' + alias dkb='docker build -t' + alias dkbnc='docker build --no-cache -t' + alias dkr='docker run --rm' + alias dkrti='docker run --rm -ti' + alias dkrd='docker run -d' + alias dkrp8='docker run --rm -p 8080:8080' + alias dkrp9='docker run --rm -p 9080:9080' + alias dks='docker start' + alias dkt='docker stop' + alias dktt='docker stop $(docker ps -q)' + alias dkk='docker kill' + alias dkkk='docker kill $(docker ps -q)' + alias dkrm='docker rm' + alias dkri='docker rmi' + alias dke='docker exec -ti' + alias dkl='docker logs -f' + alias dki='docker images' + alias dkpu='docker pull' + alias dkph='docker push' + alias dkin='docker inspect' + alias dkn='docker network' + alias dkc='docker-compose' + alias dkcu='docker-compose up' + alias dkclean='docker ps -q -a -f status=exited | xargs -r docker rm && docker images -q -f dangling=true | xargs -r docker rmi' + + # find + balias fdn='find . -name "' + alias f="find . | grep " + + # grep + ialias -g grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}' + alias grepi='grep -i' + alias grepr='grep -r' + alias grepri='grep -ri' + alias grepw='grep -R -i --include="*"' + alias grepb='grep -R -i --include="*" --exclude-dir="zsh"' + alias -g Gg='| grep' + alias -g Gi='| grep -i' + alias -g GH='| grep HTTP' + + # hash + alias h='hash -rf' + + # hexdump + alias hx='hexdump -C' + + # history + alias h="history | grep " + + # ip + ialias ip='ip -color=auto' + alias whatsmyip='curl -s ifconfig.me | xargs' + alias ipview="netstat -anpl | grep :80 | awk '{print $5}' | cut -d':' -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *$//'" + + # killall + alias ka='killall' + alias k9='kill -9' + alias k15='kill -15' + + # logs + alias logs="sudo find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f" + + # ls: eza or built-in + [ -x "$(command -v eza)" ] && { + ialias l='eza --icons --group-directories-first' + ialias la='eza --icons -aa --group-directories-first' + ialias lh='eza --icons -aa --group-directories-first' + ialias ll='eza -gl --icons --group-directories-first' + ialias lla='eza -glaa --icons --group-directories-first' + ialias lm='eza -glA --group-directories-first | more' + ialias lr='eza --icons -R --group-directories-first' + ialias ls='eza --icons -A --group-directories-first' + ialias lsb='eza --icons -b --group-directories-first' + ialias lsby='eza --icons -B --group-directories-first' + ialias lld='eza --icons -Dl --group-directories-first' + ialias llda='eza --icons -aaDl --group-directories-first' + ialias llf='eza --icons -fl' + ialias llfa='eza --icons -aafl' + ialias llsa='eza --icons -l -s=accessed' + ialias llsaa='eza --icons -aal -s=accessed' + ialias llsc='eza --icons -l -s=created' + ialias llsca='eza --icons -aal -s=created' + ialias llse='eza --icons -l -s=extension' + ialias llsea='eza --icons -aal -s=extension' + ialias llsm='eza --icons -l -s=modified' + ialias llsma='eza --icons -aal -s=modified' + ialias llsn='eza --icons -l -s=name' + ialias llsna='eza --icons -aal -s=name' + ialias llss='eza --icons -l -s=size' + ialias llssa='eza --icons -aal -s=size' + ialias llst='eza --icons -l -s=type' + ialias llsta='eza --icons -aal -s=type' + ialias lt='eza --icons -T -L' + ialias ltd='eza --icons -TD -L' + ialias ltdr='eza --icons -TDr -L' + ialias ltr='eza --icons -Tr -L' + } || { + ialias l='/usr/bin/ls -h --color=always --group-directories-first' + ialias la='/usr/bin/ls -alh --color=always --group-directories-first' + ialias ll='/usr/bin/ls -lh --color=always --group-directories-first' + ialias lla='/usr/bin/ls -aFls --color=always --group-directories-first' + ialias llf='/usr/bin/ls -Fls --color=always --group-directories-first' + ialias lm='/usr/bin/ls -alh --color=always --group-directories-first | more' + ialias lr='/usr/bin/ls -hlR --color=always --group-directories-first' + ialias lra='/usr/bin/ls -ahlR --color=always --group-directories-first' + ialias ls='/usr/bin/ls -AFh --color=always --group-directories-first' + ialias llsa='/usr/bin/ls -hlru --color=always --group-directories-first' + ialias llsc='/usr/bin/ls -hclr --color=always --group-directories-first' + ialias lld='/usr/bin/ls -l --color=always | grep "^d"' + ialias llda='/usr/bin/ls -la --color=always | grep "^d"' + ialias llse='/usr/bin/ls -BhlX --color=always --group-directories-first' + ialias llsf='/usr/bin/ls -l --color=always | grep -v "^d"' + ialias llsfa='/usr/bin/ls -la --color=always | grep -v "^d"' + ialias llsm='/usr/bin/ls -hlr --time=ctime --color=always --group-directories-first' + ialias llsn='/usr/bin/ls -alp --color=always --group-directories-first' + ialias llss='/usr/bin/ls -hlrS --color=always --group-directories-first' + ialias llst='/usr/bin/ls -hlrt --color=always --group-directories-first' + ialias lw='/usr/bin/ls -Ahx --color=always --group-directories-first' + } + + # mime + alias mimereset="update-desktop-database ${XDG_DATA_HOME:-${HOME}/.local/share}/applications" + + # mkdir + ialias mkdir='mkdir -pv' + + # modified commands + alias grep="/usr/bin/grep $GREP_OPTIONS" + alias cp="cp -i" + alias freshclam="sudo freshclam" + alias less="less -R" + alias mkdir="mkdir -p" + alias multitail="multitail --no-repeat -c" + alias mv="mv -i" + alias ping="ping -c 10" + alias ps="ps auxf" + alias rm="rm -iv" + + # move + ialias mv='mv -iv' + + # nginx + alias ngx="cd /etc/nginx" + + # vim + alias v='$EDITOR' + alias v.='$EDITOR .' + alias ve='$EDITOR -c enew' + alias vis="$EDITOR '+set si'" + alias vll='lastfiles -l' + alias vln='$EDITOR -c '\''execute "edit " . v:oldfiles[0] | normal ''0'\' + + # ports + alias openports="netstat -nape --inet" + + # ps + ialias ps='ps auxf' + alias psj='ps aux | grep "[j]ava"' + balias psg='ps auxf | grep' + alias topcpu='/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10' + + # python + alias py='python3' + + # realpath + alias rp='realpath' + + # remove + ialias rm='rm -vI' + + # rsync + alias rsc='rsync -vrazPlu' + alias rscd='rsync -vrazPlu --delete' + alias rscr='rsync -vrazPlu --remove-source-files' + + # rules + alias rrr='sudo udevadm control --reload-rules' + + # scp + ialias scp='scp -r' + + # sha1 + alias sha1='openssl sha1' + + # shell + alias tobash="sudo chsh $USER -s /bin/bash && 'Now log out.'" + alias tozsh="sudo chsh $USER -s /bin/zsh && 'Now log out.'" + alias tofish="sudo chsh $USER -s /bin/fish && 'Now log out.'" + + # shellcheck + alias shck='shellcheck --color=always' + + # shortcut + alias ref='bmshortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc' + + # sudo + alias su='sudo su -l root' + alias sm='setopt no_nomatch && rm -rf *.rej *.orig >/dev/null 2>&1' + alias smi='setopt no_nomatch && rm -rf *.rej *.orig >/dev/null 2>&1 && unsetopt no_nomatch; sudo make clean install; rm -f config.h' + + # suffix + alias -s {pdf,PDF}='background mupdf' + alias -s {jpg,JPG,png,PNG}='background gpicview' + alias -s {ods,ODS,odt,ODT,odp,ODP,doc,DOC,docx,DOCX,xls,XLS,xlsx,XLSX,xlsm,XLSM,ppt,PPT,pptx,PPTX,csv,CSV}='background libreoffice' + alias -s {html,HTML}='background chromium' + alias -s {mp4,MP4,mov,MOV,mkv,MKV}='background vlc' + alias -s {zip,ZIP,war,WAR}="unzip -l" + alias -s {jar,JAR}="java -jar" + alias -s gz="tar -tf" + alias -s {tgz,TGZ}="tar -tf" + + # tar + alias txf='tar -xf' + alias ttf='tar -tf' + alias mktar="tar -cvf" + alias mkbz2="tar -cvjf" + alias mkgz="tar -cvzf" + alias untar="tar -xvf" + alias unbz2="tar -xvjf" + alias ungz="tar -xvzf" + + # tmux + alias sts='tmux source $XDG_CONFIG_HOME/tmux/tmux.conf' + alias ta='tmux a' + alias tmc='tmuxcreate' + alias tmka='tmux kill-session -a' + alias tmls='tmux ls' + alias tmo='tmuxopen' + alias tmpk='command pkill tmux' + alias tm.='tmux new -s "$(basename $PWD)"' + + # tor + alias torh="cat /var/lib/tor/hidden_service/hostname" + + # trash + alias trd='trash-rm' + alias tre='trash-empty' + alias trl='trash-list' + alias trp='trash-put' + alias trr='trash-restore' + + # tree + ialias tree='tree -a -I ".svn|.git|.hg|.idea"' + alias tree2='tree -L 2' + alias tree3='tree -L 3' + + # unix + alias -g md='mkdir -p' + alias -g wh='which' + alias -g wt='while true; do' + alias -g s1='sleep 1' + alias -g s2='sleep 2' + alias -g s01='sleep 0.1' + alias -g s05='sleep 0.5' + alias -g A1="| awk '{print \$1}'" + alias -g L='| less' + alias -g H='| head' + alias -g H2='| head -n 20' + alias -g X='| xargs -I@' + alias -g C='| xclip -selection clipboard' + alias -g Fj='| jq .' + alias -g Fy='| yq .' + alias -g Fx='| xmllint --format -' + alias -g V='| vim -' + + # unzip + alias uz='unzip' + alias uzl='unzip -l' + + # vim + alias vi='vim' + alias vi.='vim .' + + # watch + alias w1='watch -n 1' + + # wget + ialias wget --hsts-file="${XDG_CACHE_HOME:-${HOME}/.cache}/wget-hsts" + + # xprog + alias progn='xprop | awk '\''/^WM_CLASS/{sub(/.* = /, "instance:"); sub(/, /, "\nclass:"); print} /^WM_NAME/{sub(/.* = /, "title:"); print}'\''' + + # zsh + alias sps="source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile" + alias szs="source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc" +fi diff --git a/fedora/.config/shell/bm-files b/fedora/.config/shell/bm-files index 0be00a6..a7ee21d 100644 --- a/fedora/.config/shell/bm-files +++ b/fedora/.config/shell/bm-files @@ -8,12 +8,12 @@ vga ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc vgc ${XDG_CONFIG_HOME:-${HOME}/.config}/git/config # Git config vgi ${XDG_CONFIG_HOME:-${HOME}/.config}/git/ignore # Git ignore Vsm /etc/samba/smb.conf # Samba config +vsa ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by shell (and potentially other shells) +vsp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Shell profile used for system vtm ${XDG_CONFIG_HOME:-${HOME}/.config}/tmux/tmux.conf # Tmux config vvc ${XDG_CONFIG_HOME:-${HOME}/.config}/vim/vimrc # Vim config vvi ${XDG_CONFIG_HOME:-${HOME}/.config}/vim/init.vim # Vim init vvp ${XDG_CONFIG_HOME:-${HOME}/.config}/vim/plugins.vim # Vim plugins -vza ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by zsh (and potentially other shells) vzc ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/.zshrc # Zsh config vzk ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/keymaps.zsh # Zsh keymaps -vzp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Zsh profile used for system vzs ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/scripts.zsh # Zsh scripts diff --git a/fedora/.config/shell/git-aliasrc b/fedora/.config/shell/git-aliasrc deleted file mode 100644 index f87a556..0000000 --- a/fedora/.config/shell/git-aliasrc +++ /dev/null @@ -1,415 +0,0 @@ -# Git version checking -autoload -Uz is-at-least -git_version="${${(As: :)$(git version 2>/dev/null)}[3]}" - -# -# Functions Current -# (sorted alphabetically by function name) -# (order should follow README) -# - -# The name of the current branch -# Back-compatibility wrapper for when this function was defined here in -# the plugin, before being pulled in to core lib/git.zsh as git_current_branch() -# to fix the core -> git plugin dependency. -current_branch() { - git_current_branch -} - -# Check for develop and similarly named branches -git_develop_branch() { - command git rev-parse --git-dir &>/dev/null || return - local branch - for branch in dev devel develop development; do - if command git show-ref -q --verify refs/heads/$branch; then - echo $branch - return 0 - fi - done - - echo develop - return 1 -} - -# Check if main exists and use instead of master -git_main_branch() { - command git rev-parse --git-dir &>/dev/null || return - local ref - for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}; do - if command git show-ref -q --verify $ref; then - echo ${ref:t} - return 0 - fi - done - - # If no main branch was found, fall back to master but return error - echo master - return 1 -} - -grename() { - if [[ -z "$1" || -z "$2" ]]; then - echo "Usage: $0 old_branch new_branch" - return 1 - fi - - # Rename branch locally - git branch -m "$1" "$2" - # Rename branch in origin remote - if git push origin :"$1"; then - git push --set-upstream origin "$2" - fi -} - -# -# Functions Work in Progress (WIP) -# (sorted alphabetically by function name) -# (order should follow README) -# - -# Similar to `gunwip` but recursive "Unwips" all recent `--wip--` commits not just the last one -gunwipall() { - local _commit=$(git log --grep='--wip--' --invert-grep --max-count=1 --format=format:%H) - - # Check if a commit without "--wip--" was found and it's not the same as HEAD - if [[ "$_commit" != "$(git rev-parse HEAD)" ]]; then - git reset $_commit || return 1 - fi -} - -# Warn if the current branch is a WIP -work_in_progress() { - command git -c log.showSignature=false log -n 1 2>/dev/null | grep -q -- "--wip--" && echo "WIP!!" -} - -# -# Aliases -# (sorted alphabetically by command) -# (order should follow README) -# (in some cases force the alisas order to match README, like for example gke and gk) -# - -alias grt='cd "$(git rev-parse --show-toplevel || echo .)"' - -ggpnp() { - if [[ "$#" == 0 ]]; then - ggl && ggp - else - ggl "${*}" && ggp "${*}" - fi -} -compdef _git ggpnp=git-checkout - -alias ggpur='ggu' -alias g='git' -! pidof transmission-daemon >/dev/null && alias gaa='git add --all' || alias gaa='echo "Turn off transmission-daemon first!"' -alias gapa='git add --patch' -alias gau='git add --update' -alias gav='git add --verbose' -alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign --message "--wip-- [skip ci]"' -alias gam='git am' -alias gama='git am --abort' -alias gamc='git am --continue' -alias gamscp='git am --show-current-patch' -alias gams='git am --skip' -alias gap='git apply' -alias gapt='git apply --3way' -alias gbs='git bisect' -alias gbsb='git bisect bad' -alias gbsg='git bisect good' -alias gbsn='git bisect new' -alias gbso='git bisect old' -alias gbsr='git bisect reset' -alias gbss='git bisect start' -alias gb='git branch' -alias gba='git branch --all' -alias gbD='git branch --delete --force' - -gbda() { - git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch --delete 2>/dev/null -} - -# Copied and modified from James Roeder (jmaroeder) under MIT License -# https://github.com/jmaroeder/plugin-git/blob/216723ef4f9e8dde399661c39c80bdf73f4076c4/functions/gbda.fish -gbds() { - local default_branch=$(git_main_branch) - (( ! $? )) || default_branch=$(git_develop_branch) - - git for-each-ref refs/heads/ "--format=%(refname:short)" | \ - while read branch; do - local merge_base=$(git merge-base $default_branch $branch) - if [[ $(git cherry $default_branch $(git commit-tree $(git rev-parse $branch\^{tree}) -p $merge_base -m _)) = -* ]]; then - git branch -D $branch - fi - done -} - -alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -d' -alias gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -D' -alias gbm='git branch --move' -alias gbnm='git branch --no-merged' -alias gbr='git branch --remote' -alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)' -alias gbg='LANG=C git branch -vv | grep ": gone\]"' -alias gcor='git checkout --recurse-submodules' -alias gcB='git checkout -B' -alias gcd='git checkout $(git_develop_branch)' -alias gcm='git checkout $(git_main_branch)' -alias gcpa='git cherry-pick --abort' -alias gcpc='git cherry-pick --continue' -alias gcl='git clone --recurse-submodules' - -gccd() { - setopt localoptions extendedglob - - # get repo URI from args based on valid formats: https://git-scm.com/docs/git-clone#URLS - local repo='${${@[(r)(ssh://*|git://*|ftp(s)#://*|http(s)#://*|*@*)(.git/#)#]}:-$_}' - - # clone repository and exit if it fails - command git clone --recurse-submodules "$@" || return - - # if last arg passed was a directory, that's where the repo was cloned - # otherwise parse the repo URI and use the last part as the directory - [[ -d "$_" ]] && cd '$_' || cd '${${repo:t}%.git/#}' -} -compdef _git gccd=git-clone - -alias gcam='git commit --all --message' -alias gcas='git commit --all --signoff' -alias gcasm='git commit --all --signoff --message' -alias gcs='git commit --gpg-sign' -alias gcss='git commit --gpg-sign --signoff' -alias gcssm='git commit --gpg-sign --signoff --message' -alias gcmsg='git commit --message' -alias gcsm='git commit --signoff --message' -alias gc='git commit --verbose' -alias gca='git commit --verbose --all' -alias gca!='git commit --verbose --all --amend' -alias gcan!='git commit --verbose --all --no-edit --amend' -alias gcans!='git commit --verbose --all --signoff --no-edit --amend' -alias gc!='git commit --verbose --amend' -alias gcn!='git commit --verbose --no-edit --amend' -alias gdct='git describe --tags $(git rev-list --tags --max-count=1)' -alias gdca='git diff --cached' -alias gdcw='git diff --cached --word-diff' -alias gds='git diff --staged' -alias gdw='git diff --word-diff' - -gdv() { git diff -w "$@" | view - } -compdef _git gdv=git-diff - -alias gdup='git diff @{upstream}' - -gdnolock() { - git diff "$@" ":(exclude)package-lock.json" ":(exclude)*.lock" -} -compdef _git gdnolock=git-diff - -alias gdt='git diff-tree --no-commit-id --name-only -r' -alias gf='git fetch' -# --jobs=<n> was added in git 2.8 -is-at-least 2.8 "$git_version" \ - && alias gfa='git fetch --all --prune --jobs=10' \ - || alias gfa='git fetch --all --prune' -alias gfo='git fetch origin' -alias gg='git gui citool' -alias gga='git gui citool --amend' -alias ghh='git help' -alias glgg='git log --graph' -alias glggp='git log --graph --parents' -alias glgga='git log --graph --decorate --all' -alias glggpa='git log --graph --decorate --parents --all' -alias glgm='git log --graph --max-count=10' -alias glgpm='git log --graph --parents --max-count=10' -alias gloac='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%ae>%Creset" --abbrev-commit --all' -alias glods='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --date=short' -alias glopds='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --parents --date=short' -alias glod='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset"' -alias glopd='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --parents' -alias glola='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --all' -alias glolpa='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --parents --all' -alias glols='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --stat' -alias glolps='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --parents --stat' -alias glol='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset"' -alias glolp='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --parents' -alias glog='git log --oneline --decorate --graph' -alias glogp='git log --oneline --decorate --graph --parents' -alias gloga='git log --oneline --decorate --graph --all' -alias glogpa='git log --oneline --decorate --graph --parents --all' - -# Pretty log messages -_git_log_prettily(){ - if ! [ -z $1 ]; then - git log --pretty=$1 - fi -} -compdef _git _git_log_prettily=git-log - -alias glp='_git_log_prettily' -alias glg='git log --stat' -alias glgp='git log --stat --patch' -alias gignored='git ls-files -v | grep "^[[:lower:]]"' -alias gfg='git ls-files | grep' -alias gm='git merge' -alias gma='git merge --abort' -alias gms="git merge --squash" -alias gmom='git merge origin/$(git_main_branch)' -alias gmum='git merge upstream/$(git_main_branch)' -alias gmtl='git mergetool --no-prompt' -alias gmtlvim='git mergetool --no-prompt --tool=vimdiff' - -alias gl='git pull' -alias gprb='git pull --rebase' -alias gprbv='git pull --rebase -v' -alias gpra='git pull --rebase --autostash' -alias gprav='git pull --rebase --autostash -v' - -ggu() { - [[ "$#" != 1 ]] && local b="$(git_current_branch)" - git pull --rebase origin "${b:=$1}" -} -compdef _git ggu=git-checkout - -alias gprom='git pull --rebase origin $(git_main_branch)' -alias gpromi='git pull --rebase=interactive origin $(git_main_branch)' -alias ggpull='git pull origin "$(git_current_branch)"' - -ggl() { - if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then - git pull origin "${*}" - else - [[ "$#" == 0 ]] && local b="$(git_current_branch)" - git pull origin "${b:=$1}" - fi -} -compdef _git ggl=git-checkout - -alias gluc='git pull upstream $(git_current_branch)' -alias glum='git pull upstream $(git_main_branch)' -# alias gp='git push' -alias gpd='git push --dry-run' - -ggf() { - [[ "$#" != 1 ]] && local b="$(git_current_branch)" - git push --force origin "${b:=$1}" -} -compdef _git ggf=git-checkout - -alias gpf!='git push --force' -is-at-least 2.30 "$git_version" \ - && alias gpf='git push --force-with-lease --force-if-includes' \ - || alias gpf='git push --force-with-lease' - -ggfl() { - [[ "$#" != 1 ]] && local b="$(git_current_branch)" - git push --force-with-lease origin "${b:=$1}" -} -compdef _git ggfl=git-checkout - -alias gpsup='git push --set-upstream origin $(git_current_branch)' -is-at-least 2.30 "$git_version" \ - && alias gpsupf='git push --set-upstream origin $(git_current_branch) --force-with-lease --force-if-includes' \ - || alias gpsupf='git push --set-upstream origin $(git_current_branch) --force-with-lease' -alias gpvb='git push --verbose' -alias gpoat='git push origin --all && git push origin --tags' -alias gpod='git push origin --delete' -alias ggpush='git push origin "$(git_current_branch)"' - -ggp() { - if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then - git push origin "${*}" - else - [[ "$#" == 0 ]] && local b="$(git_current_branch)" - git push origin "${b:=$1}" - fi -} -compdef _git ggp=git-checkout - -alias gpu='git push upstream' -alias grba='git rebase --abort' -alias grbc='git rebase --continue' -alias grbi='git rebase --interactive' -alias grbo='git rebase --onto' -alias grbs='git rebase --skip' -alias grbd='git rebase $(git_develop_branch)' -alias grbm='git rebase $(git_main_branch)' -alias grbom='git rebase origin/$(git_main_branch)' -alias gr='git remote' -alias grv='git remote --verbose' -alias gra='git remote add' -alias grrm='git remote remove' -alias grmv='git remote rename' -alias grset='git remote set-url' -alias grup='git remote update' -alias gru='git reset --' -alias grhh='git reset --hard' -alias grhk='git reset --keep' -alias grhs='git reset --soft' -alias gpristine='git reset --hard && git clean --force -dfx' -alias groh='git reset origin/$(git_current_branch) --hard' -alias grs='git restore' -alias grss='git restore --source' -alias grst='git restore --staged' -alias gunwip='git rev-list --max-count=1 --format="%s" HEAD | grep -q "\--wip--" && git reset HEAD~1' -alias grev='git revert' -alias grm='git rm' -alias grmc='git rm --cached' -alias gcount='git shortlog --summary --numbered' -alias gsh='git show' -alias gsps='git show --pretty=short --show-signature' -alias gstall='git stash --all' -alias gstaa='git stash apply' -alias gstc='git stash clear' -alias gstd='git stash drop' -alias gstl='git stash list' -alias gstp='git stash pop' -# use the default stash push on git 2.13 and newer -is-at-least 2.13 "$git_version" \ - && alias gsta='git stash push' \ - || alias gsta='git stash save' -alias gsts='git stash show --patch' -alias gst='git status' -alias gsb='git status --short --branch' -alias gsi='git submodule init' -alias gsu='git submodule update' -alias gsd='git svn dcommit' -alias git-svn-dcommit-push='git svn dcommit && git push github $(git_main_branch):svntrunk' -alias gsr='git svn rebase' -alias gsw='git switch' -alias gswc='git switch --create' -alias gswd='git switch $(git_develop_branch)' -alias gswm='git switch $(git_main_branch)' -alias gtan='git tag --annotate' -alias gtsn='git tag --sign' -alias gtv='git tag | sort -V' -alias gignore='git update-index --assume-unchanged' -alias gunignore='git update-index --no-assume-unchanged' -alias gwch='git whatchanged -p --abbrev-commit --pretty=medium' -alias gwt='git worktree' -alias gwta='git worktree add' -alias gwtls='git worktree list' -alias gwtmv='git worktree move' -alias gwtrm='git worktree remove' -alias gstu='gsta --include-untracked' -alias gtl='gtl(){ git tag --sort=-v:refname -n --list "${1}*" }; noglob gtl' -alias gk='\gitk --all --branches &!' -alias gke='\gitk --all $(git log --walk-reflogs --pretty=%h) &!' - -unset git_version - -# Logic for adding warnings on deprecated aliases -local old_alias new_alias -for old_alias new_alias ( - # TODO(2023-10-19): remove deprecated `git pull --rebase` aliases - gup gpr - gupv gprv - gupa gpra - gupav gprav - gupom gprom - gupomi gpromi -); do - aliases[$old_alias]=' - print -Pu2 \"%F{yellow}[oh-my-zsh] '%F{red}${old_alias}%F{yellow}' is a deprecated alias, using '%F{green}${new_alias}%F{yellow}' instead.%f\" - $new_alias' -done -unset old_alias new_alias diff --git a/fedora/.config/shell/inputrc b/fedora/.config/shell/inputrc deleted file mode 100644 index 81cdf85..0000000 --- a/fedora/.config/shell/inputrc +++ /dev/null @@ -1,31 +0,0 @@ -$include /etc/inputrc - -set completion-display-width 0 -set completion-query-items 1000 - -# Prettyfi -set colored-stats on -set colored-completion-prefix on - -# ^C no longer shows on C-c keypress -set echo-control-characters off - -# Map tab to cycle through all the possible completions. -TAB: menu-complete - -# vi mode -set editing-mode vi - -$if mode=vi -set show-mode-in-prompt on -set vi-ins-mode-string \1\e[6 q\2 -set vi-cmd-mode-string \1\e[2 q\2 -set keymap vi-command - -# these are for vi-command mode -Control-l: clear-screen - -set keymap vi-insert -# these are for vi-insert mode -Control-l: clear-screen -$endif diff --git a/fedora/.config/shell/profile b/fedora/.config/shell/profile new file mode 100644 index 0000000..a8603e8 --- /dev/null +++ b/fedora/.config/shell/profile @@ -0,0 +1,263 @@ +################################################### +### --- PROFILE --- ### +################################################### +[ "$(tty)" = "/dev/tty1" ] && set -e # Exit immediately if a command exits with a non-zero status. + +################################################### +### --- ENV PATH --- ### +################################################### +# Add all directories in each subdirectory to $PATH +export PATH="$(find ~/.local/bin -path '*/.git*' -prune -o \( -type f -o -type l \) -perm -u=x -exec dirname {} \; | sort -u | paste -sd ':' -):$PATH" +export PATH="$(find ~/.local/share/.password-store -type d -name '.extensions' | paste -sd ':' -):$PATH" +command -v asdf >/dev/null 2>&1 && export PATH="$(find -L ~/.local/share/asdf/installs -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -):$PATH" +command -v npm >/dev/null 2>&1 && export PATH="$(find -L ~/.local/share/npm -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -):$PATH" + +unsetopt PROMPT_SP 2>/dev/null + +################################################### +### --- DEFAULT PROGRAMS --- ### +################################################### +export BROWSER=$(command -v librewolf || command -v firefox || command -v qutebrowser) +export EDITOR="nvim" +export EDITOR2="vim" +# export FILE_MANAGER="lf $(lf -version)" +export FILE_MANAGER="yazi $(yazi --version)" +export KEYTIMEOUT=10 +export SUDO_EDITOR=$EDITOR +export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" +export TERM="xterm-256color" +export TERMINAL="st" +export TERMINAL_PROG="st" +export VISUAL=$EDITOR + +################################################### +### --- XDG ENV PATHES --- ### +################################################### +### --- XDG DEFAULT --- ### +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_STATE_HOME="$HOME/.local/state" + +### --- XDG CUSTOMS --- ### +export XDG_DOTFILES_DIR="$HOME/.dotfiles" +export XDG_SCRIPTS_HOME="$HOME/.local/bin" +export XDG_SOURCES_HOME="$HOME/.local/src" +export XDG_DESKTOP_DIR="$HOME/Desktop" +export XDG_DOCUMENTS_DIR="$HOME/Documents" +export XDG_DOWNLOAD_DIR="$HOME/Downloads" +export XDG_MUSIC_DIR="$HOME/Music" +export XDG_PICTURES_DIR="$HOME/Pictures" +export XDG_PUBLICSHARE_DIR="$HOME/Public" +export XDG_TEMPLATES_DIR="$HOME/Templates" +export XDG_VIDEOS_DIR="$HOME/Videos" + +################################################### +### --- DEFAULT ENV PATHES FOR ALL PROGRAMS --- ### +################################################### +### --- ANDROID --- ### +export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" + +### --- ANSIBLE --- ### +export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg" + +### --- BAT --- ### +export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config" + +### --- CARGO --- ### +export CARGO_HOME="$XDG_DATA_HOME/cargo" + +### --- DICS --- ### +export DICS="/usr/share/stardict/dic/" + +### --- ELECTRUM --- ### +export ELECTRUMDIR="$XDG_DATA_HOME/electrum" + +### --- FCITX5 --- ### +export GTK_IM_MODULE=fcitx +export QT_IM_MODULE=fcitx +export XMODIFIERS=@im=fcitx + +### --- FZF --- ### +export FZF_ALT_C_COMMAND="fd --type d . --color=never --hidden" +export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -50'" +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +export FZF_CTRL_T_OPTS="--preview 'bat --color=always --line-range :50 {}' --preview-window 'right:45%'" +# export FZF_DEFAULT_OPTS="--no-height --color=bg+:#343d46,gutter:-1,pointer:#ff3c3c,info:#0dbc79,hl:#0dbc79,hl+:#23d18b" +export FZF_DEFAULT_OPTS="--reverse --height 60% --color=bg+:#343d46,gutter:-1,pointer:#ff3c3c,info:#0dbc79,hl:#0dbc79,hl+:#23d18b" + +### --- FORGIT --- ### +export FORGIT_CHECKOUT_BRANCH_BRANCH_GIT_OPTS='--sort=-committerdate' +export FORGIT_COPY_CMD='xclip -selection clipboard' + +### --- GEM --- ### +export GEMRC="$HOME/.config/gem/gemrc" +export GEM_HOME="$XDG_DATA_HOME/gem" +export GEM_PATH="$GEM_HOME" + +### --- GO --- ### +export GOMODCACHE="$XDG_CACHE_HOME/go/mod" +export GOPATH="$XDG_SCRIPTS_HOME/go" + +### --- GTK --- ### +export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0":"$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0.mine" + +### --- HISTORY --- ### +export HISTFILE="$XDG_DATA_HOME/history/sh_history" + +### --- INPUTRC --- ### +export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc" + +### --- JAVA --- ### +export AWT_TOOLKIT="MToolkit wmname LG3D" # May have to install wmname +export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm + +### --- Jupyter --- ### +export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter" +export JUPYTER_PLATFORM_DIRS="1" + +### --- KODI --- ### +export KODI_DATA="$XDG_DATA_HOME/kodi" + +### --- LYNX --- ### +export LYNX_CFG="$HOME/.config/lynx/lynx.cfg" +export LYNX_LSS="$HOME/.config/lynx/lynx.lss" +export LYNX_CFG_PATH="$XDG_CONFIG_HOME/lynx" + +### --- MANPAGER --- ### +([ -x "$(command -v batcat)" ] || [ -x "$(command -v batman)" ]) && { + export MANPAGER="sh -c 'col -bx | bat -l man -p'" + export MANROFFOPT="-c" +} || { + export MANPAGER='less -s' + export LESS="R" + export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')" + export LESS_TERMCAP_md="$(printf '%b' '[1;36m')" + export LESS_TERMCAP_me="$(printf '%b' '[0m')" + export LESS_TERMCAP_so="$(printf '%b' '[01;44;33m')" + export LESS_TERMCAP_se="$(printf '%b' '[0m')" + export LESS_TERMCAP_us="$(printf '%b' '[1;32m')" + export LESS_TERMCAP_ue="$(printf '%b' '[0m')" + export LESSOPEN="| lesspipe.sh %s" +} + +### --- MBSYNC --- ### +export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config" + +### --- MOZILLA --- ### +export MOZ_USE_XINPUT2=1 # Mozilla smooth scrolling/touchpads. + +### --- MYSQL --- ### +export MYSQL_HISTFILE="$XDG_DATA_HOME/history/mysql_history" + +### --- NODE.JS --- ### +export NODE_REPL_HISTORY="$XDG_DATA_HOME/history/node_repl_history" + +### --- NOTMUCH --- ### +export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config" + +### --- NPM --- ### +export NPM_CONFIG_USERCONFIG="~/.config/npm/.npmrc" + +### --- NVM --- ### +export NVM_DIR="$XDG_CONFIG_HOME/nvm" + +### --- PAM GNUPG --- ### +# export GNUPGHOME="$XDG_DATA_HOME/gnupg" + +### --- PASSWORD STORE --- ### +export PASSWORD_STORE_DIR="$XDG_DATA_HOME/.password-store" +export PASSWORD_STORE_CLIP_TIME=180 # Specifies the number of seconds to wait before restoring the clipboard, by default 45 seconds. +# export PASSWORD_STORE_GENERATED_LENGTH=18 # by default 25. +# export PASSWORD_STORE_CHARACTER_SET='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>?' +# export PASSWORD_STORE_CHARACTER_SET_NO_SYMBOLS='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>?' +export PASSWORD_STORE_ENABLE_EXTENSIONS="true" +# export PASSWORD_STORE_EXTENSIONS_DIR="$PASSWORD_STORE_DIR/.extensions" +# export BASH_COMPLETION_USER_DIR=$XDG_DATA_HOME/bash-completion/completions + +### --- PHP --- ### +export PHP_HISTFILE="$XDG_STATE_HOME/history/php_history" + +### --- POSTGRESQL --- ### +export PSQLRC="$XDG_CONFIG_HOME/pg/psqlrc" +export PSQL_HISTORY="$XDG_STATE_HOME/history/psql_history" +export PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass" +export PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf" + +### --- POWERLEVEL10K --- ### +export POWERLEVEL9K_INSTALLATION_DIR="/usr/share/zsh-theme-powerlevel10k" + +### --- PYTHON --- ### +export PYTHON_HISTORY="$XDG_DATA_HOME/history/python_history" +export PYTHONPYCACHEPREFIX="$XDG_CACHE_HOME/python" +export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc" +export PIPX_BIN_DIR="$XDG_SCRIPTS_HOME" +export PIPX_MAN_DIR="$XDG_DATA_HOME/man" + +### --- QT --- ### +export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. + +### --- RUST --- ### +export RUSTUP_HOME="$XDG_DATA_HOME/rustup" + +### --- SERVER --- ### +export THESIAH="thesiah.xyz" +export THESIAH_GIT="git@$THESIAH" +export THESIAH_SERVER="root@$THESIAH" +export THESIAH_VPN="${THESIAH%%.*}" +export THESIAH_WWW="$HOME/Private/repos/THESIAH" + +### --- SQLITE --- ### +export SQLITE_HISTORY="$XDG_DATA_HOME/history/sqlite_history" + +### --- STARSHIP --- ### +export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/starship.toml" + +### --- TMUX --- ### +export TMUX_TMPDIR="$XDG_RUNTIME_DIR" + +### --- UNISON --- ### +export UNISON="$XDG_DATA_HOME/unison" + +### --- VIM --- ### +# export GVIMINIT='let $MYGVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/gvimrc" : "$XDG_CONFIG_HOME/nvim/init.lua" | so $MYGVIMRC' +# export VIMINIT='let $MYVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/vimrc" : "$XDG_CONFIG_HOME/nvim/init.lua" | so $MYVIMRC' + +### --- VIRTUAL ENVIRONMENT --- ### +export WORKON_HOME="$XDG_DATA_HOME/venvs" + +### --- VISUAL STUDIO CODE --- ### +export VSCODE_PORTABLE="$XDG_DATA_HOME/vscode" + +### --- WEBKIT --- ### +export WEBKIT_DISABLE_COMPOSITING_MODE=1 + +### --- WINE --- ### +export WINEPREFIX="$XDG_DATA_HOME/wine" +export WINEDLLOVERRIDES="winemenubuilder.exe=d" + +### --- WGET --- ### +export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" + +### --- W3M --- ### +export W3M_DIR="$XDG_STATE_HOME/w3m" + +### --- X11 --- ### +export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" +export XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc" + +### --- XAUTH --- ### +export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. + +### --- ZSH --- ### +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" +export ZPLUGINDIR="$XDG_SCRIPTS_HOME/zsh" + +### --- SDCV --- ### +export STARDICT_DATA_DIR="$XDG_DATA_HOME/dic" +export STARDICT_HISTFILE="$XDG_DATA_HOME/history/dic" +export SDCV_PAGER='less --quit-if-one-screen -RX' + +### --- SHORTCUTS --- ### +[ ! -f "$XDG_CONFIG_HOME/shell/shortcutrc" ] && setsid -f shortcuts >/dev/null 2>&1 + |
