File tree 3 files changed +45
-0
lines changed
pkg/cidata/cidata.TEMPLATE.d 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ Max file name length = 30
102
102
The volume label is "cidata", as defined by [ cloud-init NoCloud] ( https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html ) .
103
103
104
104
### Environment variables
105
+ - ` LIMA_CIDATA_NAME ` : the lima instance name
105
106
- ` LIMA_CIDATA_MNT ` : the mount point of the disk. ` /mnt/lima-cidata ` .
106
107
- ` LIMA_CIDATA_USER ` : the user name string
107
108
- ` LIMA_CIDATA_UID ` : the numeric UID
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -eux
3
+
4
+ if [ " ${LIMA_CIDATA_NAME} " = " default" ]; then
5
+
6
+ ! grep -q " ^# Lima PS1" " /home/${LIMA_CIDATA_USER} .linux/.bashrc" || exit 0
7
+
8
+ # Change the default shell prompt from "green" to "lime" (#BFFF00)
9
+
10
+ patch --forward -r - " /home/${LIMA_CIDATA_USER} .linux/.bashrc" << 'EOF '
11
+ @@ -37,7 +37,11 @@
12
+
13
+ # set a fancy prompt (non-color, unless we know we "want" color)
14
+ case "$TERM" in
15
+ - xterm-color|*-256color) color_prompt=yes;;
16
+ + xterm-color) color_prompt=yes;;
17
+ + *-256color) color_prompt=256;;
18
+ +esac
19
+ +case "$COLORTERM" in
20
+ + truecolor) color_prompt=true;;
21
+ esac
22
+
23
+ # uncomment for a colored prompt, if the terminal has the capability; turned
24
+ @@ -56,8 +60,13 @@
25
+ fi
26
+ fi
27
+
28
+ -if [ "$color_prompt" = yes ]; then
29
+ - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
30
+ +# Lima PS1: set color to lime
31
+ +if [ "$color_prompt" = true ]; then
32
+ + PS1='${debian_chroot:+($debian_chroot)}\[\033[38;2;192;255;0m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
33
+ +elif [ "$color_prompt" = 256 ]; then
34
+ + PS1='${debian_chroot:+($debian_chroot)}\[\033[38;5;154m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
35
+ +elif [ "$color_prompt" = yes ]; then
36
+ + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;92m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
37
+ else
38
+ PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
39
+ fi
40
+ fi
41
+ EOF
42
+
43
+ fi
Original file line number Diff line number Diff line change
1
+ LIMA_CIDATA_NAME = {{ .Name }}
1
2
LIMA_CIDATA_USER = {{ .User }}
2
3
LIMA_CIDATA_UID = {{ .UID }}
3
4
LIMA_CIDATA_MOUNTS = {{ len .Mounts }}
You can’t perform that action at this time.
0 commit comments