[Slackbuilds-users] Proper Method to Categorize Desktop Apps
Konrad J Hambrick
kjhambrick at gmail.com
Sun May 1 09:58:47 UTC 2022
On Sat, Apr 30, 2022 at 4:11 PM Dave Woodfall <dave at slackbuilds.org> wrote:
> On 30/04/22 15:23,
> Konrad J Hambrick <kjhambrick at gmail.com> put forth the proposition:
> > All --
> > Been playing with the OTB.SlackBuild and OTB Version 8.0.0
> > I am getting clean builds and the program works as expected.
> > `sbolint` returns no errors or warnings, but when I run
> > sbopkglint /tmp/OTB-8.0.0-x86_64-1_SBo.tgz I get a hint:
> > Running test: 35-desktop...usr/share/applications/monteverdi.desktop:
> hint:
> > value "Education;Science;ImageProcessing;Geography;Qt;" for key
> > "Categories" in group "Desktop Entry" contains more than one main
> category;
> > application might appear more than once in the application menu
> > OK
> > Otherwise, all tests are OK
> > Note that sbopkglint returns the same hint on the OTB Version 7.3.0
> > Package file.
> > There is a doinst.sh script that I took from the Version 7.3 SlackBuild (
> > below by sig )
> > What is the proper way to set up a Desktop App in an SBo ?
> > Thanks.
>
> You need to decide which menu category the application should be in,
> then edit the .desktop to match.
>
> > value "Education;Science;ImageProcessing;Geography;Qt;"
>
> From the description, I'd say ImageProcessing.
>
> OTB.desktop file is installed by the application so the usual way is
> to sed the file somewhere after the make install.
>
> --
> Dave
>
Well now ...
There's a lot to know before a .desktop file will pass
`/usr/bin/desktop-file-validate`
I ended up spending more time than I had to spend here:
https://www.freedesktop.org/wiki/Specifications/menu-spec/
and the specific info about Desktop Categories is here:
https://specifications.freedesktop.org/menu-spec/latest/apa.html
I ended up with the if-block below my sig ...
Note that the monteverdi app ends up all by itself under the 'Science and
Math'
Desktop Menu Category.
But now the package passes sbopkglint without Errors, Warnings or Hints.
Thanks for the feedback Dave and B. Watson !
Question: is there a better way ( or a recommended way ) to enter long,
formatted
lists of text like NEW_CAT in the code snippet below ?
Note that many other SBo Packages also fail `desktop-file-validate` so
maybe this was
all a fools-errand :)
-- kjh
# ------------------- cut here -----------------
# default Categories=Education;Science;ImageProcessing;Geography;Qt;
# in build/monteverdi.desktop annoys sbopkglint try this instead ...
# see: https://specifications.freedesktop.org/menu-spec/latest/apa.html
if [ "$MONTEVERDI" = "ON" ] ; then
NEW_CAT="Science;Math;ImageProcessing;DataVisualization"
NEW_CAT="$NEW_CAT;Geoscience;NumericalAnalysis;Qt;"
sed -i -e "s/^Categories=.*$/Categories=$NEW_CAT/" \
$PKG/usr/share/applications/monteverdi.desktop
fi
# ------------------- cut there -----------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20220501/211bcf60/attachment.htm>
More information about the SlackBuilds-users
mailing list