Major rewrite (new install)

This commit is contained in:
ItsDrike 2025-09-02 22:38:05 +02:00
parent 4e89803237
commit e78b421565
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
158 changed files with 2542 additions and 5238 deletions

View file

@ -14,4 +14,11 @@ script_name="$0"
shell="$(getent passwd "$USER" | awk -F: '{print $NF}')"
command=("$@")
# This syntax might be a bit confusing at first. It works as follows:
# 1. Replace this wrapper process with the user's login shell (through exec)
# 2. The shell is told to run 'exec $@' replacing itself with another process
# 3. The $@ in the exec above referrs to the arguments passed the shell (after -c '...')
# 4. "$script_name" is passed to the shell as $0 (process name), not included in $@
# 5. The ${command[@]} matches the $@ which this script was called with
# -> The command passed into this script as args is ran within the user's shell
exec "$shell" -c 'exec "$@"' "$script_name" "${command[@]}"