Undesired newline at the end of command metadata
Opened this issue · 1 comments
aivarsV commented
Like title says, in latest version, command metadata ends with \n
character. This might not be an issue, if using passing {2}
as the last argument to launch command as in example from README.MD
. But it will fail to launch desktop entries with extra arguments, if {2}
is used in the middle of launch_cmd
, like following:
[desktop]
list_cmd=sway-launcher-desktop list-entries
preview_cmd=sway-launcher-desktop describe-desktop "{1}"
launch_cmd=riverctl spawn "$(sway-launcher-desktop generate-command '{1}' '{2}' | sed -e 's/^exec //')"
For me, quick and dirty solution was to remove any new lined from COMMAND
just before it is executed:
diff --git a/tmp/sway-launcher-desktop.sh b/usr/bin/sway-launcher-desktop
old mode 100644
new mode 100755
index 6c0ba38..c684a2c
--- a/tmp/sway-launcher-desktop.sh
+++ b/usr/bin/sway-launcher-desktop
@@ -363,6 +363,7 @@ readarray -d ${DEL} -t PROVIDER_ARGS <<<${PROVIDERS[${PARAMS[1]}]}
COMMAND=${PROVIDER_ARGS[2]//\{1\}/${PARAMS[0]}}
COMMAND=${COMMAND//\{2\}/${PARAMS[3]}}
COMMAND=${COMMAND%%[[:space:]]}
+COMMAND=${COMMAND//[$'\n']}
if [ -t 1 ]; then
echo "Launching command: ${COMMAND}" >&3
However, I believe, undesired newline comes from
bkmgit commented
Seems to affect describe-command
as well, test fails for ls
https://download.copr.fedorainfracloud.org/results/fed500/sway-launcher-desktop/fedora-rawhide-x86_64/08451048-sway-launcher-desktop/builder-live.log.gz