Updated file-structure and transfered data out of local bashrc
This commit is contained in:
parent
f1a4076267
commit
cb67fb7efa
@ -1,46 +1,4 @@
|
|||||||
# ------------------------------------------------------------
|
#!/bin/bash
|
||||||
# -- 'ls' colorscheme ------------------------------------------
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
|
|
||||||
# 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'
|
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# -- BASH prompt colorscheme -----------------------------------
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
|
|
||||||
# Regular
|
# Regular
|
||||||
txtblk="$(tput setaf 0 2>/dev/null || echo '\e[0;30m')" # Black
|
txtblk="$(tput setaf 0 2>/dev/null || echo '\e[0;30m')" # Black
|
||||||
txtred="$(tput setaf 1 2>/dev/null || echo '\e[0;31m')" # Red
|
txtred="$(tput setaf 1 2>/dev/null || echo '\e[0;31m')" # Red
|
20
bash/fun.rc
Normal file
20
bash/fun.rc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
alias cheerup="clear; echo; fortune | cowsay -f stegosaurus | lolcat; echo;"
|
||||||
|
|
||||||
|
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 clear; pika; sleep 120; done'
|
36
bash/osx/color-ls.rc
Normal file
36
bash/osx/color-ls.rc
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#!/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'
|
||||||
|
|
||||||
|
|
14
bash/osx/fun.rc
Normal file
14
bash/osx/fun.rc
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
function planktimer() {
|
||||||
|
# dependencies: 'say' 'termdown'
|
||||||
|
while true;
|
||||||
|
do
|
||||||
|
termdown 1h30m;
|
||||||
|
clear;
|
||||||
|
figlet "Plank Time" | lolcat;
|
||||||
|
say -v $(say -v ? | sed -n "/en_/p" | sed "s/ .*//" | shuf -n 1) "plank time";
|
||||||
|
read -n 1;
|
||||||
|
termdown 65;
|
||||||
|
say -v $(say -v ? | sed -n "/en_/p" | sed "s/ .*//" | shuf -n 1) "done";
|
||||||
|
done
|
||||||
|
}
|
42
bash/rentdynamics.rc
Normal file
42
bash/rentdynamics.rc
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
RD_PATH='/Users/w0ryn/Documents/RentDynamics';
|
||||||
|
|
||||||
|
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;"
|
||||||
|
}
|
28
bash/school.rc
Normal file
28
bash/school.rc
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCHOOL_DIR="$HOME/Documents/School";
|
||||||
|
|
||||||
|
# -------------------------------------
|
||||||
|
# -- School (Spring 2019) -------------
|
||||||
|
# -------------------------------------
|
||||||
|
alias school="cd $SCHOOL_DIR";
|
||||||
|
alias classes='cat ~/Documents/School/.classes' #'echo \* \(cs2810\) comparch; echo \* \(cs3100\) opsys; echo \* \(cs3450\) softeng; echo \* \(cs5050\) advalgos; echo \* hackusu; echo \* gamenight; echo'
|
||||||
|
alias comparch='school; cd cs2810-comparch;'
|
||||||
|
alias cs2810='comparch'
|
||||||
|
alias opsys='school; cd cs3100-opsys'
|
||||||
|
alias cs3100='opsys'
|
||||||
|
alias softeng='school; cd cs3450-softeng'
|
||||||
|
alias cs3450='softeng'
|
||||||
|
alias advalgos='school; cd cs5050-advalgos'
|
||||||
|
alias cs5050='advalgos'
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
6
bash/time.rc
Normal file
6
bash/time.rc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
alias datereadable='date +"%A %B %d, %Y"'
|
||||||
|
|
||||||
|
function clock() {
|
||||||
|
watch -t -n1 "date +'%H : %M : %S' | figlet";
|
||||||
|
}
|
38
bashrc
38
bashrc
@ -1,35 +1,37 @@
|
|||||||
RC_DIR="$HOME/.wryn"
|
#!/bin/bash
|
||||||
|
DOTWRYN="$HOME/.wryn"
|
||||||
|
RC_DIR="$DOTWRYN/bash"
|
||||||
|
|
||||||
# terminal colors
|
# source .wryn/bash files
|
||||||
source $RC_DIR/bashcolors
|
for file in $(find $RC_DIR -maxdepth 1 -type f); do source $file; done;
|
||||||
# scripts for fun (see file for dependencies)
|
|
||||||
source $RC_DIR/fun
|
# 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
|
||||||
|
|
||||||
# --- Welcome message -----------------------------------------
|
# --- Welcome message -----------------------------------------
|
||||||
exec figlet "Welcome, beautiful" | lolcat; echo; cowsay -p "damn u sexy" | lolcat;
|
exec figlet "Welcome, beautiful" | lolcat; echo; cowsay -p "damn u sexy" | lolcat;
|
||||||
|
|
||||||
# --- Utility Alias -------------------------------------------
|
# --- Utility Alias -------------------------------------------
|
||||||
alias restart='clear; source ~/.bashrc; echo'
|
alias restart='clear; source ~/.bashrc; echo'
|
||||||
alias datereadable='date +"%A %B %d, %Y"'
|
|
||||||
|
|
||||||
# --- !@#$ Aliases --------------------------------------------
|
# --- !@#$ Aliases --------------------------------------------
|
||||||
alias clera='clear';
|
alias clera='clear';
|
||||||
|
alias sl='sl -alF | lolcat';
|
||||||
|
|
||||||
# --- Note-taking facilitated ---------------------------------
|
# --- Note-taking facilitated ---------------------------------
|
||||||
NOTE_PATH='/Users/w0ryn/Documents/notes';
|
NOTE_PATH='/Users/w0ryn/Documents/notes';
|
||||||
NOTE_EXTENSION='.txt';
|
NOTE_EXTENSION='.txt';
|
||||||
alias mynotes='cd $NOTE_PATH';
|
alias mynotes='cd $NOTE_PATH';
|
||||||
function note() { vim $NOTE_PATH/$1$NOTE_EXTENSION; }
|
function note() { vim $NOTE_PATH/$1$NOTE_EXTENSION; }
|
||||||
function notes() { NOTE="$NOTE_PATH/$1$NOTE_EXTENSION"; [ -f $NOTE ] && vim $NOTE || vim $NOTE_PATH; }
|
function notes() { NOTE="$NOTE_PATH/$1$NOTE_EXTENSION"; [ $1 ] && [ -f $NOTE ] && vim $NOTE || vim $NOTE_PATH; }
|
||||||
|
|
||||||
# --- Homework facilitated ------------------------------------
|
# --- ViM as default editor -----------------------------------
|
||||||
HW_TEMPLATE="$RC_DIR/latex/homework_template.tex"
|
export EDITOR='vim'
|
||||||
function hw() {
|
export VISUAL='vim'
|
||||||
[ $# -ne 0 ] \
|
|
||||||
&& NEW_HW="./$1.tex" \
|
|
||||||
|| echo "Homework filename required" \
|
|
||||||
&& return;
|
|
||||||
|
|
||||||
[ ! -f $NEW_HW ] && cp $HW_TEMPLATE $NEW_HW;
|
|
||||||
vim $NEW_HW || echo "Something went wrong :c";
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user