#!/usr/bin/bash

if [ ! -f "\OME/.config/firetools/uiapps" ]; then
cat <<EOF > "\OME/.config/firetools/uiapps"
# Program list for Firetools
#
# Each line defines an application, with semicolons separated fields as follows:
#
#       executable; description; icon; (optional) command for starting Firejail
#
# Examples:
#
#       inkscape;Inkscape SVG Editor;inkscape
#       calibre;Calibre eBook Reader;/usr/share/calibre/images/lt.png
#
# Lines starting in # are comments.
#

# Missing Firetools apps

EOF
else
echo "\"\OME/.config/firetools/uiapps\" exists"
fi
echo "linphone;Linphone;linphone" >> "\OME/.config/firetools/uiapps"
echo "/opt/appimages/linphone.AppImage;Linphone AppImage;linphone-appimage;firejail --appimage --profile=/etc/firejail/linphone.profile /opt/appimages/linphone.AppImage" >> "\OME/.config/firetools/uiapps"
echo "/opt/linphone/linphone-launcher;Linphone /opt/linphone/linphone-launcher;linphone-desktop;firejail --profile=/etc/firejail/linphone.profile /opt/linphone/linphone-launcher" >> "\OME/.config/firetools/uiapps"

echo
echo "cat \"\OME/.config/firetools/uiapps\""
echo
cat "\OME/.config/firetools/uiapps"
echo
echo
echo "added linphone to Firetools apps to \"\OME/.config/firetools/uiapps\""
echo
echo "if you wish to remove \"\OME/.config/firetools/uiapps\" copy and paste the following command followed by pressing ENTER:"
echo "    rm -f \"\OME/.config/firetools/uiapps\""
echo
echo "if you wish to edit \"\OME/.config/firetools/uiapps\" copy and paste the following command followed by pressing ENTER:"
echo "    xdg-open \"\OME/.config/firetools/uiapps\""
echo
echo "Done."
exit 0
