From 6145d2c160a450c4fa7fea49400e95113317ce7e Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sun, 3 Jul 2022 09:41:47 +0200 Subject: Yes, this is using an eval now --- .local/etc/wrapper.d/firefox.rc | 2 +- .local/share/wrapper.sh | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.local/etc/wrapper.d/firefox.rc b/.local/etc/wrapper.d/firefox.rc index fb3529b..43e745c 100644 --- a/.local/etc/wrapper.d/firefox.rc +++ b/.local/etc/wrapper.d/firefox.rc @@ -5,6 +5,6 @@ WRAPPER_BINS=" /usr/bin/librewolf-bin " -WRAPPER_OPTS="--profile $HOME/.config/firefox" +WRAPPER_OPTS="--profile \"$HOME/.config/firefox\"" FIREJAIL_PROFILE="$HOME/.local/etc/firejail/firefox.profile" diff --git a/.local/share/wrapper.sh b/.local/share/wrapper.sh index 8857210..5625fd1 100755 --- a/.local/share/wrapper.sh +++ b/.local/share/wrapper.sh @@ -61,26 +61,26 @@ main() # Loop over all possible wrapped options, and run the first one that is # executable - while read -r WRAPPER_BIN + while read -r WRAPPER_CMD do - [ -x "$WRAPPER_BIN" ] || continue + [ -x "$WRAPPER_CMD" ] || continue # Add a firejail wrapper if desired if [ -n "$FIREJAIL_PROFILE" ] then - WRAPPER_BIN="firejail --profile=""$FIREJAIL_PROFILE"" -- $WRAPPER_BIN" + WRAPPER_CMD="firejail --profile=\"$FIREJAIL_PROFILE\" -- $WRAPPER_CMD" fi # Optionally add WRAPPER_OPTS, so theres no double space in # case it is empty. if [ -n "$WRAPPER_OPTS" ] then - WRAPPER_BIN="$WRAPPER_BIN $WRAPPER_OPTS" + WRAPPER_CMD="$WRAPPER_CMD $WRAPPER_OPTS" fi # Run all the things we want to run wrap_before - wrap_run "$WRAPPER_BIN" "$@" + wrap_run "$WRAPPER_CMD" "$@" WRAPPER_EXITCODE=$? wrap_after @@ -100,8 +100,7 @@ wrap_log() { wrap_run() { wrap_log "> $*" - run="$1" ; shift - "$run" "$@" + eval "$@" } wrap_before() { :; } -- cgit v1.1