Skip to content

Commit

Permalink
Desktop integration: More fixs
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Ribelotta <[email protected]>
  • Loading branch information
martinribelotta committed Jan 31, 2018
1 parent d4d0924 commit 8608df0
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions ide/skeleton/desktop-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ if [ -z "$APP" ] || [ -z "$APP_FULL" ] ; then
APP_FULL="$APP"
fi

# Install the icon files for the application; TODO: scalable
ICONS=$(find "${APPDIR}" -iwholename "*/${APP}.png" 2>/dev/null || true)
if [ -z $ICONS ]; then
ICONS=$(find "${APPDIR}" -name $(grep "^Icon=" $DESKTOPFILE |head -n 1|cut -f 2 -d '=').png)
fi

check_dep() {
DEP=$1
if [ -z $(which $DEP) ] ; then
Expand Down Expand Up @@ -130,15 +136,6 @@ if [ "x$1" = "x--install" ]; then
chmod a+x "$DESTINATION_DIR_DESKTOP/"*
echo $RESOURCE_NAME
echo $APP

# delete "Actions" entry and add an "Uninstall" action
echo $(date)

# Install the icon files for the application; TODO: scalable
ICONS=$(find "${APPDIR}" -iwholename "*/${APP}.png" 2>/dev/null || true)
if [ -z $ICONS ]; then
ICONS=$(find "${APPDIR}" -name $(grep "^Icon=" $DESKTOPFILE |head -n 1|cut -f 2 -d '=').png)
fi
echo "Icons for ${APP} on ${APPDIR} ${ICONS}"
for ICON in $ICONS ; do
ICON_SIZE=256
Expand All @@ -162,7 +159,13 @@ if [ "x$1" = "x--install" ]; then
elif [ "x$1" = "x--uninstall" ]; then
echo "Uninstalling from destkop..."
rm -f "$STAMP_DIR/${APP}_no_desktopintegration" "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME"
for ICON in $ICONS ; do
ICON_SIZE=256
echo "Uninstalling ${ICON} to size ${ICON_SIZE} on resource ${RESOURCE_NAME}"
xdg-icon-resource uninstall --context apps --size ${ICON_SIZE} "${ICON}" "${RESOURCE_NAME}"
done
xdg-desktop-menu forceupdate
gtk-update-icon-cache
echo "Done."
else
echo "Unrecognized option $1"
Expand Down

0 comments on commit 8608df0

Please sign in to comment.