Thread: Bling config

Thread: Bling config
11 Replies
bketelsen
bketelsenOP8mo ago
My thoughts on adding configuration for bluefin-cli stuff the fleek/brew configuration is generated by a go web app that lives at brew.getfleek.dev - this is not necessary at all for ublue, but it provides a reference point for this discussion
bketelsen
bketelsenOP8mo ago
GitHub
GitHub - bketelsen/fleekgenbrew
Contribute to bketelsen/fleekgenbrew development by creating an account on GitHub.
bketelsen
bketelsenOP8mo ago
the important bits are in a few places 1. definitions of configurations are here in programs.yml
bketelsen
bketelsenOP8mo ago
bketelsen
bketelsenOP8mo ago
then the init scripts are dynamically generated for each of the configured programs:
bketelsen
bketelsenOP8mo ago
when you run the installer, it grabs a tar file that includes a Brewfile, init scripts, and folders for bash and zsh that contain the setup/config for individual programs. They're all concatenated into one file by the template, but we'd want to do that differently.
# atuin
eval "$(atuin init bash)"
# starship
eval "$(starship init bash)"
# zoxide
eval "$(zoxide init bash)"
# direnv
eval "$(direnv hook bash)"
# atuin
eval "$(atuin init bash)"
# starship
eval "$(starship init bash)"
# zoxide
eval "$(zoxide init bash)"
# direnv
eval "$(direnv hook bash)"
this is what the generated .bashrc includes. that file lives at ~/.fleek/bash/.bashrc and is sourced by ~/.fleek/init.sh, conditionally based on the shell name I propose we simplify this , and put these configs in /usr/share/ublue-os/whatever/whatever in bash/ zsh/ fish/ subdirectories, and put smart config files in there. bash/atuin.sh would look roughly like:
if [ -x "$(command -v atuin)" ] then
eval "$(atuin init bash)"
fi
if [ -x "$(command -v atuin)" ] then
eval "$(atuin init bash)"
fi
then ujust bluefin-cli would add a stanza in your .bashrc to include/source all the files in /usr/share/ublue-os/whatever/bash/
ethanjli
ethanjli8mo ago
I've been using this pattern in my dotfiles for bash and zsh (for bash, I added a single line to my ~/.bashrc, https://github.com/ethanjli/dotfiles/blob/master/dot_bashrc#L27, which sources a script at https://github.com/ethanjli/dotfiles/blob/master/dot_config/bash/dot_bashrc#L21, which sources all scripts it finds in https://github.com/ethanjli/dotfiles/tree/master/dot_config/bash/integrations), and it's been really nice to organize these .bashrc/.zshrc snippets as drop-in files in the way you describe. I think modularizing the snippets in separate files may also help with delivering these .bashrc/.zshrc/etc. customizations via separate sysexts/confexts, if we ever want to decompose bluefin-cli into a few sysexts (e.g. for different bling levels) or to help users extend the initialization with additional sysexts for more bling - in my experiment to deploy the current bluefin-cli container as a sysext, I've noticed that the bluefin-cli container's /usr/local/bluefin-cli/etc/bashrc file combines init for starship, fzf, atuin, and zoxide all into the body of one if statement of one file.
bketelsen
bketelsenOP8mo ago
beautiful example just going to star that repo for later i did a starter video on chezmoi many years ago on Youtube, it's changed a lot since then.
ethanjli
ethanjli8mo ago
One thing I love about chezmoi is that I can (ab)use .chezmoiexternal.toml to download a specified version of bash-preexec for me, as the dotfiles-management substitute for doing https://github.com/ublue-os/toolboxes/blob/0a8f0facb72644e71db5e1ac844189ada1cee269/toolboxes/bluefin-cli/Containerfile.bluefin-cli#L22 in a Containerfile
M2
M28mo ago
Im leaning to make sure we have an interactive guard for everything. I added ugrep which is a drop in replacement for gnu grep. However things like fd and zoxide are not 100% compatible. I believe eza is close enough
Want results from more Discord servers?
Add your server