From a26a3c4c78a34ea91ab72091b2e7861a7c780a20 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 2 Sep 2021 17:38:48 +0200 Subject: [PATCH] Fix autostart --- home/.config/xmonad/scripts/autostart.sh | 3 ++- home/.local/bin/scripts/deskopen | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/home/.config/xmonad/scripts/autostart.sh b/home/.config/xmonad/scripts/autostart.sh index 6849535..2098b8a 100755 --- a/home/.config/xmonad/scripts/autostart.sh +++ b/home/.config/xmonad/scripts/autostart.sh @@ -3,4 +3,5 @@ # Automatically start the applications in $HOME/.config/autostart AUTOSTART_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/autostart" -find "$AUTOSTART_DIR" -name '*.desktop' -exec ~/.local/bin/scripts/deskopen "{}" \; + +find $AUTOSTART_DIR -name "*.desktop" | xargs -I {} sh -c "~/.local/bin/scripts/deskopen {} &" diff --git a/home/.local/bin/scripts/deskopen b/home/.local/bin/scripts/deskopen index 426928b..98d8280 100755 --- a/home/.local/bin/scripts/deskopen +++ b/home/.local/bin/scripts/deskopen @@ -7,5 +7,5 @@ exec_line=$(grep '^Exec' "$1" | tail -1) cmd=$(echo $exec_line | sed 's/^Exec=//' | sed 's/%.//') # Remove "" around command (if present) cmd=$(echo $cmd | sed 's/^"//g' | sed 's/" *$//g') -# Run the exec line of the application in the background -$($cmd) & +# Run the exec line of the application using /bin/sh +/bin/sh -c "$cmd"