From 2383aa498192091f08f57576ad1bac41cf85457f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Fri, 19 Jun 2020 22:31:54 +0200 Subject: #22. Add some very basic logging to help investigate this bug. debug information is directed to file descriptor 3 and can be dumped using `./sway-launcher-desktop.sh 3>> ~/sway-launcher-desktop.log` --- sway-launcher-desktop.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sway-launcher-desktop.sh') diff --git a/sway-launcher-desktop.sh b/sway-launcher-desktop.sh index 7199474..34b7313 100755 --- a/sway-launcher-desktop.sh +++ b/sway-launcher-desktop.sh @@ -138,7 +138,9 @@ function entries() { # the empty stdin is needed in case no *.desktop files } function run-desktop() { - bash -c "$("${0}" generate-command "$@")" + CMD="$("${0}" generate-command "$@")" + echo "Generated Launch command from .desktop file: ${CMD}" >&3 + bash -c "${CMD}" } function generate-command() { # Define the search pattern that specifies the block to search for within the .desktop file @@ -232,6 +234,7 @@ describe | describe-desktop | describe-command | entries | list-entries | list-c exit ;; esac +echo "Starting launcher instance with the following providers:" "${!PROVIDERS[@]}" >&3 FZFPIPE=$(mktemp -u) mkfifo "$FZFPIPE" @@ -276,4 +279,6 @@ readarray -d ${DEL} -t PROVIDER_ARGS <<<${PROVIDERS[${PARAMS[1]}]} # Substitute {1}, {2} etc with the correct values COMMAND=${PROVIDER_ARGS[2]//\{1\}/${PARAMS[0]}} COMMAND=${COMMAND//\{2\}/${PARAMS[3]}} +COMMAND=${COMMAND%%[[:space:]]} +echo "Launching command: ${COMMAND}" >&3 (exec setsid /bin/sh -c "${COMMAND}" &>/dev/null &) -- cgit v1.2.3