-
Notifications
You must be signed in to change notification settings - Fork 0
/
.mathis_bashrc_stuff_11132019
54 lines (43 loc) · 1.71 KB
/
.mathis_bashrc_stuff_11132019
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# paste this at the bottom of your .bashrc and add .bash_aliases to your home directory
# stuff I've added from here down. :)
# add a goofy PS1
# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
if [ -f ~/.git-prompt.sh ]; then
source ~/.git-prompt.sh
fi
#tput <smul, rmul, bold, dim, setb, setf, rev, smso, rmso, sgr0>
#tput colors: krgybmcw
# export PS1="$(tput dim)[\A|\u@\h|\w]$(tput sgr0)\n\[\033[1;32m\]->$\[\033[00m\] "
# alternate PS1
export PS1="[\A|\[\033[32m\]\u@\h\[\033[0m\]|\[\033[33m\]\w\[\033[0m\]]\[\033[36m\]`__git_ps1`$(tput sgr0)\n\[\033[1;32m\]->$\[\033[00m\] "
export PS2=" \[\033[0;35m\] ->\[\033[00m\] "
# Add my bash aliases from .bash-aliases
if [ -f ~/.bash_aliases ]; then
source ~/.bash_aliases
fi
#easy way to view md files in lynx
readmd () {
pandoc $1 | lynx -stdin
}
#memeteamdreams
hellothere () {
echo "general kenobi"
}
#don't forget about nethack.
#centOS add java to the PATH
export JAVA_HOME="/usr/lib/jvm/jdk1.8.0_251"
PATH="/usr/lib/jvm/java-11-openjdk/bin:$PATH"
#tooltip format for the manjaro clock
# It is %H hours and %M minutes into %A the %e of %B in the year of our lord %Y my liege.
obsidianbackup() {
# the path of your vault (assumes vault is a git repo
local vault_path="/the/full/path/to/your/vault/"
# Set up trap to execute 'cd -' on exit, regardless of errors
trap 'cd -' EXIT
cd "$vault_path" || { echo "Error: Could not change directory to $vault_path"; return 1; }
git add . || { echo "Error: Git add failed"; return 1; }
git commit -am "$(date +"%d%h%y@%H:%m%Z") backup" || { echo "Error: Git commit failed"; return 1; }
git push || { echo "Error: Git push failed"; return 1; }
cd -
trap - EXIT
}