dotfiles

Personal dotfiles
git clone git://git.laack.co/dotfiles.git
Log | Files | Refs

bashrc (7480B)


      1 GPG_TTY=$(tty)
      2 export GPG_TTY
      3 export PATH=$PATH:/sbin
      4 export PATH=$PATH:/home/andrew/bin:/home/andrew/go/bin
      5 export PATH=$PATH:/home/andrew/bin/matrix
      6 export PATH=$PATH:/home/andrew/bin/email
      7 export PATH=$PATH:/home/andrew/bin/gotify
      8 export PATH=$PATH:/home/andrew/bin/backups
      9 export PASSWORD_STORE_DIR=~/gitRepos/passwords
     10 
     11 ## If not running interactively, don't do anything
     12 #case $- in
     13 #    *i*) ;;
     14 #      *) return;;
     15 #esac
     16 
     17 HISTCONTROL=ignoreboth
     18 
     19 # append to the history file, don't overwrite it
     20 #shopt -s histappend
     21 
     22 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
     23 HISTSIZE=1000
     24 HISTFILESIZE=2000
     25 
     26 # check the window size after each command and, if necessary,
     27 # update the values of LINES and COLUMNS.
     28 shopt -s checkwinsize
     29 if [ -n "$force_color_prompt" ]; then
     30     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
     31 	# We have color support; assume it's compliant with Ecma-48
     32 	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
     33 	# a case would tend to support setf rather than setaf.)
     34 	color_prompt=yes
     35     else
     36 	color_prompt=
     37     fi
     38 fi
     39 
     40 unset color_prompt force_color_prompt
     41 
     42 # If this is an xterm set the title to user@host:dir
     43 # enable color support of ls and also add handy aliases
     44 if [ -x /usr/bin/dircolors ]; then
     45     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
     46     alias ls='ls --color=auto'
     47     #alias dir='dir --color=auto'
     48     #alias vdir='vdir --color=auto'
     49 
     50     #alias grep='grep --color=auto'
     51     #alias fgrep='fgrep --color=auto'
     52     #alias egrep='egrep --color=auto'
     53 fi
     54 
     55 eval "$(zoxide init bash)"
     56 
     57 cd() {
     58  if [ "$1" ]; then
     59     # If a path is provided, use zoxide's 'cd' subcommand to jump to it
     60     z "$1"
     61   else
     62     # Otherwise, behave like the default cd command (go to home directory)
     63     command cd "$@"
     64   fi
     65 }
     66 
     67 #alias tmux-purge='tmux list-sessions | grep -v attached | cut -d: -f1 | xargs -I{} tmux kill-session -t "{}"'
     68 
     69 #alias tmux-attach='function _tmux_attach(){ tmux attach-session -t "$1"; }; _tmux_attach'
     70 #alias tmux-new='function _tmux_new(){ tmux new-session -s "$1"; }; _tmux_new'
     71 #alias tmux-end='function _tmux_end(){ tmux kill-session -t "$1"; }; _tmux_end'
     72 
     73 export SFML_INCLUDE_DIR=/usr/local/sfml/include
     74 export SFML_LIB_DIR=/usr/local/sfml/lib
     75 export LD_LIBRARY_PATH=$SFML_LIB_DIR:$LD_LIBRARY_PATH
     76 
     77 # requires auth
     78 clone-public() {
     79   read -p "Enter repository name: " REPO_NAME
     80   git clone ssh://brgr/home/shared/git/public-repos/$REPO_NAME.git
     81 }
     82 
     83 clone-private() {
     84   read -p "Enter repository name: " REPO_NAME
     85   git clone ssh://brgr/home/shared/git/private-repos/$REPO_NAME.git
     86 }
     87 
     88 alias pw='head -c -1 ~/gitRepos/keys/pw.txt | xclip -selection clipboard'
     89 alias pw_old='cat ~/gitRepos/keys/pw-old.txt | xclip -selection clipboard'
     90 
     91 alias mount-server="sshfs andrew@brgr.heron-peacock.ts.net:/home/shared/ /mnt/server/ -o reconnect"
     92 # alias mount-home="sshfs andrew@brgr.heron-peacock.ts.net:/home/andrew/ /home/andrew/mount/ -o reconnect"
     93 # alias mount-shared="sshfs andrew@brgr.heron-peacock.ts.net:/home/shared/ /home/andrew/mount/ -o reconnect"
     94 
     95 sendit() {
     96   git add . && git commit -m "$1" && git push
     97 }
     98 
     99 export EDITOR=nvim
    100 alias sshServer='ssh andrew@brgr.heron-peacock.ts.net'
    101 
    102 export PS1='\u@\h:\W\$ '
    103 #TERM=xterm
    104 
    105 #TERM=st-256color
    106 TERM=xterm-256color
    107 #TERM=screen
    108 
    109 alias disableOff="xset s off && xset -dpms && xset s noblank"
    110 
    111 case $TERM in
    112     rxvt|*term)
    113         PROMPT_COMMAND='echo -ne "\033]0;$PWD\007"'
    114     ;;
    115 esac
    116 
    117 export LANG=en_US.UTF-8
    118 
    119 
    120 # alias play="mpv ~/local-vids/ --fs"
    121 # export PATH="$HOME/.pyenv/bin:$PATH"
    122 # eval "$(pyenv init --path)"
    123 # eval "$(pyenv init -)"
    124 #xrdb ~/.Xresources
    125 alias vim="nvim"
    126 alias leet="~/bin/leetcode-submission.sh"
    127 
    128 #source /usr/share/fzf/key-bindings.bash
    129 alias checkout="~/bin/checkout.sh"
    130 alias branch="git branch"
    131 alias src="source ~/venv/bin/activate"
    132 
    133 zcp() {
    134   if [ -z "$1" ]; then
    135     echo "No destination specified. Usage: zcp <zoxide target>"
    136     return 1
    137   fi
    138   cp -r $(find . | fzf -m) "$(zoxide query "$1")"
    139 }
    140 
    141 zmv() {
    142   if [ -z "$1" ]; then
    143     echo "No destination specified. Usage: zmv <zoxide target>"
    144     return 1
    145   fi
    146   mv $(find . | fzf -m) "$(zoxide query "$1")"
    147 }
    148 
    149 eval "$(fzf --bash)"
    150 
    151 mans() {
    152     man -k . | awk '{print $1}' | fzf | sed 's/(.*)//' | xargs man
    153 }
    154 
    155 packages() {
    156     local pkgs
    157     pkgs=$(pacman -Slq | fzf -m) || return
    158     sudo pacman -S $pkgs
    159 }
    160 
    161 what-the-hell-is-even-that(){
    162     TMP=$(mktemp)
    163     pacman -Sq --info > $TMP
    164     nvim $TMP
    165 }
    166 
    167 #bind '"\C-e" edit-and-execute-command'
    168 export LYNX_CFG=/home/andrew/.config/lynx/lynx.cfg
    169 
    170 #if [ -z "$MTM" ] && [ -n "$ABDUCO_SESSION" ]; then
    171 #    exec mtm
    172 #fi
    173 #alias abd="/home/andrew/bin/attach-abduco.sh"
    174 alias a="/home/andrew/bin/abduco.sh"
    175 
    176 # fixes bind message
    177 if [[ $- == *i* ]]; then
    178     bind -f ~/.inputrc
    179 fi
    180 
    181 source ~/gitRepos/keys/secrets.txt > /dev/null 2>&1
    182 
    183 # fuck this
    184 alias format="uv run dev manual-precommit"
    185 
    186 alias lock="i3lock -c 000000"
    187 
    188 build-run() {
    189   tcc $1 && ./a.out $2 $3 $4 $5 $6 $7 $8 $9 $10 # if you need more, who the fuck do you think you are?
    190 }
    191 
    192 # uv
    193 export PATH="/home/andrew/.local/bin:$PATH"
    194 
    195 alias dev_build="uv run sculptor/scripts/dev.py rebuild_container_for_local_testing my_dev_control_plane_volume && SCULPTOR_CONTROL_PLANE_VOLUME=my_dev_control_plane_volume just tmux-dev"
    196 alias build_control_plane="uv run sculptor/sculptor/cli/dev.py build-control-plane"
    197 
    198 [ -f "/home/andrew/.ghcup/env" ] && . "/home/andrew/.ghcup/env" # ghcup-env
    199 alias format="uv run imbue_core/imbue_core/ratchets/test_all_ratchets.py test"
    200 alias clean-sculptor="rm -rf ~/.dev_sculptor && rm -rf ~/.sculptor && sudo docker system prune -af"
    201 #alias containers="docker exec -it $(docker ps -q | fzf ) bash"
    202 alias rust-book="rustup doc --book"
    203 alias yt-audio="yt-dlp --embed-metadata --embed-thumbnail -t mp3 $1"
    204 alias favorite="find ~/syncing/music -type f | fzf >> ~/syncing/music/favorites.m3u"
    205 
    206 # this is shit.
    207 # tmux is not good software.
    208 #if [ -z $TMUX ]; then
    209 #    tmux
    210 #fi
    211 
    212 #alias daily-summary="/home/andrew/gitRepos/information-retrieval/web-research/build/main \"Find todays news on AI developments, acquisitions, and tech. ENSURE ALL INFORMATION IS FROM TODAY. DO NOT include information that is not from today. It is currently $(date). Give **full** links to sources as applicable.\""
    213 
    214 # This persists in .config, but I want to remember this in case things must change.
    215 # xdg-settings set default-web-browser librewolf.desktop
    216 
    217 
    218 #alias jb="fg %$(jobs | fzf | grep -oP '^\[\K[0-9]+')"
    219 alias print-today="date +%Y-%m-%d"
    220 
    221 message() {
    222   (
    223     cd "/home/andrew/gitRepos/personal-notes" || exit
    224     vim "messages"
    225   )
    226 }
    227 
    228 
    229 website() {
    230   (
    231     cd "/home/andrew/personal-files/web" || exit
    232     MONTH=$(date "+%Y-%m")
    233     mkdir -p $MONTH
    234     cd $MONTH || exit
    235     vim .
    236   )
    237 }
    238 
    239 today() {
    240     (
    241     cd "/home/andrew/gitRepos/personal-notes" || exit
    242     PRIOR=$(ls daily/ | tail -n 1 | sed 's/\.md//g' || date -d "1 day ago" +%Y-%m-%d)
    243     TODAY=$(date +%Y-%m-%d)
    244     mkdir -p daily
    245 
    246     # if the file exists, do nothing
    247     # if it doesn't exist, copy yesterday's for continuity of todolist
    248     # TODO: Is this the best way to do this or should each day be irrespective of the prior,
    249     # keeping a singular top level todo list for things I don't plan to do in a given day?
    250     # uncertain.
    251 
    252     ls daily/$TODAY.md || cp daily/$PRIOR.md daily/$TODAY.md
    253     vim daily/$TODAY.md
    254     )
    255 }
    256 
    257 # for ghidra
    258 export _JAVA_AWT_WM_NONREPARENTING=1
    259 
    260 # just in case I ever almost forget.
    261 go telemetry off