Commit c2bccdc
xxwhirlpool
·
2025-09-21 12:26:12 -0400 EDT
parent 744252c
bashrc fixes
4 files changed,
+497,
-205
+241,
-0
| ... | ... | @@ -0,0 +1,241 @@ | |
| 1 | + | # ~/.bashrc: executed by bash(1) for non-login shells. | |
| 2 | + | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| 3 | + | # for examples | |
| 4 | + | ||
| 5 | + | # If not running interactively, don't do anything | |
| 6 | + | case $- in | |
| 7 | + | *i*) ;; | |
| 8 | + | *) return;; | |
| 9 | + | esac | |
| 10 | + | ||
| 11 | + | # don't put duplicate lines or lines starting with space in the history. | |
| 12 | + | # See bash(1) for more options | |
| 13 | + | HISTCONTROL=ignoreboth | |
| 14 | + | ||
| 15 | + | # append to the history file, don't overwrite it | |
| 16 | + | shopt -s histappend | |
| 17 | + | ||
| 18 | + | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | |
| 19 | + | HISTSIZE=1000 | |
| 20 | + | HISTFILESIZE=2000 | |
| 21 | + | ||
| 22 | + | # check the window size after each command and, if necessary, | |
| 23 | + | # update the values of LINES and COLUMNS. | |
| 24 | + | shopt -s checkwinsize | |
| 25 | + | ||
| 26 | + | # If set, the pattern "**" used in a pathname expansion context will | |
| 27 | + | # match all files and zero or more directories and subdirectories. | |
| 28 | + | #shopt -s globstar | |
| 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) | |
| 34 | + | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then | |
| 35 | + | debian_chroot=$(cat /etc/debian_chroot) | |
| 36 | + | fi | |
| 37 | + | ||
| 38 | + | # set a fancy prompt (non-color, unless we know we "want" color) | |
| 39 | + | case "$TERM" in | |
| 40 | + | xterm-color|*-256color) color_prompt=yes;; | |
| 41 | + | esac | |
| 42 | + | ||
| 43 | + | # uncomment for a colored prompt, if the terminal has the capability; turned | |
| 44 | + | # off by default to not distract the user: the focus in a terminal window | |
| 45 | + | # should be on the output of commands, not on the prompt | |
| 46 | + | #force_color_prompt=yes | |
| 47 | + | ||
| 48 | + | if [ -n "$force_color_prompt" ]; then | |
| 49 | + | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
| 50 | + | # We have color support; assume it's compliant with Ecma-48 | |
| 51 | + | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such | |
| 52 | + | # a case would tend to support setf rather than setaf.) | |
| 53 | + | color_prompt=yes | |
| 54 | + | else | |
| 55 | + | color_prompt= | |
| 56 | + | fi | |
| 57 | + | fi | |
| 58 | + | ||
| 59 | + | if [ "$color_prompt" = yes ]; then | |
| 60 | + | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | |
| 61 | + | else | |
| 62 | + | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | |
| 63 | + | fi | |
| 64 | + | unset color_prompt force_color_prompt | |
| 65 | + | ||
| 66 | + | # If this is an xterm set the title to user@host:dir | |
| 67 | + | case "$TERM" in | |
| 68 | + | xterm*|rxvt*) | |
| 69 | + | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" | |
| 70 | + | ;; | |
| 71 | + | *) | |
| 72 | + | ;; | |
| 73 | + | esac | |
| 74 | + | ||
| 75 | + | # enable color support of ls and also add handy aliases | |
| 76 | + | if [ -x /usr/bin/dircolors ]; then | |
| 77 | + | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
| 78 | + | alias ls='ls --color=auto' | |
| 79 | + | #alias dir='dir --color=auto' | |
| 80 | + | #alias vdir='vdir --color=auto' | |
| 81 | + | ||
| 82 | + | alias grep='grep --color=auto' | |
| 83 | + | alias fgrep='fgrep --color=auto' | |
| 84 | + | alias egrep='egrep --color=auto' | |
| 85 | + | fi | |
| 86 | + | ||
| 87 | + | # colored GCC warnings and errors | |
| 88 | + | #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' | |
| 89 | + | ||
| 90 | + | # some more ls aliases | |
| 91 | + | alias ll='ls -alF' | |
| 92 | + | alias la='ls -A' | |
| 93 | + | alias l='ls -CF' | |
| 94 | + | ||
| 95 | + | # Add an "alert" alias for long running commands. Use like so: | |
| 96 | + | # sleep 10; alert | |
| 97 | + | alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' | |
| 98 | + | ||
| 99 | + | # Alias definitions. | |
| 100 | + | # You may want to put all your additions into a separate file like | |
| 101 | + | # ~/.bash_aliases, instead of adding them here directly. | |
| 102 | + | # See /usr/share/doc/bash-doc/examples in the bash-doc package. | |
| 103 | + | ||
| 104 | + | if [ -f ~/.bash_aliases ]; then | |
| 105 | + | . ~/.bash_aliases | |
| 106 | + | fi | |
| 107 | + | ||
| 108 | + | # enable programmable completion features (you don't need to enable | |
| 109 | + | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile | |
| 110 | + | # sources /etc/bash.bashrc). | |
| 111 | + | if ! shopt -oq posix; then | |
| 112 | + | if [ -f /usr/share/bash-completion/bash_completion ]; then | |
| 113 | + | . /usr/share/bash-completion/bash_completion | |
| 114 | + | elif [ -f /etc/bash_completion ]; then | |
| 115 | + | . /etc/bash_completion | |
| 116 | + | fi | |
| 117 | + | fi | |
| 118 | + | ||
| 119 | + | ###################################### | |
| 120 | + | # aliases | |
| 121 | + | ###################################### | |
| 122 | + | ||
| 123 | + | # general | |
| 124 | + | ||
| 125 | + | alias nano=micro | |
| 126 | + | alias sudo="sudo " | |
| 127 | + | alias pick="pastel pick" | |
| 128 | + | alias icat="kitten icat" | |
| 129 | + | alias freeze="freeze -c user $1" | |
| 130 | + | alias fd="fdfind " | |
| 131 | + | alias neofetch="hyfetch" | |
| 132 | + | alias fastfetch="hyfetch" | |
| 133 | + | ||
| 134 | + | # lazy ass way for me to get my idol mp3s from youtube | |
| 135 | + | # usage: ytmp3 url | |
| 136 | + | alias ytmp3="yt-dlp -f ba -x --audio-format mp3" | |
| 137 | + | ||
| 138 | + | # some cd bookmarks | |
| 139 | + | alias dotf="cd /home/kat/dotfiles" | |
| 140 | + | alias gmine="cd /home/kat/Documents/Git/-mine" | |
| 141 | + | ||
| 142 | + | # weather stuff | |
| 143 | + | alias wttr="curl https://wttr.in/New+York?F0AS" | |
| 144 | + | alias weather=wttr | |
| 145 | + | alias wttrlg="curl https://wttr.in/New+York?F1uq" | |
| 146 | + | alias weatherlg=wttrlg | |
| 147 | + | alias sun="daylight --short --timezone='America/New_York' | lolcat" | |
| 148 | + | ||
| 149 | + | # git | |
| 150 | + | alias gitall="git remote | xargs -L1 git push --all" | |
| 151 | + | alias gyolo="git add . && git commit -m 'yolo'" | |
| 152 | + | alias pusheu="git push bytes main && cd /home/kat/Documents/Git/-mine/eunoia-astro/src/utils && node git-changelog.js" | |
| 153 | + | ||
| 154 | + | # vpn split tunnel aliases based on a small script @ ~/.local/bin/mvpn | |
| 155 | + | alias mftp="mvpn filezilla" | |
| 156 | + | alias mterm="mvpn kitty" | |
| 157 | + | ||
| 158 | + | # servers | |
| 159 | + | alias fujo="kitty +kitten ssh fujo" | |
| 160 | + | alias fujobuild="kitty +kitten ssh fujobuild" | |
| 161 | + | alias fujohost="kitty +kitten ssh fujohost" | |
| 162 | + | alias steff="kitty +kitten ssh steff" | |
| 163 | + | ||
| 164 | + | ###################################### | |
| 165 | + | # variables | |
| 166 | + | ###################################### | |
| 167 | + | ||
| 168 | + | export PATH=$PATH:/usr/local/go/bin | |
| 169 | + | ||
| 170 | + | export NVM_DIR="$HOME/.config/nvm" | |
| 171 | + | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| 172 | + | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
| 173 | + | ||
| 174 | + | # set truecolor | |
| 175 | + | export COLORTERM=truecolor | |
| 176 | + | export MICRO_TRUECOLOR=1 | |
| 177 | + | ||
| 178 | + | # catppuccin colors for fzf | |
| 179 | + | export FZF_DEFAULT_OPTS=" \ | |
| 180 | + | --color=spinner:#F2D5CF,hl:#E78284 \ | |
| 181 | + | --color=fg:#C6D0F5,header:#E78284,info:#CA9EE6,pointer:#F2D5CF \ | |
| 182 | + | --color=marker:#BABBF1,fg+:#C6D0F5,prompt:#CA9EE6,hl+:#E78284 \ | |
| 183 | + | --color=border:#414559,label:#C6D0F5" | |
| 184 | + | ||
| 185 | + | if [ -f ~/.privatevars ]; then | |
| 186 | + | . ~/.privatevars | |
| 187 | + | fi | |
| 188 | + | ||
| 189 | + | ###################################### | |
| 190 | + | # functions | |
| 191 | + | ###################################### | |
| 192 | + | ||
| 193 | + | # get a random free port. this is useful for my | |
| 194 | + | # insane sysadmin website woman adventures | |
| 195 | + | portfree() { | |
| 196 | + | while | |
| 197 | + | port=$(shuf -n 1 -i 49152-65535) | |
| 198 | + | netstat -atun | grep -q "$port" | |
| 199 | + | do | |
| 200 | + | continue | |
| 201 | + | done | |
| 202 | + | echo "$port" | |
| 203 | + | } | |
| 204 | + | ||
| 205 | + | # print internal & external IPs | |
| 206 | + | whatip() { | |
| 207 | + | # internal | |
| 208 | + | echo -n "internal IP: " | lolcat -p 0.7; hostname -I | awk '{print $1}' | |
| 209 | + | # external | |
| 210 | + | echo -n "external IP: " | lolcat -p 0.7; curl -4 icanhazip.com | |
| 211 | + | } | |
| 212 | + | ||
| 213 | + | # password generator. takes input for password length by number | |
| 214 | + | passgen() { | |
| 215 | + | PASSLENGTH=$(gum input --placeholder "type a number") | |
| 216 | + | date +%s | sha256sum | base64 | head -c $PASSLENGTH ; echo | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | cdmess() { | |
| 220 | + | # from this blog post: | |
| 221 | + | # https://blog.larah.me/mess-directory/ | |
| 222 | + | today_tmpdir="${TMPDIR-/tmp}/${USER}_mess/$(date +%F)" | |
| 223 | + | mkdir -p "$today_tmpdir" | |
| 224 | + | cd "$(mktemp -d -p "${today_tmpdir}" XXXX)" | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | # to get quick notifs | |
| 228 | + | # after long commands | |
| 229 | + | notif() { | |
| 230 | + | notify-send "done!" | |
| 231 | + | aplay -q /usr/share/sounds/sound-icons/start | |
| 232 | + | spd-say -t female3 -r +25 "done!" | |
| 233 | + | } | |
| 234 | + | ||
| 235 | + | ###################################### | |
| 236 | + | # misc | |
| 237 | + | ###################################### | |
| 238 | + | ||
| 239 | + | eval "$(starship init bash)" | |
| 240 | + | ||
| 241 | + | eval "$(fzf --bash)" |
+256,
-0
| ... | ... | @@ -0,0 +1,256 @@ | |
| 1 | + | # ~/.bashrc: executed by bash(1) for non-login shells. | |
| 2 | + | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| 3 | + | # for examples | |
| 4 | + | ||
| 5 | + | # If not running interactively, don't do anything | |
| 6 | + | case $- in | |
| 7 | + | *i*) ;; | |
| 8 | + | *) return;; | |
| 9 | + | esac | |
| 10 | + | ||
| 11 | + | # don't put duplicate lines or lines starting with space in the history. | |
| 12 | + | # See bash(1) for more options | |
| 13 | + | HISTCONTROL=ignoreboth | |
| 14 | + | ||
| 15 | + | # append to the history file, don't overwrite it | |
| 16 | + | shopt -s histappend | |
| 17 | + | ||
| 18 | + | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | |
| 19 | + | HISTSIZE=1000 | |
| 20 | + | HISTFILESIZE=2000 | |
| 21 | + | ||
| 22 | + | # check the window size after each command and, if necessary, | |
| 23 | + | # update the values of LINES and COLUMNS. | |
| 24 | + | shopt -s checkwinsize | |
| 25 | + | ||
| 26 | + | # If set, the pattern "**" used in a pathname expansion context will | |
| 27 | + | # match all files and zero or more directories and subdirectories. | |
| 28 | + | #shopt -s globstar | |
| 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) | |
| 34 | + | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then | |
| 35 | + | debian_chroot=$(cat /etc/debian_chroot) | |
| 36 | + | fi | |
| 37 | + | ||
| 38 | + | # set a fancy prompt (non-color, unless we know we "want" color) | |
| 39 | + | case "$TERM" in | |
| 40 | + | xterm-color|*-256color) color_prompt=yes;; | |
| 41 | + | esac | |
| 42 | + | ||
| 43 | + | # uncomment for a colored prompt, if the terminal has the capability; turned | |
| 44 | + | # off by default to not distract the user: the focus in a terminal window | |
| 45 | + | # should be on the output of commands, not on the prompt | |
| 46 | + | #force_color_prompt=yes | |
| 47 | + | ||
| 48 | + | if [ -n "$force_color_prompt" ]; then | |
| 49 | + | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
| 50 | + | # We have color support; assume it's compliant with Ecma-48 | |
| 51 | + | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such | |
| 52 | + | # a case would tend to support setf rather than setaf.) | |
| 53 | + | color_prompt=yes | |
| 54 | + | else | |
| 55 | + | color_prompt= | |
| 56 | + | fi | |
| 57 | + | fi | |
| 58 | + | ||
| 59 | + | if [ "$color_prompt" = yes ]; then | |
| 60 | + | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | |
| 61 | + | else | |
| 62 | + | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | |
| 63 | + | fi | |
| 64 | + | unset color_prompt force_color_prompt | |
| 65 | + | ||
| 66 | + | # If this is an xterm set the title to user@host:dir | |
| 67 | + | case "$TERM" in | |
| 68 | + | xterm*|rxvt*) | |
| 69 | + | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" | |
| 70 | + | ;; | |
| 71 | + | *) | |
| 72 | + | ;; | |
| 73 | + | esac | |
| 74 | + | ||
| 75 | + | # enable color support of ls and also add handy aliases | |
| 76 | + | if [ -x /usr/bin/dircolors ]; then | |
| 77 | + | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
| 78 | + | alias ls='ls --color=auto' | |
| 79 | + | #alias dir='dir --color=auto' | |
| 80 | + | #alias vdir='vdir --color=auto' | |
| 81 | + | ||
| 82 | + | alias grep='grep --color=auto' | |
| 83 | + | alias fgrep='fgrep --color=auto' | |
| 84 | + | alias egrep='egrep --color=auto' | |
| 85 | + | fi | |
| 86 | + | ||
| 87 | + | # colored GCC warnings and errors | |
| 88 | + | #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' | |
| 89 | + | ||
| 90 | + | # some more ls aliases | |
| 91 | + | alias ll='ls -alF' | |
| 92 | + | alias la='ls -A' | |
| 93 | + | alias l='ls -CF' | |
| 94 | + | ||
| 95 | + | # Add an "alert" alias for long running commands. Use like so: | |
| 96 | + | # sleep 10; alert | |
| 97 | + | alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' | |
| 98 | + | ||
| 99 | + | # Alias definitions. | |
| 100 | + | # You may want to put all your additions into a separate file like | |
| 101 | + | # ~/.bash_aliases, instead of adding them here directly. | |
| 102 | + | # See /usr/share/doc/bash-doc/examples in the bash-doc package. | |
| 103 | + | ||
| 104 | + | if [ -f ~/.bash_aliases ]; then | |
| 105 | + | . ~/.bash_aliases | |
| 106 | + | fi | |
| 107 | + | ||
| 108 | + | # enable programmable completion features (you don't need to enable | |
| 109 | + | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile | |
| 110 | + | # sources /etc/bash.bashrc). | |
| 111 | + | if ! shopt -oq posix; then | |
| 112 | + | if [ -f /usr/share/bash-completion/bash_completion ]; then | |
| 113 | + | . /usr/share/bash-completion/bash_completion | |
| 114 | + | elif [ -f /etc/bash_completion ]; then | |
| 115 | + | . /etc/bash_completion | |
| 116 | + | fi | |
| 117 | + | fi | |
| 118 | + | ||
| 119 | + | ###################################### | |
| 120 | + | # aliases | |
| 121 | + | ###################################### | |
| 122 | + | ||
| 123 | + | # general | |
| 124 | + | alias nano=micro | |
| 125 | + | alias sudo="sudo TERMINFO=\"$TERMINFO\" " | |
| 126 | + | alias pick='pastel pick' | |
| 127 | + | alias fd='fdfind' | |
| 128 | + | alias neofetch="hyfetch" | |
| 129 | + | alias fastfetch="hyfetch" | |
| 130 | + | alias bat="batcat" | |
| 131 | + | alias cat="bat --paging=never" | |
| 132 | + | alias iconsubfolalias iconsubfol="find . -mindepth 2 -type f -print -exec mv {} . \;" | |
| 133 | + | ||
| 134 | + | # lazy ass way for me to get my idol mp3s from youtube | |
| 135 | + | # usage: ytmp3 url | |
| 136 | + | alias ytmp3="yt-dlp -f ba -x --audio-format mp3" | |
| 137 | + | ||
| 138 | + | # weather stuff | |
| 139 | + | alias wttr="curl https://wttr.in/New+York?F0AS" | |
| 140 | + | alias weather=wttr | |
| 141 | + | alias wttrlg="curl https://wttr.in/New+York?F1uq" | |
| 142 | + | alias weatherlg=wttrlg | |
| 143 | + | alias sun="daylight --short --timezone='America/New_York' | lolcat" | |
| 144 | + | ||
| 145 | + | # git | |
| 146 | + | alias gitall="git remote | xargs -L1 git push --all" | |
| 147 | + | alias gyolo="git add . && git commit -m 'yolo'" | |
| 148 | + | alias pusheu="git push bytes main && cd /home/kat/Documents/Git/-mine/eunoia-astro/src/utils && node git-changelog.js" | |
| 149 | + | ||
| 150 | + | # vpn split tunnel aliases based on a small script @ ~/.local/bin/mvpn | |
| 151 | + | alias mftp="mvpn filezilla" | |
| 152 | + | alias mterm="mvpn kitty" | |
| 153 | + | ||
| 154 | + | # cd bookmarks | |
| 155 | + | alias dotf="cd /home/kat/dotfiles" | |
| 156 | + | alias gmine="cd /home/kat/Documents/Git/-mine" | |
| 157 | + | ||
| 158 | + | # servers | |
| 159 | + | alias fujo="kitty +kitten ssh fujo" | |
| 160 | + | alias fujohost="kitty +kitten ssh fujohost" | |
| 161 | + | alias fujobuild="kitty +kitten ssh fujobuild" | |
| 162 | + | alias steff="kitty +kitten ssh steff" | |
| 163 | + | ||
| 164 | + | ###################################### | |
| 165 | + | # variables | |
| 166 | + | ###################################### | |
| 167 | + | ||
| 168 | + | export EDITOR=/usr/local/bin/micro | |
| 169 | + | export "MICRO_TRUECOLOR=1" | |
| 170 | + | ||
| 171 | + | # catppuccin colors for fzf | |
| 172 | + | export FZF_DEFAULT_OPTS=" \ | |
| 173 | + | --color=spinner:#F2D5CF,hl:#E78284 \ | |
| 174 | + | --color=fg:#C6D0F5,header:#E78284,info:#CA9EE6,pointer:#F2D5CF \ | |
| 175 | + | --color=marker:#BABBF1,fg+:#C6D0F5,prompt:#CA9EE6,hl+:#E78284 \ | |
| 176 | + | --color=border:#414559,label:#C6D0F5" | |
| 177 | + | ||
| 178 | + | # Created by `pipx` on 2025-08-05 03:36:48 | |
| 179 | + | export PATH="$PATH:/home/kat/dotfiles/config/.local/bin" | |
| 180 | + | export PATH=$PATH:/usr/local/go/bin | |
| 181 | + | ||
| 182 | + | if [ -f ~/.privatevars ]; then | |
| 183 | + | . ~/.privatevars | |
| 184 | + | fi | |
| 185 | + | ||
| 186 | + | export NVM_DIR="$HOME/.config/nvm" | |
| 187 | + | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| 188 | + | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
| 189 | + | ||
| 190 | + | . "$HOME/.cargo/env" | |
| 191 | + | ||
| 192 | + | ###################################### | |
| 193 | + | # functions | |
| 194 | + | ###################################### | |
| 195 | + | ||
| 196 | + | cdmess() { | |
| 197 | + | # from this blog post: | |
| 198 | + | # https://blog.larah.me/mess-directory/ | |
| 199 | + | today_tmpdir="${TMPDIR-/tmp}/${USER}_mess/$(date +%F)" | |
| 200 | + | mkdir -p "$today_tmpdir" | |
| 201 | + | cd "$(mktemp -d -p "${today_tmpdir}" XXXX)" | |
| 202 | + | } | |
| 203 | + | ||
| 204 | + | # get a random free port. this is useful for my | |
| 205 | + | # insane sysadmin website woman adventures | |
| 206 | + | portfree() { | |
| 207 | + | while | |
| 208 | + | port=$(shuf -n 1 -i 49152-65535) | |
| 209 | + | netstat -atun | grep -q "$port" | |
| 210 | + | do | |
| 211 | + | continue | |
| 212 | + | done | |
| 213 | + | echo "$port" | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | # print internal & external IPs | |
| 217 | + | whatip() { | |
| 218 | + | # internal | |
| 219 | + | echo -n "internal IP: " | lolcat -p 0.7; hostname -I | awk '{print $1}' | |
| 220 | + | # external | |
| 221 | + | echo -n "external IP: " | lolcat -p 0.7; curl -4 icanhazip.com | |
| 222 | + | } | |
| 223 | + | ||
| 224 | + | # password generator. takes input for password length by number | |
| 225 | + | passgen() { | |
| 226 | + | PASSLENGTH=$(gum input --placeholder "type a number") | |
| 227 | + | date +%s | sha256sum | base64 | head -c $PASSLENGTH ; echo | |
| 228 | + | } | |
| 229 | + | ||
| 230 | + | # display random ASCII art from | |
| 231 | + | # custom dir of art in dotfiles | |
| 232 | + | # using arttime (github: poetaman/arttime) | |
| 233 | + | playart() { | |
| 234 | + | ARTDIR="/home/kat/Documents/Code/Git/-mine/dotfiles/config/.local/share/arttime/textart" | |
| 235 | + | ARTSHUF=$(find "$ARTDIR" -type f | shuf -n1) | |
| 236 | + | ||
| 237 | + | for art in "$ARTSHUF"; do | |
| 238 | + | arttime --nolearn -a ${art} --ac 5 | |
| 239 | + | done | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | # to get quick notifs | |
| 243 | + | # after long commands | |
| 244 | + | notif() { | |
| 245 | + | notify-send "done!" | |
| 246 | + | aplay -q /usr/share/sounds/sound-icons/start | |
| 247 | + | spd-say -t female3 -r +25 "done!" | |
| 248 | + | } | |
| 249 | + | ||
| 250 | + | ###################################### | |
| 251 | + | # misc | |
| 252 | + | ###################################### | |
| 253 | + | ||
| 254 | + | eval "$(starship init bash)" | |
| 255 | + | eval "$(fzf --bash)" | |
| 256 | + | eval "$(batman --export-env)" |
+0,
-88
| ... | ... | @@ -1,88 +0,0 @@ | |
| 1 | - | #!/bin/bash | |
| 2 | - | ||
| 3 | - | # from my laptop | |
| 4 | - | ||
| 5 | - | alias nano=micro | |
| 6 | - | alias sudo="sudo " | |
| 7 | - | alias pick="pastel pick" | |
| 8 | - | alias gitall="git remote | xargs -L1 git push --all" | |
| 9 | - | ||
| 10 | - | alias fd="fdfind " | |
| 11 | - | ||
| 12 | - | alias neofetch="hyfetch" | |
| 13 | - | alias fastfetch="hyfetch" | |
| 14 | - | ||
| 15 | - | cdmess() { | |
| 16 | - | # from this blog post: | |
| 17 | - | # | |
| 18 | - | # https://blog.larah.me/mess-directory/ | |
| 19 | - | # | |
| 20 | - | today_tmpdir="${TMPDIR-/tmp}/${USER}_mess/$(date +%F)" | |
| 21 | - | mkdir -p "$today_tmpdir" | |
| 22 | - | cd "$(mktemp -d -p "${today_tmpdir}" XXXX)" | |
| 23 | - | } | |
| 24 | - | ||
| 25 | - | # don't log commands that start with a space | |
| 26 | - | export HISTCONTROL=ignorespace | |
| 27 | - | ||
| 28 | - | # catppuccin colors for fzf | |
| 29 | - | export FZF_DEFAULT_OPTS=" \ | |
| 30 | - | --color=spinner:#F2D5CF,hl:#E78284 \ | |
| 31 | - | --color=fg:#C6D0F5,header:#E78284,info:#CA9EE6,pointer:#F2D5CF \ | |
| 32 | - | --color=marker:#BABBF1,fg+:#C6D0F5,prompt:#CA9EE6,hl+:#E78284 \ | |
| 33 | - | --color=border:#414559,label:#C6D0F5" | |
| 34 | - | ||
| 35 | - | # lazy ass way for me to get my idol mp3s from youtube | |
| 36 | - | # usage: ytmp3 url | |
| 37 | - | alias ytmp3="yt-dlp -f ba -x --audio-format mp3" | |
| 38 | - | ||
| 39 | - | # some cd bookmarks | |
| 40 | - | alias dotf="cd /home/kat/dotfiles" | |
| 41 | - | alias gmine="cd /home/kat/Documents/Git/-mine" | |
| 42 | - | ||
| 43 | - | # weather stuff | |
| 44 | - | alias wttr="curl https://wttr.in/New+York?F0AS" | |
| 45 | - | alias weather=wttr | |
| 46 | - | ||
| 47 | - | alias wttrlg="curl https://wttr.in/New+York?F1uq" | |
| 48 | - | alias weatherlg=wttrlg | |
| 49 | - | ||
| 50 | - | alias sun="daylight --short --timezone='America/New_York' | lolcat" | |
| 51 | - | ||
| 52 | - | # print internal & external IPs | |
| 53 | - | whatip() { | |
| 54 | - | # internal | |
| 55 | - | echo -n "internal IP: " | lolcat -p 0.7; hostname -I | awk '{print $1}' | |
| 56 | - | # external | |
| 57 | - | echo -n "external IP: " | lolcat -p 0.7; curl -4 icanhazip.com | |
| 58 | - | } | |
| 59 | - | ||
| 60 | - | # password generator. takes input for password length by number | |
| 61 | - | passgen() { | |
| 62 | - | PASSLENGTH=$(gum input --placeholder "type a number") | |
| 63 | - | date +%s | sha256sum | base64 | head -c $PASSLENGTH ; echo | |
| 64 | - | } | |
| 65 | - | ||
| 66 | - | # used to be a ~/.local/bin entry but that was dumb | |
| 67 | - | alias pusheu="git push bytes main && cd /home/kat/Documents/Git/-mine/eunoia-astro/src/utils && node git-changelog.js" | |
| 68 | - | ||
| 69 | - | # vpn split tunnel aliases based on a small script @ ~/.local/bin/mvpn | |
| 70 | - | alias mftp="mvpn filezilla" | |
| 71 | - | alias mterm="mvpn kitty" | |
| 72 | - | ||
| 73 | - | # quickly look up a program on cheat.sh | |
| 74 | - | cheatsh() { | |
| 75 | - | curl "cheat.sh/$1" | |
| 76 | - | } | |
| 77 | - | ||
| 78 | - | # to get quick notifs | |
| 79 | - | # after long commands | |
| 80 | - | notif() { | |
| 81 | - | notify-send "done!" | |
| 82 | - | aplay -q /usr/share/sounds/sound-icons/start | |
| 83 | - | spd-say -t female3 -r +25 "done!" | |
| 84 | - | } | |
| 85 | - | ||
| 86 | - | alias icat="kitten icat" | |
| 87 | - | ||
| 88 | - | alias gyolo="git add . && git commit -m 'yolo'" |
+0,
-117
| ... | ... | @@ -1,117 +0,0 @@ | |
| 1 | - | #!/bin/bash | |
| 2 | - | # | |
| 3 | - | # from my pc | |
| 4 | - | ||
| 5 | - | eval "$(starship init bash)" | |
| 6 | - | ||
| 7 | - | export PATH=$PATH:/usr/local/go/bin | |
| 8 | - | ||
| 9 | - | export NVM_DIR="$HOME/.config/nvm" | |
| 10 | - | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| 11 | - | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
| 12 | - | ||
| 13 | - | alias nano=micro | |
| 14 | - | alias sudo="sudo TERMINFO=\"$TERMINFO\" " | |
| 15 | - | alias pick='pastel pick' | |
| 16 | - | alias fd='fdfind' | |
| 17 | - | alias neofetch="hyfetch" | |
| 18 | - | alias fastfetch="hyfetch" | |
| 19 | - | alias gitall="git remote | xargs -L1 git push --all" | |
| 20 | - | ||
| 21 | - | # lazy ass way for me to get my idol mp3s from youtube | |
| 22 | - | # usage: ytmp3 url | |
| 23 | - | alias ytmp3="yt-dlp -f ba -x --audio-format mp3" | |
| 24 | - | ||
| 25 | - | # weather stuff | |
| 26 | - | alias wttr="curl https://wttr.in/New+York?F0AS" | |
| 27 | - | alias weather=wttr | |
| 28 | - | ||
| 29 | - | alias wttrlg="curl https://wttr.in/New+York?F1uq" | |
| 30 | - | alias weatherlg=wttrlg | |
| 31 | - | ||
| 32 | - | alias sun="daylight --short --timezone='America/New_York' | lolcat" | |
| 33 | - | ||
| 34 | - | # vpn split tunnel aliases based on a small script @ ~/.local/bin/mvpn | |
| 35 | - | alias mftp="mvpn filezilla" | |
| 36 | - | alias mterm="mvpn kitty" | |
| 37 | - | ||
| 38 | - | export EDITOR=/usr/bin/micro | |
| 39 | - | export "MICRO_TRUECOLOR=1" | |
| 40 | - | ||
| 41 | - | # catppuccin colors for fzf | |
| 42 | - | export FZF_DEFAULT_OPTS=" \ | |
| 43 | - | --color=spinner:#F2D5CF,hl:#E78284 \ | |
| 44 | - | --color=fg:#C6D0F5,header:#E78284,info:#CA9EE6,pointer:#F2D5CF \ | |
| 45 | - | --color=marker:#BABBF1,fg+:#C6D0F5,prompt:#CA9EE6,hl+:#E78284 \ | |
| 46 | - | --color=border:#414559,label:#C6D0F5" | |
| 47 | - | ||
| 48 | - | cdmess() { | |
| 49 | - | # from this blog post: | |
| 50 | - | # https://blog.larah.me/mess-directory/ | |
| 51 | - | today_tmpdir="${TMPDIR-/tmp}/${USER}_mess/$(date +%F)" | |
| 52 | - | mkdir -p "$today_tmpdir" | |
| 53 | - | cd "$(mktemp -d -p "${today_tmpdir}" XXXX)" | |
| 54 | - | } | |
| 55 | - | ||
| 56 | - | # get a random free port. this is useful for my | |
| 57 | - | # insane sysadmin website woman adventures | |
| 58 | - | portfree() { | |
| 59 | - | while | |
| 60 | - | port=$(shuf -n 1 -i 49152-65535) | |
| 61 | - | netstat -atun | grep -q "$port" | |
| 62 | - | do | |
| 63 | - | continue | |
| 64 | - | done | |
| 65 | - | echo "$port" | |
| 66 | - | } | |
| 67 | - | ||
| 68 | - | # print internal & external IPs | |
| 69 | - | whatip() { | |
| 70 | - | # internal | |
| 71 | - | echo -n "internal IP: " | lolcat -p 0.7; hostname -I | awk '{print $1}' | |
| 72 | - | # external | |
| 73 | - | echo -n "external IP: " | lolcat -p 0.7; curl -4 icanhazip.com | |
| 74 | - | } | |
| 75 | - | ||
| 76 | - | # password generator. takes input for password length by number | |
| 77 | - | passgen() { | |
| 78 | - | PASSLENGTH=$(gum input --placeholder "type a number") | |
| 79 | - | date +%s | sha256sum | base64 | head -c $PASSLENGTH ; echo | |
| 80 | - | } | |
| 81 | - | ||
| 82 | - | # cd bookmarks | |
| 83 | - | alias dotf="cd /home/kat/dotfiles" | |
| 84 | - | alias gmine="cd /home/kat/Documents/Git/-mine" | |
| 85 | - | ||
| 86 | - | alias pusheu="git push bytes main && cd /home/kat/Documents/Git/-mine/eunoia-astro/src/utils && node git-changelog.js" | |
| 87 | - | ||
| 88 | - | alias iconsubfol="find . -mindepth 2 -type f -print -exec mv {} . \;" | |
| 89 | - | ||
| 90 | - | # quickly look up a program on cheat.sh | |
| 91 | - | cheat() { | |
| 92 | - | curl cheat.sh/"$1" | |
| 93 | - | } | |
| 94 | - | ||
| 95 | - | # display random ASCII art from | |
| 96 | - | # custom dir of art in dotfiles | |
| 97 | - | # using arttime (github: poetaman/arttime) | |
| 98 | - | playart() { | |
| 99 | - | ARTDIR="/home/kat/Documents/Code/Git/-mine/dotfiles/config/.local/share/arttime/textart" | |
| 100 | - | ARTSHUF=$(find "$ARTDIR" -type f | shuf -n1) | |
| 101 | - | ||
| 102 | - | for art in "$ARTSHUF"; do | |
| 103 | - | arttime --nolearn -a ${art} --ac 5 | |
| 104 | - | done | |
| 105 | - | } | |
| 106 | - | ||
| 107 | - | # to get quick notifs | |
| 108 | - | # after long commands | |
| 109 | - | notif() { | |
| 110 | - | notify-send "done!" | |
| 111 | - | aplay -q /usr/share/sounds/sound-icons/start | |
| 112 | - | spd-say -t female3 -r +25 "done!" | |
| 113 | - | } | |
| 114 | - | ||
| 115 | - | alias icat="kitten icat" | |
| 116 | - | ||
| 117 | - | alias gyolo="git add . && git commit -m 'yolo'" |