2019-04-24 17:36:36 +00:00
|
|
|
[ "$BASH_VERSION" != "" ] || [ "$ZSH_VERSION" != "" ] || return 0
|
|
|
|
[ "$PS1" != "" ] || return 0
|
|
|
|
|
|
|
|
toolbox_config="$HOME/.config/toolbox"
|
|
|
|
host_welcome_stub="$toolbox_config/host-welcome-shown"
|
2019-04-25 14:20:34 +00:00
|
|
|
toolbox_welcome_stub="$toolbox_config/toolbox-welcome-shown"
|
2019-04-24 17:36:36 +00:00
|
|
|
|
|
|
|
if [ -f /run/ostree-booted ] \
|
|
|
|
&& ! [ -f "$host_welcome_stub" ]; then
|
|
|
|
echo ""
|
|
|
|
echo "Welcome to Fedora Silverblue. This terminal is running on the"
|
|
|
|
echo "immutable host system. You may want to try out the Toolbox for a"
|
|
|
|
echo "more traditional environment that allows package installation"
|
|
|
|
echo "with DNF."
|
|
|
|
echo ""
|
|
|
|
printf "For more information, see the "
|
|
|
|
# shellcheck disable=SC1003
|
|
|
|
printf '\033]8;;https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/\033\\documentation\033]8;;\033\\'
|
|
|
|
printf ".\n"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
mkdir -p "$toolbox_config"
|
|
|
|
touch "$host_welcome_stub"
|
|
|
|
fi
|
|
|
|
|
2019-04-25 14:20:34 +00:00
|
|
|
if [ -f /run/.containerenv ] \
|
2019-05-03 17:33:37 +00:00
|
|
|
&& [ -f /run/.toolboxenv ]; then
|
2019-06-14 21:39:35 +00:00
|
|
|
PS1=$(printf "\[\033[35m\]⬢\[\033[0m\]%s" "[\u@\h \W]\\$ ")
|
2019-04-25 14:20:34 +00:00
|
|
|
|
2019-05-03 12:46:36 +00:00
|
|
|
if ! [ -f "$toolbox_welcome_stub" ]; then
|
|
|
|
echo ""
|
|
|
|
echo "Welcome to the Toolbox; a container where you can install and run"
|
|
|
|
echo "all your tools."
|
|
|
|
echo ""
|
|
|
|
echo " - Use DNF in the usual manner to install command line tools."
|
|
|
|
echo " - To create a new tools container, run 'toolbox create'."
|
|
|
|
echo ""
|
|
|
|
printf "For more information, see the "
|
|
|
|
# shellcheck disable=SC1003
|
|
|
|
printf '\033]8;;https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/\033\\documentation\033]8;;\033\\'
|
|
|
|
printf ".\n"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
mkdir -p "$toolbox_config"
|
|
|
|
touch "$toolbox_welcome_stub"
|
|
|
|
fi
|
2019-04-25 14:20:34 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-24 17:36:36 +00:00
|
|
|
unset toolbox_config
|
|
|
|
unset host_welcome_stub
|
2019-04-25 14:20:34 +00:00
|
|
|
unset toolbox_welcome_stub
|