diff options
Diffstat (limited to 'bash')
-rw-r--r-- | bash/.bash/01-aliases.bash | 2 | ||||
-rw-r--r-- | bash/.bash/02-prompt.bash | 17 | ||||
-rw-r--r-- | bash/.bash/03-boot.bash | 43 | ||||
-rw-r--r-- | bash/.bash_profile | 1 |
4 files changed, 25 insertions, 38 deletions
diff --git a/bash/.bash/01-aliases.bash b/bash/.bash/01-aliases.bash index 511503c..3786b8f 100644 --- a/bash/.bash/01-aliases.bash +++ b/bash/.bash/01-aliases.bash @@ -61,7 +61,7 @@ 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 --kernel-config=/proc/config.gz all && sudo grub-mkconfig -o /boot/grub/grub.cfg' +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' diff --git a/bash/.bash/02-prompt.bash b/bash/.bash/02-prompt.bash index 8181d33..035f216 100644 --- a/bash/.bash/02-prompt.bash +++ b/bash/.bash/02-prompt.bash @@ -48,8 +48,10 @@ color4='\e[38;5;226m' function exit_code() { local ERROR="$?" if [[ ERROR -ne 0 ]]; then - echo -n '\['"$RED"'\]'"$ERROR"'\['"$dgray"'\]!' + echo -n ''"$dgray"'\]/\['"$RED"'\]'"$ERROR"'\['"$dgray"'\]\\' # echo -n '\['"$RED"'\]'"$ERROR"' ' + else + echo -n ''"$dgray"'\]/\['"$LCYAN"'\]'"$ERROR"'\['"$dgray"'\]\\' fi } @@ -77,7 +79,7 @@ function _git_prompt() { fi if ! [[ "$branch" =~ local ]]; then # echo -n '\['"$color"'\] ('"$ansi"''"$branch"') ' - echo -n '\['"$dgray"'\]#\['"$color"'\]'"$branch"''"$ansi"'' + echo -n '\['"$dgray"'\](\['"$color"'\]'"$branch"''"$ansi"'\['"$dgray"'\])' fi fi } @@ -116,15 +118,18 @@ export -f _git_prompt # export _PS1="\[$lgray\][ \[$LMAGENTA\]\h\[$lgray\] ] \[$LYELLOW\]\d, \[$LRED\]\T" # export _PS2="\[$lgray\]{ \[$CYAN\]\w\[$lgray\] }" -# bryson@dingo:/current/path:master +# bryson@hostname:/current/path:master # $ -# -export _PS1="\[$LBLUE\]\u\[$dgray\]@\[$LGREEN\]\h\[$dgray\]:\[$LYELLOW\]\w" +# 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$(exit_code)${_PS1}$(_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 index 333aaed..952dd83 100644 --- a/bash/.bash/03-boot.bash +++ b/bash/.bash/03-boot.bash @@ -3,49 +3,30 @@ # 03-boot.bash # startup scripts for systems -bat_check() { - TEST=$(acpi | grep "Discharging" | grep -v "rate information") - - if [[ $? -eq 0 ]]; then - echo "***********************************************************" - echo " WARNING" - echo "***********************************************************" - echo "Power supply is not plugged in." - echo "Make sure it is plugged in to avoid a random shutdown." - read -rs -N 1 -p "Press [Enter] to continue, any other key to return..." input; - if grep -q "$input" <<< ""; then - echo "" - else - return 1 - fi - fi -} - # run startup script if tty # for dingo -if [[ $TERM == 'linux' && $(hostname) == 'dingo' ]]; then +if [[ $TERM == 'linux' && $(hostname) == 'landseer' ]]; then cat ~/bin/house.txt printf "\n${CYAN}Welcome back Bryson :)\n\n" - printf "${LGREEN}What should dingo do?\n${magenta}" - echo -e '\td: start docked\n\tn: start not docked\n\tq: shutdown\n\tr: reboot\n\tl: logout\n\tb: bash\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 - d) bat_check && startx ;; - n) nstartx.sh ;; - 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 ;; + 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 dingo do now?\n${magenta}" - echo -e '\td: start docked\n\tn: start not docked\n\tq: shutdown\n\tr: reboot\n\tl: logout\n\tb: bash\n\n' + 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_profile b/bash/.bash_profile index c93170e..dba61c3 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -12,6 +12,7 @@ fi 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 |