xxwhirlpool
·
2026-03-24
.bashrc-pc
1#!/bin/bash
2# ~/.bashrc: executed by bash(1) for non-login shells.
3# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
4# for examples
5
6######################################
7# default stuff i'm scared to change
8######################################
9
10# If not running interactively, don't do anything
11case $- in
12 *i*) ;;
13 *) return;;
14esac
15
16# don't put duplicate lines or lines starting with space in the history.
17HISTCONTROL=ignoreboth
18
19# append to the history file, don't overwrite it
20shopt -s histappend
21
22# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
23HISTSIZE=1000
24HISTFILESIZE=2000
25
26# check the window size after each command and, if necessary,
27# update the values of LINES and COLUMNS.
28shopt -s checkwinsize
29
30# make less more friendly for non-text input files, see lesspipe(1)
31[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
32
33# set variable identifying the chroot you work in (used in the prompt below)
34if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
35 debian_chroot=$(cat /etc/debian_chroot)
36fi
37
38case "$TERM" in
39 xterm-color|*-256color) color_prompt=yes;;
40esac
41
42#force_color_prompt=yes
43
44if [ -n "$force_color_prompt" ]; then
45 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
46 color_prompt=yes
47 else
48 color_prompt=
49 fi
50fi
51
52if [ "$color_prompt" = yes ]; then
53 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
54else
55 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
56fi
57unset color_prompt force_color_prompt
58
59# If this is an xterm set the title to user@host:dir
60case "$TERM" in
61xterm*|rxvt*)
62 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
63 ;;
64*)
65 ;;
66esac
67
68# enable color support of ls and also add handy aliases
69if [ -x /usr/bin/dircolors ]; then
70 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
71 alias ls='ls --color=auto'
72
73 alias grep='grep --color=auto'
74 alias fgrep='fgrep --color=auto'
75 alias egrep='egrep --color=auto'
76fi
77
78# Alias definitions.
79if [ -f ~/.bash_aliases ]; then
80 . ~/.bash_aliases
81fi
82
83# enable programmable completion features
84if ! shopt -oq posix; then
85 if [ -f /usr/share/bash-completion/bash_completion ]; then
86 . /usr/share/bash-completion/bash_completion
87 elif [ -f /etc/bash_completion ]; then
88 . /etc/bash_completion
89 fi
90fi
91
92######################################
93# aliases
94######################################
95
96# general
97alias nano=micro
98alias fd="fdfind"
99alias neofetch="hyfetch"
100alias fastfetch="hyfetch"
101alias bat="batcat"
102alias cat="bat --paging=never"
103alias iconsubfol="find . -mindepth 2 -type f -print -exec mv {} . \;"
104alias rced="micro ~/.bashrc && source ~/.bashrc"
105alias icat="kitty +kitten icat"
106alias ps="ps auxww"
107alias dd="ask dd"
108alias freeze="freeze -c user"
109alias glow="glow -p"
110alias qrcode="qrencode -t ansiutf8"
111alias ffmpeg="ffmpeg -hide_banner"
112alias open="xdg-open"
113alias c="clear"
114alias unfuckwifi="sudo systemctl restart NetworkManager"
115
116# weather stuff
117alias wttr="curl https://wttr.in/nyc?F0ASu"
118alias weather=wttr
119alias wttrlg="curl https://wttr.in/nyc?F1uq"
120alias weatherlg=wttrlg
121alias sun="daylight --short --timezone='America/New_York' | lolcat"
122
123# git
124alias gitall="git remote | xargs -L1 git push --all"
125alias gyolo="git add . && git commit -m 'yolo'"
126alias gitd="git diff --staged"
127alias gdiff="gitd"
128alias gits="git status"
129alias gita="git add ."
130alias pusheu="git push bytes main && cd /home/kat/Documents/Git/-mine/eunoia-astro/src/utils && node git-changelog.js && cd ../../"
131
132# dev
133alias irb="rv run irb"
134alias ipy="python3 -i"
135alias iphp="php -a"
136
137# vpn split tunnel aliases based on a small script @ ~/.local/bin/mvpn
138alias mftp="mvpn filezilla"
139alias mterm="mvpn kitty"
140
141# cd bookmarks
142alias dotf="cd /home/kat/dotfiles"
143alias gmine="cd /home/kat/Documents/Git/-mine"
144
145# servers
146alias fujo="kitty +kitten ssh fujo"
147alias fujohost="kitty +kitten ssh fujohost"
148alias fujobuild="kitty +kitten ssh fujobuild"
149alias fujoat="kitty +kitten ssh fujoat"
150alias goldstar="kitty +kitten ssh goldstar"
151alias ncc="kitty +kitten ssh ncc1701"
152
153######################################
154# variables
155######################################
156
157export EDITOR=/usr/local/bin/micro
158export "MICRO_TRUECOLOR=1"
159
160# catppuccin colors for fzf
161export FZF_DEFAULT_OPTS=" \
162--color=spinner:#F2D5CF,hl:#E78284 \
163--color=fg:#C6D0F5,header:#E78284,info:#CA9EE6,pointer:#F2D5CF \
164--color=marker:#BABBF1,fg+:#C6D0F5,prompt:#CA9EE6,hl+:#E78284 \
165--color=border:#414559,label:#C6D0F5"
166
167# Created by `pipx` on 2025-08-05 03:36:48
168export PATH="$PATH:/home/kat/dotfiles/config/.local/bin"
169export PATH=$PATH:/usr/local/go/bin
170
171export NVM_DIR="$HOME/.config/nvm"
172[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
173[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
174
175. "$HOME/.cargo/env"
176
177. "/home/kat/.deno/env"
178
179######################################
180# functions
181######################################
182
183cdmess() {
184 # from this blog post:
185 # https://blog.larah.me/mess-directory/
186 today_tmpdir="${TMPDIR-/tmp}/${USER}_mess/$(date +%F)"
187 mkdir -p "$today_tmpdir"
188 cd "$(mktemp -d -p "${today_tmpdir}" XXXX)" || exit 1
189}
190
191# get a random free port. this is useful for my
192# insane sysadmin website woman adventures
193portfree() {
194 while
195 port=$(shuf -n 1 -i 1024-65535)
196 netstat -atun | grep -q "$port"
197 do
198 continue
199 done
200 echo "$port"
201}
202
203# print internal & external IPs
204whatip() {
205 # internal
206 echo -n "internal IP: " | lolcat -p 0.7
207 hostname -I | awk '{print $1}'
208
209 # external
210 echo -n "external IP: " | lolcat -p 0.7
211 curl -4 icanhazip.com
212}
213
214# password generator. takes input for password length by number
215passgen() {
216 PASSLENGTH=$(gum input --placeholder "type a number")
217 date +%s | sha256sum | base64 | head -c "$PASSLENGTH"; echo
218}
219
220# display random ASCII art from
221# custom dir of art in dotfiles
222# using arttime (github: poetaman/arttime)
223playart() {
224 ARTDIR="/home/kat/Documents/Code/Git/-mine/dotfiles/config/.local/share/arttime/textart"
225 ARTSHUF=$(find "$ARTDIR" -type f | shuf -n1)
226
227 for art in $ARTSHUF; do
228 arttime --nolearn -a "$art" --ac 5
229 done
230}
231
232# to get quick notifs
233# after long commands
234notif() {
235 notify-send "done!"
236 paplay /home/kat/dotfiles/misc/sounds/twinkle
237 spd-say -t female3 -r +25 "done!"
238}
239
240# make & cd into a folder
241mkcd() {
242 mkdir -p "$@" && cd "$_" || exit 1;
243}
244
245######################################
246# misc
247######################################
248
249eval "$(starship init bash)"
250eval "$(fzf --bash)"
251eval "$(batman --export-env)"