Skip to content

Commit

Permalink
chore: support zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles committed May 18, 2024
1 parent e512268 commit 3470f38
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
5 changes: 2 additions & 3 deletions toolboxes/bluefin-cli/Containerfile.bluefin-cli
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ RUN apk update && \
rm /toolbox-packages

# Configure Locales and get bash-prexec
RUN curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o /tmp/bash-prexec && \
RUN curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o /tmp/bash-prexec \
&& mkdir -p /usr/share/ \
&& cp /tmp/bash-prexec /usr/share/bash-prexec \
&& printf 'LANG=en_US.utf8\nexport LANG\n' > /etc/profile.d/locale.sh \
&& printf 'LANG=en_US.utf8\nexport LANG\n' >> /etc/zsh/zlogin \
&& printf 'if status is-login\n\tset -gx LANG en_US.utf8\nend\n' >> /etc/fish/config.fish \
&& printf 'LANG=en_US.utf8\nexport LANG\nSTARSHIP_CONFIG=/etc/starship.toml\nexport STARSHIP_CONFIG\neval "$(atuin init zsh)"\neval "$(zoxide init zsh --cmd cd)"\neval "$(starship init zsh)"' >> /etc/zsh/zshrc \
&& printf 'LANG="en_US.UTF-8"' > /etc/locale.conf \
&& rm -rf /tmp/*
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ if test "$(id -u)" -gt "0"
set blue (set_color blue)
set bold (set_color -o blue)
set normal (set_color normal)
if test ! -f /etc/linuxbrew.firstrun
printf "\nBluefin-CLI First Run Setup\n\n"
printf "Setting up sudo for %s%s%s...\t\t\t " "$bold" "$USER" "$normal"
echo "#$UID ALL = (root) NOPASSWD:ALL" | su-exec root tee -a /etc/sudoers > /dev/null
printf "%s[ OK ]%s\n" "$blue" "$normal"
end

if test ! -d /home/linuxbrew/.linuxbrew
set name $(hostname -s)
set xdg_data_home "$XDG_DATA_HOME"
Expand All @@ -19,27 +12,21 @@ if test "$(id -u)" -gt "0"
mkdir -p "$linuxbrew_home"
end
if test ! -d /home/linuxbrew
su-exec root mkdir -p /home/linuxbrew
sudo mkdir -p /home/linuxbrew
end
su-exec root mount --bind "$linuxbrew_home" /home/linuxbrew
su-exec root cp -R /home/homebrew/.linuxbrew /home/linuxbrew/
su-exec root chown -R "$UID" /home/linuxbrew
sudo mount --bind "$linuxbrew_home" /home/linuxbrew
sudo cp -R /home/homebrew/.linuxbrew /home/linuxbrew/
sudo chown -R "$UID" /home/linuxbrew
set -e linuxbrew_home
printf "%s[ OK ]%s\n" "$blue" "$normal"
end

if test ! -d /usr/local/share/bash-completion/completions
printf "Setting up Tab-Completions...\t\t\t "
su-exec root mkdir -p /usr/local/share/bash-completion
su-exec root mount --bind /run/host/usr/share/bash-completion /usr/local/share/bash-completion
if test -x /run/host/usr/bin/ujust
su-exec root ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/ujust
end
printf "%s[ OK ]%s\n" "$blue" "$normal"
if test -x /run/host/usr/bin/ujust
sudo ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/ujust
end

if test ! -f /etc/linuxbrew.firstrun
su-exec root touch /etc/linuxbrew.firstrun
sudo touch /etc/linuxbrew.firstrun
printf "\nBluefin-CLI first run complete!\n\n"
end
end
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
if status is-interactive
set -gx STARSHIP_CONFIG /etc/starship.toml
set -gx LANG en_US.utf8
eval "$(starship init fish)"
eval "$(atuin init fish)"
eval "$(zoxide init fish --cmd cd)"
set -gx HOST (hostname -s)
end


# Eza for ls
alias ll='eza -l --icons=auto --group-directories-first' 2>/dev/null
alias l.='eza -d .*' 2>/dev/null
Expand Down

0 comments on commit 3470f38

Please sign in to comment.