# Source other files [ -r ~/.prompt ] && . ~/.prompt [ -r ~/.devspec ] && . ~/.devspec [ -r ~/.config/isotope.dark ] && . ~/.config/isotope.dark # History stuff export HISTCONTROL=ignoredups:erasedups export HISTFILESIZE=1000 export HISTSIZE=1000 export GPG_TTY=$(tty) # We hate sudo here alias sudo='sh -c "exit 1"' # Other aliases alias clear="printf '\033c'" # faster than ncurses clear by a lot alias c='clear' alias ls='ls --color=auto -FAh' alias ll='ls -l' alias rebash='. ~/.bashrc' alias bashrc="$EDITOR ~/.bashrc && rebash" alias nf='neofetch' alias sshd='boas /usr/sbin/sshd' alias ga='git add' alias gc='git commit -sS' alias gp='git push' alias wv='mpv $($PASTE_COMMAND)' alias lc='fc -nl $HISTCMD' # Completions for elevation program (https://codeberg.org/Bowuigi/Unit21 in management/boas) complete -cf boas # Random string (passwords) randstr() { tr -cd [:graph:] >($COPY_COMMAND) } # Get local IP lip() { local OLD_IFS="$IFS" local LINE_NUM=0 local STR_NUM=0 while read -r LINE; do if [[ "$LINE" == *"${1:-$WIFI}"* ]]; then LINE_NUM=$((LINE_NUM+1)) if [[ $LINE_NUM == 2 ]]; then for STR in $LINE; do STR_NUM=$((STR_NUM+1)) if [[ $STR_NUM == 2 ]]; then local IP="$STR" IFS="/" for STR in $IP; do echo "$STR" break 3 done fi done fi fi done <<< "$(ip a)" IFS="$OLD_IFS" } # URL-encode stdin urlencode() { LC_COLLATE_OLD=$LC_COLLATE LC_COLLATE=C local TEXT="$( /dev/null \;; } fixdh() { diffhome | awk '{print $2 " " $4}' | while read -r line; do cp $line; done; }