detached fcaa5d4

feat(shell): add starship config and improve directory structure

commit
fcaa5d472426123620c7399dadd633f3918f217b
author
bnema · · 2025-10-21 17:01 UTC
parent
0bae381
signature
unsigned
1 file · +41 -11
M install/post-install/shell-config.sh +41 -11
@@ -10,15 +10,16 @@ if [[ -z "${USERNAME}" ]]; then
1010 fi
1111
1212 USER_HOME="/mnt/home/$USERNAME"
13-ARCHUP_DEFAULT="$USER_HOME/.local/share/archup/default/bash"
13+ARCHUP_DEFAULT="$USER_HOME/.local/share/archup/default"
14+ARCHUP_DEFAULT_BASH="$ARCHUP_DEFAULT/bash"
1415
1516 echo "Configuring bash shell for $USERNAME..." >> "$ARCHUP_INSTALL_LOG_FILE"
1617
1718 # Create archup default directory structure
18-mkdir -p "$ARCHUP_DEFAULT"
19+mkdir -p "$ARCHUP_DEFAULT_BASH"
1920
2021 # Create shell configuration (history, bash-completion, PATH)
21-cat > "$ARCHUP_DEFAULT/shell" << 'SHELL_END'
22+cat > "$ARCHUP_DEFAULT_BASH/shell" << 'SHELL_END'
2223 # History control
2324 shopt -s histappend
2425 HISTCONTROL=ignoreboth
@@ -35,10 +36,39 @@ export PATH="$HOME/.local/bin:$PATH"
3536 set +h
3637 SHELL_END
3738
39+# Create starship configuration with Arch blue colors
40+cat > "$ARCHUP_DEFAULT/starship.toml" << 'STARSHIP_END'
41+# Arch-inspired blue color scheme
42+add_newline = true
43+
44+[username]
45+show_always = true
46+style_user = "fg:#87ceeb"
47+style_root = "fg:#ff6b8a"
48+format = "[$user]($style) "
49+
50+[hostname]
51+disabled = true
52+
53+[directory]
54+style = "fg:#e8f4f8"
55+format = "in [$path]($style) "
56+
57+[git_branch]
58+symbol = " "
59+style = "fg:#6bb6d6"
60+format = "on [$symbol$branch]($style) "
61+
62+[character]
63+success_symbol = '[❯](fg:#6bb6d6)'
64+error_symbol = '[✗](fg:#ff6b8a)'
65+STARSHIP_END
66+
3867 # Create init configuration (starship, zoxide, fzf)
39-cat > "$ARCHUP_DEFAULT/init" << 'INIT_END'
68+cat > "$ARCHUP_DEFAULT_BASH/init" << 'INIT_END'
4069 # Starship prompt
4170 if command -v starship &> /dev/null; then
71+ export STARSHIP_CONFIG="$HOME/.local/share/archup/default/starship.toml"
4272 eval "$(starship init bash)"
4373 fi
4474
@@ -54,7 +84,7 @@ fi
5484 INIT_END
5585
5686 # Create aliases configuration
57-cat > "$ARCHUP_DEFAULT/aliases" << 'ALIASES_END'
87+cat > "$ARCHUP_DEFAULT_BASH/aliases" << 'ALIASES_END'
5888 # Eza aliases (modern ls replacement)
5989 if command -v eza &> /dev/null; then
6090 alias ls='eza -lh --group-directories-first --icons=auto'
@@ -91,7 +121,7 @@ alias gl='git log --oneline --graph --decorate'
91121 ALIASES_END
92122
93123 # Create envs configuration (environment variables)
94-cat > "$ARCHUP_DEFAULT/envs" << 'ENVS_END'
124+cat > "$ARCHUP_DEFAULT_BASH/envs" << 'ENVS_END'
95125 # Bat configuration
96126 if command -v bat &> /dev/null; then
97127 export BAT_THEME="TwoDark"
@@ -104,7 +134,7 @@ fi
104134 ENVS_END
105135
106136 # Create functions configuration
107-cat > "$ARCHUP_DEFAULT/functions" << 'FUNCTIONS_END'
137+cat > "$ARCHUP_DEFAULT_BASH/functions" << 'FUNCTIONS_END'
108138 # Zoxide cd wrapper
109139 if command -v zoxide &> /dev/null; then
110140 zd() {
@@ -121,7 +151,7 @@ fi
121151 FUNCTIONS_END
122152
123153 # Create rc file that sources everything
124-cat > "$ARCHUP_DEFAULT/rc" << 'RC_END'
154+cat > "$ARCHUP_DEFAULT_BASH/rc" << 'RC_END'
125155 source ~/.local/share/archup/default/bash/shell
126156 source ~/.local/share/archup/default/bash/init
127157 source ~/.local/share/archup/default/bash/aliases
@@ -150,9 +180,9 @@ arch-chroot /mnt su - "$USERNAME" -c "git config --global delta.side-by-side tru
150180 arch-chroot /mnt su - "$USERNAME" -c "git config --global merge.conflictstyle diff3" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
151181 arch-chroot /mnt su - "$USERNAME" -c "git config --global diff.colorMoved default" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
152182
153-# Set ownership
154-arch-chroot /mnt chown -R "$USERNAME:$USERNAME" "$USER_HOME/.local" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
155-arch-chroot /mnt chown "$USERNAME:$USERNAME" "$USER_HOME/.bashrc" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
183+# Set ownership (paths relative to chroot, not host)
184+arch-chroot /mnt chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.local" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
185+arch-chroot /mnt chown "$USERNAME:$USERNAME" "/home/$USERNAME/.bashrc" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
156186
157187 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Shell configured"
158188 echo "Configured shell for user: $USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -10,15 +10,16 @@ if [[ -z "${USERNAME}" ]]; then
10 fi10 fi
11 11
12 USER_HOME="/mnt/home/$USERNAME"12 USER_HOME="/mnt/home/$USERNAME"
13-ARCHUP_DEFAULT="$USER_HOME/.local/share/archup/default/bash"13+ARCHUP_DEFAULT="$USER_HOME/.local/share/archup/default"
14+ARCHUP_DEFAULT_BASH="$ARCHUP_DEFAULT/bash"
14 15
15 echo "Configuring bash shell for $USERNAME..." >> "$ARCHUP_INSTALL_LOG_FILE"16 echo "Configuring bash shell for $USERNAME..." >> "$ARCHUP_INSTALL_LOG_FILE"
16 17
17 # Create archup default directory structure18 # Create archup default directory structure
18-mkdir -p "$ARCHUP_DEFAULT"19+mkdir -p "$ARCHUP_DEFAULT_BASH"
19 20
20 # Create shell configuration (history, bash-completion, PATH)21 # Create shell configuration (history, bash-completion, PATH)
21-cat > "$ARCHUP_DEFAULT/shell" << 'SHELL_END'22+cat > "$ARCHUP_DEFAULT_BASH/shell" << 'SHELL_END'
22 # History control23 # History control
23 shopt -s histappend24 shopt -s histappend
24 HISTCONTROL=ignoreboth25 HISTCONTROL=ignoreboth
@@ -35,10 +36,39 @@ export PATH="$HOME/.local/bin:$PATH"
35 set +h36 set +h
36 SHELL_END37 SHELL_END
37 38
39+# Create starship configuration with Arch blue colors
40+cat > "$ARCHUP_DEFAULT/starship.toml" << 'STARSHIP_END'
41+# Arch-inspired blue color scheme
42+add_newline = true
43+
44+[username]
45+show_always = true
46+style_user = "fg:#87ceeb"
47+style_root = "fg:#ff6b8a"
48+format = "[$user]($style) "
49+
50+[hostname]
51+disabled = true
52+
53+[directory]
54+style = "fg:#e8f4f8"
55+format = "in [$path]($style) "
56+
57+[git_branch]
58+symbol = " "
59+style = "fg:#6bb6d6"
60+format = "on [$symbol$branch]($style) "
61+
62+[character]
63+success_symbol = '[❯](fg:#6bb6d6)'
64+error_symbol = '[✗](fg:#ff6b8a)'
65+STARSHIP_END
66+
38 # Create init configuration (starship, zoxide, fzf)67 # Create init configuration (starship, zoxide, fzf)
39-cat > "$ARCHUP_DEFAULT/init" << 'INIT_END'68+cat > "$ARCHUP_DEFAULT_BASH/init" << 'INIT_END'
40 # Starship prompt69 # Starship prompt
41 if command -v starship &> /dev/null; then70 if command -v starship &> /dev/null; then
71+ export STARSHIP_CONFIG="$HOME/.local/share/archup/default/starship.toml"
42 eval "$(starship init bash)"72 eval "$(starship init bash)"
43 fi73 fi
44 74
@@ -54,7 +84,7 @@ fi
54 INIT_END84 INIT_END
55 85
56 # Create aliases configuration86 # Create aliases configuration
57-cat > "$ARCHUP_DEFAULT/aliases" << 'ALIASES_END'87+cat > "$ARCHUP_DEFAULT_BASH/aliases" << 'ALIASES_END'
58 # Eza aliases (modern ls replacement)88 # Eza aliases (modern ls replacement)
59 if command -v eza &> /dev/null; then89 if command -v eza &> /dev/null; then
60 alias ls='eza -lh --group-directories-first --icons=auto'90 alias ls='eza -lh --group-directories-first --icons=auto'
@@ -91,7 +121,7 @@ alias gl='git log --oneline --graph --decorate'
91 ALIASES_END121 ALIASES_END
92 122
93 # Create envs configuration (environment variables)123 # Create envs configuration (environment variables)
94-cat > "$ARCHUP_DEFAULT/envs" << 'ENVS_END'124+cat > "$ARCHUP_DEFAULT_BASH/envs" << 'ENVS_END'
95 # Bat configuration125 # Bat configuration
96 if command -v bat &> /dev/null; then126 if command -v bat &> /dev/null; then
97 export BAT_THEME="TwoDark"127 export BAT_THEME="TwoDark"
@@ -104,7 +134,7 @@ fi
104 ENVS_END134 ENVS_END
105 135
106 # Create functions configuration136 # Create functions configuration
107-cat > "$ARCHUP_DEFAULT/functions" << 'FUNCTIONS_END'137+cat > "$ARCHUP_DEFAULT_BASH/functions" << 'FUNCTIONS_END'
108 # Zoxide cd wrapper138 # Zoxide cd wrapper
109 if command -v zoxide &> /dev/null; then139 if command -v zoxide &> /dev/null; then
110 zd() {140 zd() {
@@ -121,7 +151,7 @@ fi
121 FUNCTIONS_END151 FUNCTIONS_END
122 152
123 # Create rc file that sources everything153 # Create rc file that sources everything
124-cat > "$ARCHUP_DEFAULT/rc" << 'RC_END'154+cat > "$ARCHUP_DEFAULT_BASH/rc" << 'RC_END'
125 source ~/.local/share/archup/default/bash/shell155 source ~/.local/share/archup/default/bash/shell
126 source ~/.local/share/archup/default/bash/init156 source ~/.local/share/archup/default/bash/init
127 source ~/.local/share/archup/default/bash/aliases157 source ~/.local/share/archup/default/bash/aliases
@@ -150,9 +180,9 @@ arch-chroot /mnt su - "$USERNAME" -c "git config --global delta.side-by-side tru
150 arch-chroot /mnt su - "$USERNAME" -c "git config --global merge.conflictstyle diff3" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1180 arch-chroot /mnt su - "$USERNAME" -c "git config --global merge.conflictstyle diff3" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
151 arch-chroot /mnt su - "$USERNAME" -c "git config --global diff.colorMoved default" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1181 arch-chroot /mnt su - "$USERNAME" -c "git config --global diff.colorMoved default" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
152 182
153-# Set ownership183+# Set ownership (paths relative to chroot, not host)
154-arch-chroot /mnt chown -R "$USERNAME:$USERNAME" "$USER_HOME/.local" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1184+arch-chroot /mnt chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.local" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
155-arch-chroot /mnt chown "$USERNAME:$USERNAME" "$USER_HOME/.bashrc" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1185+arch-chroot /mnt chown "$USERNAME:$USERNAME" "/home/$USERNAME/.bashrc" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
156 186
157 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Shell configured"187 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Shell configured"
158 echo "Configured shell for user: $USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"188 echo "Configured shell for user: $USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close