Skip to content

Commit

Permalink
Improved Linux install scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Aug 15, 2024
1 parent 1a8cc3b commit 175fa96
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
37 changes: 20 additions & 17 deletions mrv2/etc/Linux/postinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ fi
#
# Copy icon to applications directory
#
sharedir=/usr/local/@mrv2ShortName@/share/
sharedir=/usr/local/@mrv2ShortName@/share

#
# Copy desktop, icon and locale translations
#
appdir=${sharedir}applications
appdir=${sharedir}/applications

cp -rf ${sharedir}/* /usr/share/

Expand All @@ -75,45 +75,48 @@ for i in $ICON_SIZES; do
cp ${sharedir}icons/hicolor/${i}x${i}/apps/mrv2.png /usr/share/icons/hicolor/${i}x${i}/apps/mrv2-v@[email protected]
done

cp ${sharedir}icons/hicolor/32x32/apps/mrv2.png /usr/share/icons/hicolor/32x32/apps/mrv2.png
cp ${sharedir}icons/hicolor/48x48/apps/mrv2.png /usr/share/icons/hicolor/48x48/apps/mrv2.png

#
# Copy versioned icon to applications and desktop
# Copy versioned shortcut to applications and desktop
#
icon="mrv2-v@[email protected]"
appicon="${appdir}/${icon}"
desktop_icon="${desktop_dir}/${icon}"
shortcut="mrv2-v@[email protected]"
appshortcut="${appdir}/${shortcut}"
desktop_shortcut="${desktop_dir}/${shortcut}"

#
# Copy icon to desktop
# Copy shortcut to desktop
#
cp -f "${appicon}" "${desktop_dir}"
cp -f "${appshortcut}" "${desktop_dir}"

#
# Change owner of icon to user
# Change owner of shortcut to user
#
chown ${name} "${desktop_icon}"
chown ${name} "${desktop_shortcut}"

#
# Make it executable
#
chmod a+x "${desktop_icon}"
chmod a+x "${desktop_shortcut}"

#
# Copy unversioned icon for Wayland to applications
# Copy unversioned shortcut for Wayland to applications
#
icon="mrv2.desktop"
appicon="${appdir}/${icon}"
cp -f "${appicon}" /usr/share/applications
shortcut="mrv2.desktop"
appshortcut="${appdir}/${shortcut}"
cp -f "${appshortcut}" /usr/share/applications


#
# Associate Video formats
#
xdg-mime default "${appicon}" video/mp4 video/mpeg video/quicktime video/x-flv video/x-matroska video/x-ms-wmv video/x-msvideo image/x-avi video/x-otio video/x-usd video/x-usda video/x-usdc video/x-usdz
xdg-mime default "${appshortcut}" video/mp4 video/mpeg video/quicktime video/x-flv video/x-matroska video/x-ms-wmv video/x-msvideo image/x-avi video/x-otio video/x-usd video/x-usda video/x-usdc video/x-usdz

#
# Associate Image formats
#
xdg-mime default "${appicon}" image/x-cin image/x-dpx image/jpeg image/png image/x-tiff image/x-tga image/x-exr image/x-sxr
xdg-mime default "${appshortcut}" image/x-cin image/x-dpx image/jpeg image/png image/x-tiff image/x-tga image/x-exr image/x-sxr

echo "Updating desktop database..."
update-desktop-database
Expand Down
3 changes: 2 additions & 1 deletion mrv2/etc/Linux/postrm.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ else
echo "No suitable version found to create a symbolic link."
echo "Removing /usr/share/applications/mrv2.desktop and mrv2.png"
rm -f /usr/share/applications/mrv2.desktop
rm -f /usr/share/icons/hicolor/48x48/apps/mrv2.png
rm -f /usr/share/icons/hicolor/32x32/apps/mrv2.png
fi
fi
Expand All @@ -52,7 +53,7 @@ rm -f "${desktop_dir}/mrv2-v@[email protected]"


sharedir=/usr/share
appdir=${sharedir}/applications/
appdir=${sharedir}/applications

#
# Remove all icon sizes
Expand Down

0 comments on commit 175fa96

Please sign in to comment.