-
Notifications
You must be signed in to change notification settings - Fork 7
/
bashrc
executable file
·53 lines (42 loc) · 1.78 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
export EDITOR='vim'
# Include stuff
if [ -f ~/dotfiles/private/bashrc ]; then
source ~/dotfiles/private/bashrc
fi
[[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh"
source ~/dotfiles/bash/asdf.bash
source ~/dotfiles/bash/git-completion.bash
source ~/dotfiles/bash/git-prompt.sh
source ~/dotfiles/bash/history_sharing.bash
source ~/dotfiles/bash/js-fu.bash
source ~/dotfiles/bash/kubernetes-fu.bash
source ~/dotfiles/bash/macos_notifications.bash
source ~/dotfiles/bash/misc-fu.bash
source ~/dotfiles/bash/aliases.bash
# Homebrew
# NB: as of 2023, homebrew uses different prefixes on different platforms.
# This may change again in future.
# - /usr/local for Intel/Rosetta stuff
# - /opt/homebrew on Apple CPUs; this may change in future
# HOMEBREW_PREFIX=$(brew --prefix)
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/local/sbin:$PATH"
# Notification for long-running processes
function _sys_notify_status() {
local notification_command="display notification \"That thing you asked for is done.\" with title \"$1\""
osascript -e "$notification_command"
# NOTE: if you want a 'close' button, change 'Script Editor' to
# use alerts in System Preferences -> Notifications.
}
function holler() {
if [ "$?" -eq 0 ] ;
then _sys_notify_status "Succeeded" ; say 'Process Succeeded' ;
else _sys_notify_status "Failed" ; say 'Process Failed' ;
fi
}
# Prompt (see http://ezprompt.net for hints)
alias long_prompt="export PS1=\"\n\[\e[30;102m\][ \@ | \\w\\\$(__git_ps1 ' | (git: %s)') ]\[\e[m\]\n$ \""
alias short_prompt="export PS1=\"\n\[\e[30;102m\][ \\w\\\$(__git_ps1 ' | %s') ]\[\e[m\]\n$ \""
alias tiny_prompt="export PS1=\"$ \""
long_prompt
# make sure my path stuff is first, period KTHXBYE
source ~/dotfiles/bash/path.bash