blob: 4f0c8760e280b90b65492d761318c29e9fd8c5e1 (
plain) (
blame)
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
|
# /etc/skel/.bashrc
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output. So make sure this doesn't display
# anything or bad things will happen !
safe_load() {
sh="$1"
[ -r "$sh" ] && . "$sh"
unset sh
}
# Test for an interactive shell. There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
# Spawn sway, if we are on tty1
#if [[ "$(tty)" = "/dev/tty1" ]] ; then
# safe_load $HOME/.config/sway/env
# exec dbus-launch --exit-with-session sway -Ddamage=rerender
#fi
# Enable fzf integration
# safe_load /etc/profile.d/fzf.sh
# safe_load "$HOME"/devel/upstream/github.com/lincheney/fzf-tab-completion/bash/fzf-bash-completion.sh
# bind -x '"\t": fzf_bash_completion'
# Append to history file
shopt -s histappend
HISTSIZE=50000
HISTFILESIZE=500000
# enable direnv
eval "$(direnv hook bash)"
# enable z.lua
if [ -d /usr/libexec/z_lua ]; then
eval "$(luajit /usr/libexec/z_lua/z.lua --init bash enhanced once fzf)"
safe_load /usr/libexec/z_lua/czmod/czmod.bash
fi
# Use keychain to reuse the ssh-agent between logins
keychain --agents ssh -q "$HOME"/.ssh/id_rsa
safe_load "$HOME/.keychain/$(hostname)-sh"
# use keychain to reuse gpg-agents between logins
# keychain --agents ssh,gpg -q "$HOME"/.ssh/id_rsa B07A551E7F0D35A6A2CD9E5944DFC1CFDC3EA327
# safe_load "$HOME/.keychain/$(hostname)-sh-gpg"
# Make sure to also load ~/.profile for non-login shells
safe_load ~/.profile
# Set prompt
# export PS1="$(prompt)"
if ! [[ "${PROMPT_COMMAND:-}" =~ _prompt_hook ]]; then
PROMPT_COMMAND="_prompt_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
fi
_prompt_hook() {
if [ "$?" != 0 ]; then
PS1=$(prompt err)
else
PS1=$(prompt)
fi
}
|