Hello.
Is there any parser/converter for converting multi-line stanza to single line that the exec key will accept.
Just an example to clarify my question :
**1- Script 1 **run without any error when copied and executed in KDE konsole.
IP_ADDR="192.168.130.239"
while : ; do
ping -c2 "$IP_ADDR"
if $? -eq 0 ] ; then
kdialog --title="Connexion to $IP_ADDR" --msgbox="Router is alive"
break
else
kdialog --title "Connexion to $IP_ADDR" --warningcontinuecancel "No connection
Are you sure you want to continue pinging ?"
$? -eq 1 ] && break
sleep 2
fi
done
see : http://paste.opensuse.org/14691272
**2 - Script 2 **Putting this in a desktop file does not work :
[Desktop Entry]
Comment[en_US]=test script bad v1
Comment=test script bad v1
Exec=IP_ADDR="192.168.130.230"
while : ; do
ping -c2 "$IP_ADDR"
if $? -eq 0 ] ; then
kdialog --title="Connexion to $IP_ADDR" --msgbox="Router is alive"
break
else
kdialog --title "Connexion to $IP_ADDR" --warningcontinuecancel "No connection
Are you sure you want to continue pinging ?"
$? -eq 1 ] && break
sleep 2
fi
done
GenericName[en_US]=test script bad v1
GenericName=test script bad v1
Icon=system-run
MimeType=
Name[en_US]=test script bad v1
Name=test script bad v1
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=
see : https://paste.opensuse.org/49048773
**3 - Script 3 **Putting ‘’ at the end of each line does not work :
[Desktop Entry]
Comment[en_US]=test script bad v2
Comment=test script bad v2
Exec=IP_ADDR="192.168.130.230" \
while : ; do \
ping -c2 "$IP_ADDR" \
if $? -eq 0 ] ; then \
kdialog --title="Connexion to $IP_ADDR" --msgbox="Router is alive" \
break \
else \
kdialog --title "Connexion to $IP_ADDR" --warningcontinuecancel "No connection
Are you sure you want to continue pinging ?" \
$? -eq 1 ] && break \
sleep 2 \
fi \
done
GenericName[en_US]=test script bad v1
GenericName=test script bad v1
Icon=system-run
MimeType=
Name[en_US]=test script bad v1
Name=test script bad v1
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=
see : https://paste.opensuse.org/46049575
**4 - Script 4 **Finaly after different tests i found some solution which work :
[Desktop Entry]
Comment[en_US]=test script good v1
Comment=test script good v1
Exec=IP_ADDR="192.168.130.239" ; while : ; do ping -c2 "$IP_ADDR" ; if $? -eq 0 ] ; then kdialog --title="Connexion to $IP_ADDR" --msgbox="Router is alive" ; break ; else kdialog --title "Connexion to $IP_ADDR" --warningcontinuecancel "No connection
Are you sure you want to continue pinging ?" ; $? -eq 1 ] && break ; sleep 2 ; fi ; done
GenericName[en_US]=test script good v1
GenericName=test script good v1
Icon=system-run
MimeType=
Name[en_US]=test script good v1
Name=test script good v1
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=
see : https://paste.opensuse.org/2919112
Is there any parser/converter to convert a multiline piece of code into one line code ?
Any help is welcome.