forked from palmer-dabbelt/home
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
102 lines (88 loc) · 2.52 KB
/
.bashrc
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
# Enable all bash completions
source ~/.local/share/bash-completion/bash_completion
# Use my local programs
export PATH="$HOME/.local/bin:$PATH"
# Setup my personal shell variables that are the same everywhere
export EDITOR="e"
export BROWSER="firefox"
export GIT_EDITOR="vim"
export MHNG_EDITOR="vim"
alias no=ls
# MH aliases
alias scan="mhng-scan"
alias inbox="mhng-scan inbox"
alias rss="mhng-scan rss"
alias lists="mhng-scan lists"
alias promo="mhng-scan promo"
alias drafts="mhng-scan drafts"
alias sent="mhng-scan sent"
alias trash="mhng-scan trash"
alias lkml="mhng-scan linux"
alias post="mhng-post"
alias rmm="mhng-rmm"
alias mime="mhng-mime"
alias show="mhng-show"
alias next="mhng-next"
alias prev="mhng-prev"
alias mtn="mhng-mtn"
alias mtp="mhng-mtp"
alias folders="mhng-folders"
alias urls="mhng-urls"
alias url="mhng-urls 1"
alias comp="mhng-comp"
alias forw="mhng-forw"
alias repl="mhng-repl"
alias detach="mhng-detach"
alias hud="watch mhng-hud"
alias gmail="firefox \"https://mail.google.com/mail/u/0/#search/rfc822msgid=\$(mhng-pipe-header message-id | sed 's/<\(.*\)>/\1/' | sed 's/\+/%2B/g')\""
alias mal="mhng-hud"
alias mhng-log="tail -n40 ~/.mhng/daemon.log"
# These are quick ways to access my common machines
alias hurricane='ssh bwrcrdsl-2.eecs.berkeley.edu -t "screen -x hurricane-chip"'
# Other aliases
alias todo='$GIT_EDITOR ~/TODO'
# Some shell variables are different on different machines
export MAKEFLAGS="-j$(cat /proc/cpuinfo | grep ^processor | wc -l)"
# A nicer-looking prompt
if test -f /usr/bin/mhng-bud
then
export PS1="\[\e[0;0m\e[32m\]\u \[\e[31m\]\h \[\e[34m\]\W \[\e[1;31m\]\`mhng-bud\`\[\e[0;32m\]\\$\[\e[0m\] "
else
export PS1="\[\e[0m\e[32m\]\u \[\e[31m\]\h \[\e[34m\]\W \[\e[32m\]\\$\[\e[0m\] "
fi
# GPG won't use curses-askpass unless I set this variable
if [[ "$SSH_TTY" != "$GPG_TTY" ]]
then
export GPG_TTY="$SSH_TTY"
fi
# Attempt to setup a keychain
if test -x $HOME/.local/bin/keychain
then
mkdir -p $HOME/.local/var/keychain
if test -x /usr/bin/ssh-agent
then
find $HOME/.ssh -iname "id_*" | grep -v ".pub$" | xargs \
keychain \
--agents ssh \
--confhost \
--dir $HOME/.local/var/keychain \
--quiet
fi
if test -x /usr/bin/gpg-agent
then
keychain \
--agents gpg \
--confhost \
--dir $HOME/.local/var/keychain \
--quiet
fi
fi
if test -r $HOME/.local/var/keychain/$HOSTNAME-sh
then
source $HOME/.local/var/keychain/$HOSTNAME-sh
fi
if test -r $HOME/.local/var/keychain/$HOSTNAME-sh-gpg
then
source $HOME/.local/var/keychain/$HOSTNAME-sh-gpg
fi