-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_bashrc.tmpl
33 lines (29 loc) · 916 Bytes
/
dot_bashrc.tmpl
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
#!/usr/bin/bash
# Generated by chezmoi https://github.com/mwyvr/dotfiles
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
test -s ~/.alias && . ~/.alias || true
set -o vi
export EDITOR=hx
{{- if eq .chezmoi.osRelease.id "void" "chimera" "arch" }}
{{/*
# set coloured prompts and window titles for void/freebsd/chimera; openSUSE does
# this in /etc/...
*/}}
if [ "$(id -u)" -ne 0 ]; then
PS1='[\[\e[32m\]\u@\h \W\[\e[0m\]]\$ '
else
PS1='[\[\e[31m\]\u@\h \w\[\e[0m\]]# ' #root
fi
export PS1
# set window titles
case ${TERM} in
st* | alacritty | foot | xterm* | rxvt* | kitty | kterm | gnome*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s\007" "${PWD/#$HOME/\~}"'
export COLORTERM=truecolor
;;
tmux* | screen*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s\007" "tmux: ${PWD/#$HOME/\~}"'
;;
esac
{{- end }}