From 4e4cd94784ada00bf7615be798f7c954eec85944 Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Wed, 24 Feb 2021 15:28:33 -0700 Subject: [PATCH] Deprecated bash utilities --- bash/bashcolors | 50 ---------------------- bash/fun | 3 -- bash/latex | 3 -- bash/linux/archfun | 6 --- bash/linux/dmenu_stuff | 17 -------- bash/osx/color-ls | 36 ---------------- bash/osx/osxfun | 59 -------------------------- bash/osx/osxtimer | 96 ------------------------------------------ bash/rc | 39 ----------------- bash/rentdynamics | 79 ---------------------------------- bash/school | 27 ------------ bash/time | 15 ------- bash/utility | 22 ---------- 13 files changed, 452 deletions(-) delete mode 100644 bash/bashcolors delete mode 100644 bash/fun delete mode 100644 bash/latex delete mode 100644 bash/linux/archfun delete mode 100644 bash/linux/dmenu_stuff delete mode 100644 bash/osx/color-ls delete mode 100644 bash/osx/osxfun delete mode 100644 bash/osx/osxtimer delete mode 100644 bash/rc delete mode 100644 bash/rentdynamics delete mode 100644 bash/school delete mode 100644 bash/time delete mode 100644 bash/utility diff --git a/bash/bashcolors b/bash/bashcolors deleted file mode 100644 index 5cf6cd7..0000000 --- a/bash/bashcolors +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Regular -txtblk="$(tput setaf 0 2>/dev/null || echo '\e[0;30m')" # Black -txtred="$(tput setaf 1 2>/dev/null || echo '\e[0;31m')" # Red -txtgrn="$(tput setaf 2 2>/dev/null || echo '\e[0;32m')" # Green -txtylw="$(tput setaf 3 2>/dev/null || echo '\e[0;33m')" # Yellow -txtblu="$(tput setaf 4 2>/dev/null || echo '\e[0;34m')" # Blue -txtpur="$(tput setaf 5 2>/dev/null || echo '\e[0;35m')" # Purple -txtcyn="$(tput setaf 6 2>/dev/null || echo '\e[0;36m')" # Cyan -txtwht="$(tput setaf 7 2>/dev/null || echo '\e[0;37m')" # White - -# Bold -bldblk="$(tput setaf 0 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;30m')" # Black -bldred="$(tput setaf 1 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;31m')" # Red -bldgrn="$(tput setaf 2 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;32m')" # Green -bldylw="$(tput setaf 3 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;33m')" # Yellow -bldblu="$(tput setaf 4 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;34m')" # Blue -bldpur="$(tput setaf 5 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;35m')" # Purple -bldcyn="$(tput setaf 6 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;36m')" # Cyan -bldwht="$(tput setaf 7 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;37m')" # White - -# Underline -undblk="$(tput setaf 0 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;30m')" # Black -undred="$(tput setaf 1 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;31m')" # Red -undgrn="$(tput setaf 2 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;32m')" # Green -undylw="$(tput setaf 3 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;33m')" # Yellow -undblu="$(tput setaf 4 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;34m')" # Blue -undpur="$(tput setaf 5 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;35m')" # Purple -undcyn="$(tput setaf 6 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;36m')" # Cyan -undwht="$(tput setaf 7 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;37m')" # White - -# Background -bakblk="$(tput setab 0 2>/dev/null || echo '\e[40m')" # Black -bakred="$(tput setab 1 2>/dev/null || echo '\e[41m')" # Red -bakgrn="$(tput setab 2 2>/dev/null || echo '\e[42m')" # Green -bakylw="$(tput setab 3 2>/dev/null || echo '\e[43m')" # Yellow -bakblu="$(tput setab 4 2>/dev/null || echo '\e[44m')" # Blue -bakpur="$(tput setab 5 2>/dev/null || echo '\e[45m')" # Purple -bakcyn="$(tput setab 6 2>/dev/null || echo '\e[46m')" # Cyan -bakwht="$(tput setab 7 2>/dev/null || echo '\e[47m')" # White - -# Reset -txtrst="$(tput sgr 0 2>/dev/null || echo '\e[0m')" # Text Reset - -parse_git_branch(){ - git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/' -} - -# bash prompt -PS1="\[$bldylw\] ☕ \[$txtblu\]\u\[$txtred\] :: \[$txtgrn\]\[$txtylw\]\w\[$bldcyn\]\$(parse_git_branch)\[$txtgrn\]$DEFAULT \n \$ \[$txtrst\]" diff --git a/bash/fun b/bash/fun deleted file mode 100644 index 34c2fca..0000000 --- a/bash/fun +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -alias cheerup="clear; echo; fortune | cowsay -f stegosaurus | lolcat; echo;" -alias netrogue='nethack -u "w0ryn-rog-hum-cha-mal"' diff --git a/bash/latex b/bash/latex deleted file mode 100644 index d8c5636..0000000 --- a/bash/latex +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -alias tekclean='rm *.aux *.log *.pdf' diff --git a/bash/linux/archfun b/bash/linux/archfun deleted file mode 100644 index d1f2c66..0000000 --- a/bash/linux/archfun +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# dependency :: feh -alias bgrandomizer="feh --randomize --bg-fill $HOME/.wallpaper/1/* $HOME/.wallpaper/2/* $HOME/.wallpaper/3/*"; -# temp -alias bgrandomizer="feh --randomize --bg-fill $HOME/.wallpaper/* $HOME/.wallpaper/* $HOME/.wallpaper/*"; diff --git a/bash/linux/dmenu_stuff b/bash/linux/dmenu_stuff deleted file mode 100644 index e393676..0000000 --- a/bash/linux/dmenu_stuff +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Make a new dmenu shortcut -DMENU_CUSTOM_BIN="$HOME/.local/custom_dmenu"; - -[ ! -d $DMENU_CUSTOM_BIN ] && mkdir $DMENU_CUSTOM_BIN; - -function new_dmenu_command() { - local DMENU_BIN="$HOME/.local/custom_dmenu"; - - # fail withouut both arguments - [ ! $2 ] && exit 1; - - echo "${@:2}" - echo "${@:2}" > $DMENU_BIN/$1 2>/dev/null - chmod +x $DMENU_BIN/$1 -} diff --git a/bash/osx/color-ls b/bash/osx/color-ls deleted file mode 100644 index 2e9ba69..0000000 --- a/bash/osx/color-ls +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Colors are organized into (Foreground)(Background) bits as seen below: -# ======== -# 1 - Directory -# 2 - Symbolic link -# 3 - Socket -# 4 - Pipe -# 5 - Executable -# 6 - Block special -# 7 - Character special -# 8 - Executable with setgid bit set -# 9 - Executable with setgid bit set -# 10- Directory writable to others, with sticky bit -# 11- Directory writable to others, without sticky bit -# ======== -# a black -# b red -# c green -# d brown -# e blue -# f magenta -# g cyan -# h light grey -# CAPITAL (BOLD) -# x default - -# actual colorscheme -export LSCOLORS="ExxxxxDxBxxxxxxxxxxxxx" - -# for OSX, fixes spacing issues -f_notabs=0 - -# default ls to use defined colorscheme -alias ls='ls -G' - - diff --git a/bash/osx/osxfun b/bash/osx/osxfun deleted file mode 100644 index 48df127..0000000 --- a/bash/osx/osxfun +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -function voicesed() { sed 's/\([^ ]*\) .*/\1/;'; } -function voicelist() { say -v ? | voicesed; } -function voicelistenglish() { say -v ? | grep 'en_' | voicesed; } -function voicerandom() { voicelistenglish | shuf -n 1; } - -function voicelistnormal() { - voicelistenglish | - sed '/Trinoids/d;/Zarvox/d;/Deranged/d;/Hysterical/d;/Bahh/d;/Bubbles/d' -} -function voicerandomnormal() { voicelistnormal | shuf -n 1; } - -function sayvoices() { - for voice in $(voicelist); do - say -v "$voice" $(say -v ? | grep $voice | sed 's/[^#]*# //'); - done -} - -function sayone() { - local voice=$(voicerandom); - say -v "$voice" $(say -v ? | grep $voice | sed 's/[^#]*# //'); -} - - -function meme { - local DIRECTORY="$HOME/Pictures/jest"; - - [ ! -d $DIRECTORY ] && echo "No meme directory found :c"; - - echo; - imgcat $DIRECTORY/$1 - echo; -} -_meme () { # autocompletion - # Set - local cur=${COMP_WORDS[COMP_CWORD]} - COMPREPLY=( $(compgen -W "$(ls $HOME/Pictures/jest)" -- $cur) ) -} -complete -F _meme meme; - -function pika { - local DIRECTORY="$HOME/Pictures/pika"; - - [ ! -d $DIRECTORY ] && echo "Pikachu directory required." && exit 1; - - # count the pikas - IMAGE_COUNT=$(ls -l $DIRECTORY | wc -l); - let "IMAGE_COUNT=IMAGE_COUNT-1"; - - # pick a random gif from the pikachu directory - IMAGE="$DIRECTORY/$((RANDOM % $IMAGE_COUNT)).gif"; - - echo; - imgcat $IMAGE - echo; -} - -alias pikabox='while true; do reset; pika; sleep 120; done' diff --git a/bash/osx/osxtimer b/bash/osx/osxtimer deleted file mode 100644 index 20a96c6..0000000 --- a/bash/osx/osxtimer +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -function osxtimer() { - # dependency check - #termdown --version >/dev/null 2>&1 || { echo osxtimer requires 'termdown'; exit 1; } - #lolcat --version >/dev/null 2>&1 || lolcatError='`lolcat` is not installed'; - #figlet --version >/dev/null 2>&1 || figletError='`figlet` is not installed'; - - # set defaults - local msg; - local timestring='10s'; - local voice; - local critical; - local dontsaycountdown; - local dontsaymessage; - local dowait; - local dontdisplaymessage; - local displayHelp; - - unset OPTIND; - while getopts "MVTYhwm:t:c:v:" opt; do - case $opt in - m) msg=$OPTARG ;; # optional message - M) dontdisplaymessage=t ;; # don't display message (but maybe say it) - t) timestring=$OPTARG ;; # termdown countdown string - c) critical=$OPTARG ;; # optional critical seconds remaining - v) voice=$OPTARG ;; # optional voice for critical seconds remaining - V) voice=$(voicerandom) ;; # select random voice - T) dontsaycountdown=t; ;; # don't readout countdown - V) dontsaymessage=t; ;; # don't readout message after countdown - w) dowait=t; ;; # don't wait for user input after the timer - h) displayHelp=t; ;; # display help message - :) echo option -$OPTARG requires an argument; displayHelp=t; - ;; - esac - done - unset OPTIND; - - # exit on fail - if [ $displayHelp ]; then - printf " -Correct usage: - [-t]\t countdown amount as a timestring used in 'termdown' - [-m]\t display message after countdown is finished - [-c]\t critical seconds param for 'termdown' - [-v]\t 'say' voice used for reading the message and countdown - [-V]\t select random voice for message and timer readout - [-T]\t used with -v or -V :: don't readout the countdown - [-Y]\t used with -v or -V :: don't readout the message - [-w]\t wait for user input after the timer -\n"; - return 1; - fi; - - # verify that the voice exists - say -v ? | grep $voice >/dev/null 2>&1 || unset voice; - - local termdownargs="$timestring "; - [[ $critical ]] && termdownargs="$termdownargs -c $critical"; - [[ $voice ]] && [ -z $dontsaycountdown ] && termdownargs="$termdownargs -v $voice"; - termdown $termdownargs; - - [[ $msg ]] && [ -z $dontdisplaymessage ] && figlet "$msg" | lolcat; - [[ $voice ]] && [ -z $dontsaymessage ] && say -v "$voice" "$msg"; - - [[ $dowait ]] && read -n 1; # wait for user input -} - -function rdexercise() { - local message='Plank time!'; - local delay='1h30m'; - local count; - - # flagged arguments - unset OPTIND; - while getopts "m:t:c:" opt; do - case $opt in - m) message=$OPTARG ;; # optional message - t) timeout=$OPTARG ;; # termdown countdown string - c) count=$OPTARG ;; # length of exercise as a timestring - esac - done - unset OPTIND; - - # operation loop - while true; do - rdstart >/dev/null 2>&1; - clear; osxtimer -VT -m "$message" -t "$delay"; - rdplank >/dev/null 2>&1; - - read -n 1; clear; - [[ $count ]] && osxtimer -c 10 -m "Done" -v "$(voicerandomnormal)" -t "$count"; - done -} - -alias planktimer='rdexercise -c'; -alias pushuptimer='rdexercise -m "Push-up time!" -t "1h" -c'; diff --git a/bash/rc b/bash/rc deleted file mode 100644 index 264e271..0000000 --- a/bash/rc +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -source "$HOME/.wryn/env/env.bash" - -RC_DIR="$DOTWRYN/bash" - -# source .wryn/bash files -for file in $(find $RC_DIR -maxdepth 1 -type f ! -name 'rc'); do source $file; done; - -# osx -if [[ "$OSTYPE" == "darwin"* ]]; then - for file in $(find $RC_DIR/osx -type f); do source $file; done; -fi - -# linux -if [[ "$OSTYPE" == "linux-gnu" ]]; then - for file in $(find $RC_DIR/linux -type f); do source $file; done; -fi - -# --- ViM as default editor ----------------------------------- -export EDITOR='vim' -export VISUAL='vim' - -# --- Welcome message ----------------------------------------- -exec figlet "Welcome, beautiful" | lolcat; echo; cowsay -p "damn u sexy" | lolcat; - -alias restart='clear; source ~/.bashrc; echo' - -# --- !@#$ Aliases -------------------------------------------- -alias clera='clear'; -alias sl='sl -alF | lolcat'; - - -# --- BASH RC DEPENDENCIES ------------------------------------ -# sl -# lolcat -# figlet -# fortune -# vim -# cowsay diff --git a/bash/rentdynamics b/bash/rentdynamics deleted file mode 100644 index ad73be3..0000000 --- a/bash/rentdynamics +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -alias rdvmail='VMAIL_HOME=~/.vmail/business1 vmail'; - -function rnt() { -# filestructure needed: -# RD_PATH/project-name -# > /code (git clone) -# > /env (virtualenv) - deactivate >/dev/null 2>/dev/null || deactivate_node >/dev/null 2>/dev/null; - cd $RD_PATH; - - local cont=0; - [ $1 ] \ - && [ -d $RD_PATH/$1 ] \ - && cd $1 >/dev/null 2>/dev/null \ - || cont=1; - - if [ $cont -eq 0 ]; then - [ -f ./env/bin/activate ] \ - && source ./env/bin/activate \ - || echo No environment here, boss!; - [ -d ./code ] \ - && cd code \ - || echo No source folder here!; - fi -} -_rnt () { # autocompletion - # Set - local cur=${COMP_WORDS[COMP_CWORD]} - COMPREPLY=( $(compgen -W "$(ls $RD_PATH)" -- $cur) ) -} -complete -F _rnt rnt; - -function refresh_rd_db() { - psql postgres -c "DROP DATABASE rentdynamics;" - psql postgres -c "CREATE DATABASE rentdynamics with owner rd;" - psql postgres -c "DROP DATABASE rdrentplus;" - psql postgres -c "CREATE DATABASE rdrentplus with owner rd;" -} - -function rntbranchcleanup() { - printf "\nInitializing branch cleanup...\n\n" - for dir in $(ls $RD_PATH); do - rnt $dir >/dev/null 2>/dev/null; - if [ -d .git ]; then - printf " - %s\e[1;34m %s\e[0m..." "clearing repository" "$dir"; - git branch -d $(git branch | sed -E "/master|\*|epic-*/d") >/dev/null 2>/dev/null; - printf "\e[1;32m%s\e[0m\n" " DONE"; - else - printf " - \e[1;34m%s\e[1;31m %s\e[0m" "$dir" "is not a git repository"; - fi - rnt; - done; - printf "\n\n\e[1;36m%s\e[1;35m %s\e[0m\n\n" "RentDynamics" "repository branches all clean!"; -} - - -function rdstatus() { - slack status edit "$1" $2 >/dev/null 2>&1; -} - -alias rdclearstatus='slack status clear >/dev/null 2>&1' - -alias rdstart='rdboost' -alias rdstart2='rdpanic' -alias rdplank='rdstatus "plank time!" :evergreen_tree:' -alias rdstop='rdstatus "not making money" :sunglasses:' -alias rdstop2='rdride' -alias rdmeal='rdstatus "so hungry..." :hamburger:' -alias rdturbo='rdstatus "ZOOOM" :turbo:' -alias rdsuper='rdstatus "AAAAAAAAAAAAHHHHHHHHH" :gohan:' -alias rdmeeting='rdstatus "afk" :necktie:' -alias rdbudget='rdstatus "did somebody say skee-ball??" :scales:' -alias rdcheese='rdstatus "only the most important things on my mind" :cheese_wedge:' -alias rdfoos='rdstatus "I will defeat Mike... someday..." :soccer:' -alias rdlax='rdstatus "BELAAAAAAAX" :exploding_head:' -alias rdpanic='rdstatus "dont panic!" :exclamation:' -alias rdboost='rdstatus "Use your heart, and boost fire!" :boost_fire:' -alias rdride='rdstatus "probably riding" :man-biking:' diff --git a/bash/school b/bash/school deleted file mode 100644 index 269842c..0000000 --- a/bash/school +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# ------------------------------------- -# -- School (Fall 2019) ------------- -# ------------------------------------- - -alias school="cd $SCHOOL_DIR"; -alias classes="echo; cat $SCHOOL_DIR/.classes | lolcat; echo"; - -#alias cs5680='school; cd cs5680__computer_vision'; -#alias compvis='cs5680' -alias cs5600='school; cd cs5600__intelligent_systems'; -alias intsys='cs5600' -#alias engr3080='school; cd engr3080__tech_writing'; -#alias techwrit='engr3080' -#alias phil1120='school; cd phil1120__social_ethics'; -#alias socioet='phil1120' - - -HW_TEMPLATE="$DOTWRYN/latex/homework_template.tex" -function hw() { - # Make new homework .tex from default template - [ ! $1 ] && echo "Homework filename required" && exit 1; - - NEW_HW="./$1.tex"; - [ ! -f $NEW_HW ] && cp $HW_TEMPLATE $NEW_HW; - vim $NEW_HW; -} diff --git a/bash/time b/bash/time deleted file mode 100644 index 53d5ef4..0000000 --- a/bash/time +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -alias datereadable='date +"%A %B %d, %Y"' - -function saydate() { - local todaysdate="$(date +'%A %B %d, %Y')" - local currenthour="$(date +'%H')" - local currentminute="$(date +'%M')" - [[ $currentminute -lt 10 ]] && currentminute="O $currentminute"; - - say "it's currently $currenthour $currentminute on $todaysdate"; -} - -function clock() { - watch -c -t -n1 "date +'%H : %M : %S' | figlet" | lolcat; -} diff --git a/bash/utility b/bash/utility deleted file mode 100644 index 2855d07..0000000 --- a/bash/utility +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# --- Shortcuts for quick ARANDR switch ----------------------- -alias undock="$DOTWRYN/config/xserver/screenlayout/undock.sh"; -alias workdock="$DOTWRYN/config/xserver/screenlayout/workdock.sh"; -alias homedock="$DOTWRYN/config/xserver/screenlayout/homedock_hdmionly.sh"; -alias hdmidock="$DOTWRYN/config/xserver/screenlayout/hdmidock.sh"; - -# --- Note-taking facilitated --------------------------------- -NOTE_PATH='/Users/w0ryn/Documents/notes'; -NOTE_EXTENSION='.txt'; -alias mynotes='cd $NOTE_PATH'; -function note() { vim $NOTE_PATH/$1$NOTE_EXTENSION; } -function notes() { NOTE="$NOTE_PATH/$1$NOTE_EXTENSION"; [ $1 ] && [ -f $NOTE ] && vim $NOTE || vim $NOTE_PATH; } - -# --- GIT ----------------------------------------------------- -alias gitbranchcleanup='git branch -d $(git branch | sed -E "/develop|master|\*/d")' - - -alias pd='pushd'; -alias qd='popd'; -alias ds='dirs';