aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorBryson Steck <me@brysonsteck.xyz>2024-04-09 18:29:39 -0600
committerBryson Steck <me@brysonsteck.xyz>2024-04-09 18:29:39 -0600
commitc6cc202ab95e6f199e63d59ea68d4bcb39940945 (patch)
tree5b1c17cfa3eeea20b401b6dcf7b303a1556ab39d /bash
parentc1e3c46afdcb455175f0bb18b606f61c864d008a (diff)
downloaddotfiles-c6cc202ab95e6f199e63d59ea68d4bcb39940945.tar
dotfiles-c6cc202ab95e6f199e63d59ea68d4bcb39940945.tar.gz
dotfiles-c6cc202ab95e6f199e63d59ea68d4bcb39940945.tar.bz2
redid bash config and update script, experimenting with doom emacsHEADmaster
Diffstat (limited to 'bash')
-rw-r--r--bash/.bash/00-global.bash14
-rw-r--r--bash/.bash/01-aliases.bash85
-rw-r--r--bash/.bash/02-prompt.bash135
-rw-r--r--bash/.bash/03-boot.bash32
-rw-r--r--bash/.bash/04-other.bash7
-rw-r--r--bash/.bash_profile20
-rw-r--r--bash/.bashrc15
7 files changed, 0 insertions, 308 deletions
diff --git a/bash/.bash/00-global.bash b/bash/.bash/00-global.bash
deleted file mode 100644
index 1700755..0000000
--- a/bash/.bash/00-global.bash
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-#
-# 00-global.bash
-# define global bash things
-#
-
-# expand history size
-export HISTSIZE=100000
-
-# source global definitions
-if [ -f /etc/bashrc ]; then
- . /etc/bashrc
-fi
-
diff --git a/bash/.bash/01-aliases.bash b/bash/.bash/01-aliases.bash
deleted file mode 100644
index 3786b8f..0000000
--- a/bash/.bash/01-aliases.bash
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-#
-# 01-aliases.bash
-# bryson's bash aliases
-#
-
-shopt -s expand_aliases
-
-alias sudo="doas"
-
-# typos
-alias l='ls'
-alias sl='ls'
-alias balls='sudo $(fc -ln -1)'
-
-# always run with args
-alias grep='grep --color=auto'
-alias fgrep='fgrep --color=auto'
-alias egrep='egrep --color=auto'
-alias ls='ls --color=auto'
-alias la='ls -a'
-alias ll='ls -lh'
-alias cp='cp -iv'
-alias mv='mv -iv'
-alias rm='rm -vI'
-alias diff='diff --color=auto'
-alias g++='g++ --std=c++20'
-alias vim='vim -p'
-alias gs='gs -dNOSAFER'
-
-# cd shortcuts
-alias ..='cd ..'
-alias ...='cd ../..'
-alias ....='cd ../../..'
-alias b='cd -'
-
-# portage aliases
-alias emerge-update="sudo emerge --ask --verbose --update --deep --changed-use @world"
-alias package.use='sudo vim /etc/portage/package.use'
-alias make.conf='sudo vim /etc/portage/make.conf'
-alias package.license='sudo vim /etc/portage/package.license'
-alias world='vim -R /var/lib/portage/world'
-
-# copy an entire file
-alias copy='xclip -sel c <'
-
-# binary substitutions
-alias java='/usr/local/java/jdk-18.0.1.1/bin/java'
-alias java11='/usr/bin/java'
-alias python='python3'
-alias ed='fzf --height=15 --layout=reverse | sed "s/^/\"/g;s/$/\"/g" | xargs -ro vim'
-
-# common combinations
-alias dj='python manage.py'
-alias smci='sudo make clean install'
-alias smi='sudo make install'
-alias lib='xrandr --output HDMI-A-0 --auto --output eDP --off && xset r rate 300 50 && feh --bg-fill ~/git/wallpapers-exorcist/gruvbox/mountains-2.jpg && xmodmap ~/.Xmodmap'
-alias nolib='xrandr --output HDMI-A-0 --off --output eDP --auto && feh --bg-fill ~/git/wallpapers-exorcist/gruvbox/mountains-2.jpg'
-alias hgrep='history | grep'
-alias keys='xset r rate 300 50'
-alias gits='git status'
-alias mac="rm -rf __MACOSX/; rm \$(find . -name '.DS_Store')"
-alias super='xmodmap -e "remove mod1 = Alt_L"; xmodmap -e "remove mod4 = Super_L"; xmodmap -e "add mod1 = Super_L"; xmodmap -e "add mod4 = Alt_L"'
-alias make-kernel='sudo genkernel --luks --lvm --install --kernel-config=/proc/config.gz --microcode=intel all && sudo grub-mkconfig -o /boot/grub/grub.cfg'
-
-# bash navigation
-alias aa='vim ~/.bash/01-aliases.bash; . ~/.bash_profile'
-
-ssh-pixel() {
- ssh -p 8022 uO_14O@${1}
-}
-
-# fixes
-alias fixwifi='sudo rc-service wpa_supplicant restart'
-alias fixaudio='pacmd set-default-sink alsa_output.usb-0c76_USB_PnP_Audio_Device-00.analog-stereo'
-alias fixjava='export _JAVA_AWT_WM_NONREPARENTING=1 && export AWT_TOOLKIT=MToolkit && wmname LG3D'
-alias fixkeb='xmodmap ~/.Xmodmap ; xset r rate 200 80 '
-
-# auto elevate
-alias mount='sudo mount'
-alias umount='sudo umount'
-
-# other garbage
-alias server="python3 /home/bryson/git/webserver/server.py"
-
diff --git a/bash/.bash/02-prompt.bash b/bash/.bash/02-prompt.bash
deleted file mode 100644
index 035f216..0000000
--- a/bash/.bash/02-prompt.bash
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/bin/bash
-#
-# 02-prompt.bash
-# bryson's gnarly bash prompt config
-#
-shopt -s histappend
-
-# color definitions
-black='\e[0;30m'
-BLACK='\e[1;30m'
-dgray='\e[0;90m'
-DGRAY='\e[1;90m'
-red='\e[0;31m'
-RED='\e[1;31m'
-lred='\e[0;91m'
-LRED='\e[1;91m'
-green='\e[0;32m'
-GREEN='\e[1;32m'
-lgreen='\e[0;92m'
-LGREEN='\e[1;92m'
-yellow='\e[0;33m'
-YELLOW='\e[1;33m'
-lyellow='\e[0;93m'
-LYELLOW='\e[1;93m'
-blue='\e[0;34m'
-BLUE='\e[1;34m'
-lblue='\e[0;94m'
-LBLUE='\e[1;94m'
-magenta='\e[0;35m'
-MAGENTA='\e[1;35m'
-lmagenta='\e[0;95m'
-LMAGENTA='\e[1;95m'
-cyan='\e[0;36m'
-CYAN='\e[1;36m'
-lcyan='\e[0;96m'
-LCYAN='\e[1;96m'
-lgray='\e[0;37m'
-LGRAY='\e[1;37m'
-NC='\e[0m' # No Color
-
-# 256color prompt variables
-color1='\e[38;5;39m'
-color2='\e[38;5;81m'
-color3='\e[38;5;77m'
-color4='\e[38;5;226m'
-
-# return exit code of last program if not 0
-function exit_code() {
- local ERROR="$?"
- if [[ ERROR -ne 0 ]]; then
- echo -n ''"$dgray"'\]/\['"$RED"'\]'"$ERROR"'\['"$dgray"'\]\\'
- # echo -n '\['"$RED"'\]'"$ERROR"' '
- else
- echo -n ''"$dgray"'\]/\['"$LCYAN"'\]'"$ERROR"'\['"$dgray"'\]\\'
- fi
-}
-
-# get current git branch and status
-# http://www.opinionatedprogrammer.com/2011/01/colorful-bash-prompt-reflecting-git-status/
-function _git_prompt() {
- local git_status="`git status -unormal 2>&1`"
- if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
- if [[ "$git_status" =~ nothing\ to\ commit ]]; then
- local ansi=""
- local color="$lgreen"
- elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
- local ansi="!"
- local color="$lred"
- else
- local ansi="*"
- local color="$lyellow"
- fi
- if [[ "$git_status" =~ On\ branch\ ([^[:space:]]+) ]]; then
- branch=${BASH_REMATCH[1]}
- else
- # Detached HEAD. (branch=HEAD is a faster alternative.)
- branch="`git describe --all --contains --abbrev=4 HEAD 2> /dev/null ||
- echo local`"
- fi
- if ! [[ "$branch" =~ local ]]; then
- # echo -n '\['"$color"'\] ('"$ansi"''"$branch"') '
- echo -n '\['"$dgray"'\](\['"$color"'\]'"$branch"''"$ansi"'\['"$dgray"'\])'
- fi
- fi
-}
-
-export -f exit_code
-export -f _git_prompt
-
-# prompt building
-# (2 unicode)[ bryson@hostname ] { /current/path }
-# (unicode) $
-#export _PS1="\[$dgray\]╭─[ \[$LGREEN\]\u\[$lgray\]@\[$YELLOW\]\h\[$dgray\] ] {\[$LBLUE\] \w\[$dgray\] } "
-#export _PS2="\[$dgray\]╰ "
-
-# same as above, no unicode
-#export _PS1="\[$dgray\][ \[$GREEN\]\u\[$lgray\]@\[$LRED\]\h\[$dgray\] ] { \[$LCYAN\]\w\[$dgray\] } "
-
-# bryson@hostname /current/path/ bash 10:00:00 PM
-#export _PS1="\[\e[1m$color1\]\u\[$color2\]@\[$color3\]\h \[$color4\]\w \[$color3\]\@ \[$color2\]\s "
-
-# [ bryson@hostname /current/path ]
-# $
-#export _PS1="\[$lgray\][ \[\e[1m$color1\]\u\[$color2\]@\[$color3\]\h \[$color4\]\w \[\e[0m$lgray\]]"
-#export _PS1="\[\e[$lgray\][ \[$LBLUE\]\u\[$lcyan\]@\[$GREEN\]\h \[$LYELLOW\]\w \[$lgray\]]"
-#export _PS2="\[$dgray\]"
-
-# [ bryson@hostname path ]
-# $
-#export _PS1="\[\e[$lgray\][ \[$LBLUE\]\u\[$lcyan\]@\[$GREEN\]\h \[$LYELLOW\]\W \[$lgray\]]"
-#export _PS2="\[$dgray\]"
-
-#export _PS1="\[\e[$lgray\]\[$LBLUE\]\u\[$lcyan\]@\[$GREEN\]\h \[$LYELLOW\]\W\[$lgray\]"
-
-# [ hostname ] Thu Mar 25, 10:00:00 AM, /dev/pts/0
-# { /current/path } 8 files, 64 KB (master)
-# $
-# export _PS1="\[$lgray\][ \[$LMAGENTA\]\h\[$lgray\] ] \[$LYELLOW\]\d, \[$LRED\]\T"
-# export _PS2="\[$lgray\]{ \[$CYAN\]\w\[$lgray\] }"
-
-# bryson@hostname:/current/path:master
-# $
-# export _PS1="\[$LBLUE\]\u\[$dgray\]@\[$LGREEN\]\h\[$dgray\]:\[$LYELLOW\]\w"
-
-# hostname[/current/path]<bryson>{12:00:00}[255](master)
-# $
-export _PS1="\[$LGREEN\]\h\[$dgray\][\[$LYELLOW\]\w\[$dgray\]]<\[$LBLUE\]\u\[$dgray\]>{\[$LMAGENTA\]\@\[$dgray\]}"
-
-# define x titlebar
-TITLEBAR='\[\033]0;\u@\h:\w ($(history 1 | cut -c 8-))\]'
-
-# apply prompt and functions
-# export PROMPT_COMMAND='export PS1="$TITLEBAR$(exit_code)${_PS1}\n${_PS2}$(_git_prompt)\n\[$NC\]\$ ";history -a'
-export PROMPT_COMMAND='export PS1="$TITLEBAR${_PS1}$(exit_code)$(_git_prompt)\n\[$NC\]\$ ";history -a'
-
diff --git a/bash/.bash/03-boot.bash b/bash/.bash/03-boot.bash
deleted file mode 100644
index 952dd83..0000000
--- a/bash/.bash/03-boot.bash
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# 03-boot.bash
-# startup scripts for systems
-
-# run startup script if tty
-# for dingo
-if [[ $TERM == 'linux' && $(hostname) == 'landseer' ]]; then
- cat ~/bin/house.txt
- printf "\n${CYAN}Welcome back Bryson :)\n\n"
- printf "${LGREEN}What should landseer do?\n${magenta}"
- echo -e "\tn: start x\n\tq: shutdown\n\tr: reboot\n\tl: logout\n\tb: bash\n\n"
-
- while read -rs -N 1 key; do
- printf "${NC}"
- case $key in
- n) startx ;;
- q) echo "Are you sure you want to shutdown? (y/n)";
- read -rs -N 1 key2; case $key2 in y) doas shutdown -Ph now ;; esac; ;;
- r) echo "Are you sure you want to reboot? (y/n)";
- read -rs -N 1 key3; case $key3 in y) doas reboot ;; esac; ;;
- l) logout ;;
- b) break ;;
- [h?]) echo "$USAGE";;
- esac
- clear
- cat ~/bin/house.txt
- printf "\n${LGREEN}What should landseer do?\n${magenta}"
- echo -e "\tn: start x\n\tq: shutdown\n\tr: reboot\n\tl: logout\n\tb: bash\n\n"
- done
-fi
-
diff --git a/bash/.bash/04-other.bash b/bash/.bash/04-other.bash
deleted file mode 100644
index 63271b5..0000000
--- a/bash/.bash/04-other.bash
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-# if [[ -z $TMUX ]] && [[ -n $SSH_TTY ]]; then
-# exec tmux new-session -A -s ssh
-# fi
-#
-export DOTNET_CLI_TELEMETRY_OPTOUT="true"
diff --git a/bash/.bash_profile b/bash/.bash_profile
deleted file mode 100644
index dba61c3..0000000
--- a/bash/.bash_profile
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# .bash_profile
-
-PATH=$PATH:$HOME/.local/bin:$HOME/bin:$HOME/.cargo/bin:$HOME/.dotnet/tools
-
-# Get the aliases and functions
-if [ -f ~/.bashrc ]; then
- . ~/.bashrc
-fi
-
-# User specific environment and startup programs
-export EDITOR=/usr/bin/vim
-export TERMINAL=/usr/bin/alacritty
-export BROWSER=/usr/bin/librewolf-bin
-export XZ_OPT='-9 -T0 -M 32000000000'
-
-export PATH
-complete -cf doas
-source /usr/share/bash-completion/completions/fzf
-source /usr/share/fzf/key-bindings.bash
diff --git a/bash/.bashrc b/bash/.bashrc
deleted file mode 100644
index 821a3fb..0000000
--- a/bash/.bashrc
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-# get custom bash scripts
-if [ -d ~/.bash/ ]; then
- for f in ~/.bash/*; do . $f; done
-fi
-
-# install asdf
-#. $HOME/.asdf/asdf.sh
-#. $HOME/.asdf/completions/asdf.bash
-
-# devkitpro
-DEVKITPRO=/opt/devkitpro
-DEVKITARM=/opt/devkitpro/devkitARM
-DEVKITPPC=/opt/devkitpro/devkitPPC