-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from ublue-os/m2giles-fish-startup
feat: enable fish integration
- Loading branch information
Showing
9 changed files
with
102 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
toolboxes/bluefin-cli/files/etc/profile.d/command-not-found-host-exec.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
toolboxes/bluefin-cli/files/etc/profile.d/zz-profile_sourced.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# shellcheck shell=sh | ||
if [ -z "$PROFILESOURCED" ] && [ "$PS1" ]; then | ||
PROFILESOURCED="Y" | ||
fi |
45 changes: 45 additions & 0 deletions
45
toolboxes/bluefin-cli/files/usr/share/fish/vendor_conf.d/00-bluefin-cli-brew-firstrun.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
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" | ||
test -z "$xdg_data_home"; and set xdg_data_home "$HOME/.local/share/" | ||
set linuxbrew_home "$xdg_data_home/bluefin-cli/$name" | ||
printf "Setting up Linuxbrew...\t\t\t\t " | ||
if test ! -d "$linuxbrew_home" | ||
mkdir -p "$linuxbrew_home" | ||
end | ||
if test ! -d /home/linuxbrew | ||
su-exec root 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 | ||
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" | ||
end | ||
|
||
if test ! -f /etc/linuxbrew.firstrun | ||
su-exec root touch /etc/linuxbrew.firstrun | ||
printf "\nBluefin-CLI first run complete!\n\n" | ||
end | ||
end |
26 changes: 26 additions & 0 deletions
26
toolboxes/bluefin-cli/files/usr/share/fish/vendor_conf.d/bling.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
if status is-interactive | ||
set -gx STARSHIP_CONFIG /etc/starship.toml | ||
eval "$(starship init fish)" | ||
eval "$(atuin init fish)" | ||
eval "$(zoxide init fish --cmd cd)" | ||
end | ||
|
||
# Eza for ls | ||
alias ll='eza -l --icons=auto --group-directories-first' 2>/dev/null | ||
alias l.='eza -d .*' 2>/dev/null | ||
alias ls='eza' 2>/dev/null | ||
alias l1='eza -1' | ||
|
||
# Ripgrep for grep | ||
alias grep='rg' 2>/dev/null | ||
alias egrep='rg' 2>/dev/null | ||
alias fgrep='rg -F' 2>/dev/null | ||
alias xzgrep='rg -z' 2>/dev/null | ||
alias xzegrep='rg -z' 2>/dev/null | ||
alias xzfgrep='rg -z -F' 2>/dev/null | ||
|
||
# Zoxide is handling cd | ||
alias cd='cd' 2>/dev/null | ||
|
||
# Fd for find | ||
alias find='fd' 2>/dev/null |
6 changes: 6 additions & 0 deletions
6
toolboxes/bluefin-cli/files/usr/share/fish/vendor_conf.d/brew.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if test "$(id -u)" -gt "0" | ||
set -gx PATH $PATH /home/linuxbrew/.linuxbrew/bin | ||
set -gx HOMEBREW_PREFIX /home/linuxbrew/.linuxbrew | ||
set -gx HOMEBREW_CELLAR /home/linuxbrew/.linuxbrew/Cellar | ||
set -gx HOMEBREW_REPOSITORY /home/linuxbrew/.linuxbrew | ||
end |
8 changes: 8 additions & 0 deletions
8
toolboxes/bluefin-cli/files/usr/share/fish/vendor_functions.d/fish_command_not_found.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function fish_command_not_found | ||
# "In a container" check | ||
if test -e /run/.containerenv -o -e /.dockerenv | ||
distrobox-host-exec $argv | ||
else | ||
__fish_default_command_not_found_handler $argv | ||
end | ||
end |