Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to create new Start Menu Category and Entry with .deb Package?

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
Michael_
Posts: 5
Joined: 2024-02-05 22:55

How to create new Start Menu Category and Entry with .deb Package?

#1 Post by Michael_ »

I'm trying to do this on the current Linux Mint Ubuntu Cinnamon Version but i want this to ideally
work on any debian based distribution.

I have programmed a linux application. Currently it's only available as a portable but i want to
also distribute it als a .deb Package.

Everything works except i want the .deb package to automatically create my own folder in the start menu
and a program launcher in that folder. So i tried...

Creating a MyTestFolder.directory in /usr/share/desktop-directories with the following content:

Code: Select all

[Desktop Entry]
Name=MyTestFolder
Comment=My Test Folder Description
Icon=applications-office
Type=Directory
Creating a Program Name.desktop in /usr/share/applications with the following content:

Code: Select all

[Desktop Entry]
Icon=/usr/share/icons/program_folder_name/the_icon.png
Exec=/usr/local/bin/"program folder name"/the_program.sh
Type=Application
Categories=MyTestFolder;
Name=Program Name
Comment=Short Program Description
Keywords=Program;Name;
The Program shows up in the Start Menu but in the "Other" Directory. The "MyTestFolder" does NOT show up in the start menu.

desktop-file-validate output:

Code: Select all

/usr/share/applications/Program Name.desktop: error: value "MyTestFolder;" for key "Categories" in group "Desktop Entry" contains an unregistered value "MyTestFolder"; values extending the format should start with "X-"
/usr/share/applications/Program Name.desktop: hint: value "MyTestFolder;" for key "Categories" in group "Desktop Entry" does not contain a registered main category; application might only show up in a "catch-all" section of the application menu
If i change "MyTestFolder" to "X-MyTestFolder":

Code: Select all

/usr/share/applications/Program Name.desktop: hint: value "X-MyTestFolder;" for key "Categories" in group "Desktop Entry" does not contain a registered main category; application might only show up in a "catch-all" section of the application menu
I'm fighting with this for hours, even tried trouble shooting using AI but with no success.
At this point im desperate and dont know what to do anymore.

Why doesn't this crap work? :D
Can anybody help?

I attached the latest version of my .deb package which you can "decompile" using:

Code: Select all

dpkg-deb -x ./path/to/test.deb ./path/to/destination
Unfortunately i also don't know another program that is getting distributed as a .deb package which i could "copy" from.

I already successfully created a entry in the standard "Office" category. That's not a problem.
The problem is creating my own category instead of using a standard one like "Office".

Deb File Download: https://easyupload.io/lcijn9

lindi
Debian Developer
Debian Developer
Posts: 452
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 88 times

Re: How to create new Start Menu Category and Entry with .deb Package?

#2 Post by lindi »

Packages are not allowed to install files to /usr/local/bin (see debian policy manual section 9.1.1). Can you provide the source package (*.dsc file)? Have you ran lintian against it?

Michael_
Posts: 5
Joined: 2024-02-05 22:55

Re: How to create new Start Menu Category and Entry with .deb Package?

#3 Post by Michael_ »

Well the solution was this: https://askubuntu.com/a/436373

I did everything right except i still had to create the .menu file.
lindi wrote: 2024-02-06 00:18 Packages are not allowed to install files to /usr/local/bin (see debian policy manual section 9.1.1).
Well but it works. What are the downsides of ignoring those rules?

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: How to create new Start Menu Category and Entry with .deb Package?

#4 Post by stevepusser »

It can be done, but installing a system package in /usr/local violates Debian packaging policy. You look better doing it the approved way. Plus, the Debian packaging tools barf if you try that, and you have to add an override to debian/rules to allow it. (from our boo-boos when starting packaging for MX Linux) :oops:

I am fairly certain that use of the menu files is now deprecated. If you have working .desktop files, can't you just directly install them?
MX Linux packager and developer

Michael_
Posts: 5
Joined: 2024-02-05 22:55

Re: How to create new Start Menu Category and Entry with .deb Package?

#5 Post by Michael_ »

stevepusser wrote: 2024-02-06 03:10 If you have working .desktop files, can't you just directly install them?
What do you mean by that? This is my first .deb package. :D
Last edited by Michael_ on 2024-02-06 04:29, edited 1 time in total.

Michael_
Posts: 5
Joined: 2024-02-05 22:55

Re: How to create new Start Menu Category and Entry with .deb Package?

#6 Post by Michael_ »

Also i find building a .deb package pretty hard.
On Windows i use InstallForge and create an exe in 30 minutes or less.

Is there something like that for linux aswell? I found a bunch of software that has not been updated in over 10 years and debreate which i could not get working aswell. (Did not try very hard)

lindi
Debian Developer
Debian Developer
Posts: 452
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 88 times

Re: How to create new Start Menu Category and Entry with .deb Package?

#7 Post by lindi »

Michael_ wrote: 2024-02-06 05:26 Also i find building a .deb package pretty hard.
You need to research this a bit I think. Building a binary package is very easy, you just run e.g. "pbuilder build foo.dsc". The hard part is creating the source package.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: How to create new Start Menu Category and Entry with .deb Package?

#8 Post by stevepusser »

To install any .desktop files (or others) in your source's root directory, just add a text debian/install file with contents

Code: Select all

*.desktop usr/share/applications
customize as necessary.
MX Linux packager and developer

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: How to create new Start Menu Category and Entry with .deb Package?

#9 Post by stevepusser »

lindi wrote: 2024-02-06 07:03
Michael_ wrote: 2024-02-06 05:26 Also i find building a .deb package pretty hard.
You need to research this a bit I think. Building a binary package is very easy, you just run e.g. "pbuilder build foo.dsc". The hard part is creating the source package.
Oh, jeez, how is a beginner supposed to know that first they must install pbuilder for that, and then set up pbuilder schroots with it? There's much more to than that.
MX Linux packager and developer

Michael_
Posts: 5
Joined: 2024-02-05 22:55

Re: How to create new Start Menu Category and Entry with .deb Package?

#10 Post by Michael_ »

stevepusser wrote: 2024-02-07 16:20 To install any .desktop files (or others) in your source's root directory, just add a text debian/install file with contents

Code: Select all

*.desktop usr/share/applications
customize as necessary.
I have .desktop file in that directory. and a .directory file in usr/share/desktop-directories.
But the directory does not show up in the start menu and the program gets listed in the Catch All Category.
Well except i'm additionally creating a .menu file.

Post Reply