-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_profile.tmpl
More file actions
67 lines (65 loc) 路 2.55 KB
/
Copy pathdot_profile.tmpl
File metadata and controls
67 lines (65 loc) 路 2.55 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
63
64
65
66
# ~/.profile - sourced by login shells (bash, sh, etc.)
# This file sets environment variables for starship prompt
# Detect environment and set STARSHIP_ICON
{{- if eq .chezmoi.os "darwin" }}
export STARSHIP_ICON=""
export STARSHIP_ICON_COLOR="mauve"
export STARSHIP_CONFIG="${HOME}/.config/starship/starship-desktop.toml"
{{- else if eq .chezmoi.os "linux" }}
if [ -n "${TOOLBOX_PATH:-}" ] || case "$(hostname)" in *toolbx*) true;; *) false;; esac; then
# Fedora Toolbox
export STARSHIP_ICON=""
export STARSHIP_ICON_COLOR="blue"
export STARSHIP_CONFIG="${HOME}/.config/starship/starship-desktop.toml"
elif [ -f /proc/device-tree/model ] && grep -qi "raspberry pi" /proc/device-tree/model 2>/dev/null; then
# Raspberry Pi
export STARSHIP_ICON_COLOR="red"
case "$(hostname)" in
bbh-network*) export STARSHIP_ICON="馃寪" ;;
omv-*) export STARSHIP_ICON="馃悷" ;;
*) export STARSHIP_ICON="馃崜" ;;
esac
export STARSHIP_CONFIG="${HOME}/.config/starship/starship-ssh.toml"
elif [ -f /etc/os-release ] && { . /etc/os-release && [ "${ID:-}" = "ubuntu" ]; }; then
# Ubuntu (desktop vs server by hostname prefix)
_h="${HOSTNAME%%.*}"
case "${_h}" in
ubuntu-server*)
export STARSHIP_ICON=""
export STARSHIP_ICON_COLOR="yellow"
export STARSHIP_CONFIG="${HOME}/.config/starship/starship-ssh.toml"
;;
*)
export STARSHIP_ICON=""
export STARSHIP_ICON_COLOR="peach"
export STARSHIP_CONFIG="${HOME}/.config/starship/starship-desktop.toml"
;;
esac
unset _h
elif command -v rpm-ostree &>/dev/null 2>/dev/null; then
# Fedora Atomic
export STARSHIP_ICON=""
export STARSHIP_ICON_COLOR="blue"
export STARSHIP_CONFIG="${HOME}/.config/starship/starship-ssh.toml"
elif [ -f /etc/os-release ] && { . /etc/os-release && [ "${ID:-}" = "fedora" ]; }; then
_h="${HOSTNAME%%.*}"
case "${_h}" in
fedora-server*)
export STARSHIP_ICON=""
export STARSHIP_ICON_COLOR="blue"
export STARSHIP_CONFIG="${HOME}/.config/starship/starship-ssh.toml"
;;
*)
export STARSHIP_ICON=""
export STARSHIP_ICON_COLOR="blue"
export STARSHIP_CONFIG="${HOME}/.config/starship/starship-desktop.toml"
;;
esac
unset _h
else
# Other Linux (Debian, etc.)
export STARSHIP_ICON=""
export STARSHIP_ICON_COLOR="blue"
export STARSHIP_CONFIG="${HOME}/.config/starship/starship-desktop.toml"
fi
{{- end }}