export ZSH="/home/fkfd/.oh-my-zsh" ZSH_THEME="fkfd" plugins=( git python pj urltools mosh ) source $ZSH/oh-my-zsh.sh export EDITOR=/usr/bin/nvim export BROWSER=/usr/bin/firefox export PROJECT_PATHS=(~/Projects/ ~/Projects/_cloned/ ~/Projects/_archive/) export PATH="$HOME/.local/bin:$HOME/.local/texlive/2024/bin/x86_64-linux:$PATH" # utilities mc () { mkdir $1 && cd $1 } # look at anything k () { if [[ -d $1 ]]; then ls $1 elif [[ -f $1 ]]; then $EDITOR $1 fi } share () { src=$1 if [[ $2 == '' ]]; then dst=$(basename $1) else dst=$2 fi scp -r $src www@fkfd.me:www/static/$dst echo "https://fkfd.me/static/$(urlencode $dst)" } # make aliases accessible in sudo alias sudo="sudo " alias incognito="unset HISTFILE" alias proxy="export SOCKS5_PROXY=127.0.0.1:1080; export HTTP_PROXY=http://127.0.0.1:1081; export HTTPS_PROXY=http://127.0.0.1:1081" # SSH alias mrf="mosh root@fkfd.me" alias mff="mosh fred@fkfd.me" alias tilde="mosh fkfd@tilde.town -ssh='ssh -i ~/.ssh/id_rsa'" # file privileges alias gimme="sudo chown -R $USER ./ && sudo chmod -R +rw ./*" alias lemme="sudo chmod +x" # embedded alias espenv="source ~/p/esp/esp-idf/export.sh" alias mmu="make && make upload" # python alias py="python" alias venv="source ./venv/bin/activate" # tools alias ytdlp="yt-dlp --proxy socks5://localhost:1080/" alias v="nvim" alias c="cat" alias ls="eza" PRINTER="hpaio:/usb/HP_LaserJet_Professional_M1219nf_MFP?serial=000000000QJA9XJFPR1a" alias scan="scanimage -d '$PRINTER' --source Flatbed --format=jpeg" alias scanto="scanimage -d '$PRINTER' --source Flatbed --format=jpeg --mode=Gray --resolution=200 -x 210 -y 297 -o " alias catpic="montage -tile 1x -geometry +0+0" alias prc="perf record -F 1000 --call-graph=dwarf -e cycles:u" alias prp="perf report" # fun alias rickroll="vlc -f '~/Videos/Rick Astley - Never Gonna Give You Up (Official Music Video).mkv'" alias neofetch="if [[ $TERM == 'xterm-kitty' ]]; then neofetch --kitty ~/Pictures/branding/logos/arch.png --size 420px; else neofetch; fi" # disable beep in x11 set -B 0 # something fucked up alias je="journalctl -e -f" alias what-the-fuck-just-happened="journalctl -e -b -1" alias accel="killall kglobalaccel5 && kglobalaccel5&" # TA work alias gccc="gcc -pedantic -std=c11 -Wall -Wextra -Werror -Wno-unused-result -Wconversion -Wvla" # SJTU VPN vpn () { if ! systemctl is-active --quiet strongswan; then sudo systemctl start strongswan fi if [[ $1 == "on" ]]; then sudo swanctl -i --child vpn-student elif [[ $1 == "off" ]]; then sudo swanctl -t --ike vpn-student else echo "Usage: $0 [on|off]" fi } # kdesrc-build ################################################################# ## Add kdesrc-build to PATH export PATH="/home/fkfd/kde/src/kdesrc-build:$PATH" ## Autocomplete for kdesrc-run function _comp_kdesrc_run { local cur COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" # Complete only the first argument if [[ $COMP_CWORD != 1 ]]; then return 0 fi # Retrieve build modules through kdesrc-run # If the exit status indicates failure, set the wordlist empty to avoid # unrelated messages. local modules if ! modules=$(kdesrc-run --list-installed); then modules="" fi # Return completions that match the current word COMPREPLY=( $(compgen -W "${modules}" -- "$cur") ) return 0 } ## Register autocomplete function complete -o nospace -F _comp_kdesrc_run kdesrc-run ################################################################################