Comments (5)
For separate home folders: containers/toolbox#348
# Check if we're running inside a toolbox
TOOLBOX_NAME=""
if [ -f "/run/.containerenv" ]; then
TOOLBOX_NAME=$(sed -nr 's/^name="(.*)"$/\1/p' /run/.containerenv)
HOME="$HOME/.toolbox/homedir/$TOOLBOX_NAME/$USER"
mkdir -p "$HOME"
bash
exit 0
fi
from toolbox-tuner.
To launch applications prepend something like
export "HOME=/var/home/USER/.toolbox/homedir/rust/";
from toolbox-tuner.
- Create if not exists
~/.bashrc.d
- Create file (
toolbx_tuner_set_home.sh
) in~/.bashrc.d
that reflects application settings with home folders. - create folder
~/.bashrc.d/toolbx_tuner_settings
with the filesper_app
andglobal_settings
i.per_app
looks as follows:ii.Name,Path rust,Hello/ABC other,
global_settings
looks as followsand can be loaded withDEFAULT_HOME=$HOME/.toolbx/homedir USE_SEPERATE_HOME=false
source ~/.bashrc.d/toolbx_tuner_settings/global_settings
Unfinished Script for toolbx_tuner_set_home.sh
:
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
from toolbox-tuner.
Possible way to store settings:
source <file>
can be used to load global setting variables.
https://serverfault.com/questions/219306/control-a-bash-script-with-variables-from-an-external-file
from toolbox-tuner.
In rust use include_str!() to load the contents of the script files at compile time to then create the script files at runtime.
from toolbox-tuner.
Related Issues (20)
- Refactor Toolbx List management
- Dialogue: Detected external deletion of toolbox
- Start stop toolbox from list
- On application start figure out if podman or podman-host should be used
- At programm start check for required tools HOT 1
- Flatpak support
- Write tests that use actual toolbox/podman cli
- Fix podman test image not working with toolbox
- `refresh_status` that refreshes container status by using `podman container inspect <name>`
- Migrate to Relm4 0.6
- First Start Guide
- Support more terminals
- Build Flatpak in CI
- Create release checklist to follow
- Automatically vendor dependencies in CI
- Multiple main windows can be open at the same time
- Allow users to create symbolic links between directories of seprate home and actual home directory
- AppImage support
- Add vendoring of dependencies (possibly to CI)
- Rewrite for Relm4 0.6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toolbox-tuner.