-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbashrc
More file actions
63 lines (50 loc) · 1.17 KB
/
Copy pathbashrc
File metadata and controls
63 lines (50 loc) · 1.17 KB
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
# Our prompt.
export PS1="\[\e[32m\]\@ \[\e[m\][\[\e[31m\]\u\[\e[m\]]\[\e[33m\] \w\[\e[m\] \n$ "
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
reload() {
source ~/.bashrc
}
let() {
eval "export $1=\"${@:2}\""
}
fn() {
eval "$1() { ${@:2} ;}"
}
save-fn() {
declare -f $1 >> ~/.bashrc
}
def() {
eval "alias $1=\"${@:2}\""
}
save-def() {
alias $1 >> ~/.bashrc
}
function ,r {
GREEN='\033[1;32m'
NC='\033[0m'
echo -e "${GREEN}$RERUN $*$NC"
eval $RERUN $*
}
function ,rerun-set {
RERUN="$*"
}
acid() {
/google/bin/releases/mobile-devx-platform/acid/acid "$@"
}
,notify() {
local msg="$@"
if [ -n "$TMUX" ]; then
# Find the active terminal TTY Ghostty is using and inject the sequence
local target_tty
target_tty=$(tmux display-message -p '#{client_tty}')
if [ -n "$target_tty" ] && [ -w "$target_tty" ]; then
printf "\e]9;%s\e\\" "$msg" > "$target_tty"
fi
else
printf "\e]9;${msg}\e\\"
fi
}
export PATH="~/Dotfiles/bin:$PATH"
def g git
def fb "fx build | tee ~/fuchsia/local/build"