-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate home folder #10
Comments
For separate home folders: containers/toolbox#348
|
To launch applications prepend something like
|
Unfinished Script for settings_folder=$HOME/.bashrc.d/toolbx_tuner_settings
per_app_settings_file=per_app
global_settings_file=global_settings
if [ -f "/run/.containerenv" ]; then
TOOLBOX_NAME=$(sed -nr 's/^name="(.*)"$/\1/p' /run/.containerenv)
not_found=true
# read individual settings
while IFS="," read tbx home_dir rest; do
if [ "$tbx" == $TOOLBOX_NAME ]; then # if tbx has individual settings stored
# Apply custom home dir if set
if [ "$home_dir" != "" ]; then
HOME="$home_dir"
mkdir -p "$HOME"
fi
not_found=false # set not_found to false to prevent use of global settings
break
fi
done < <(tail -n +2 $settings_folder/$per_app_settings_file) # read file from line 2 because of table headers
# apply global settings if no individual overrides
if $not_found; then # use global settings if not found
source $settings_folder/$global_settings_file # load global settings
if $USE_SEPERATE_HOME ; then
HOME="$DEFAULT_HOME/$TOOLBOX_NAME"
mkdir -p "$HOME"
fi
fi
# make sure we are not running recursively before entering new bash shell in toolbox
if [ -n "$RECURSIVE_PROTECTION" ]; then
RECURSIVE_PROTECTION=true # set recursive protection to prevent infinite loops
bash
exit 0
fi
fi
|
Possible way to store settings:
https://serverfault.com/questions/219306/control-a-bash-script-with-variables-from-an-external-file |
In rust use include_str!() to load the contents of the script files at compile time to then create the script files at runtime. |
The text was updated successfully, but these errors were encountered: