How to prevent toolbox cluttering host home folder

Hi,

inside .bashrc you can check if the file is executed inside a toolbox environment. Maybe that helps you at least a bit.

if ! [ -f /run/.containerenv ] \
       || ! [ -f /run/.toolboxenv ]; then
    # not executed inside toolbox
    alias emacs="flatpak run org.gnu.emacs"
    alias vim="flatpak run org.vim.Vim"
    alias mutt="toolbox run -c mailbox-2 mutt"
fi

If you dont want to share your home dir with the toolbox you should think about building a container from scratch using podman.

2 Likes