Adding a link to PM in the legacy Debian menu system (used by individual window managers on said distro)

Post your tutorials for using applications or performing related tasks here.
Note: Not for "how do I...?" Questions!
Forum rules
Tutorials and Howtos should only relate to developed software, and not to third party applications. e.g.: Don't post a generic Howto for configuring a firewall.
If you have a question how to do something, you should use one of the support boards, not this board. It is meant for people to document and post instructions.
kbhasi

Adding a link to PM in the legacy Debian menu system (used by individual window managers on said distro)

Unread post by kbhasi » 2017-12-20, 21:20

I couldn't decide if I wanted to post it here or in "Suggestions/feature requests", but I decided to file it here instead because it isn't directly related to PM itself, but the way it's packaged for Debian (and its derivatives). I then ended up filing this in the "tutorials" section instead of the "PM for Linux" section for some reason.

Until this somehow gets integrated into the repacks (by Steven Pusser, or well, anyone else who's repacking PM into .deb packages), I'll do this tutorial, which I'm primarily doing for those users who tend to run window managers (WMs) and not just full desktop environments (DEs), who, from what I could tell, are the more advanced Linux users, because WMs tend to be harder to configure (with Openbox being the exception), as they are often configured through text files, while DEs can be configured through GUIs.

Before I begin, when I mean "legacy Debian menu system", I don't mean the application menu that the user gets in desktop environments like KDE Plasma, XFCE, LXDE, Trinity, Cinnamon, etc, which looks something like this:
mate cropped.png
(This is MATE's interpretation of what's known as the "freedesktop.org Desktop Menu Specification", on one of my Linux systems (running Debian 8))
in before: Someone looking at the MATE screenshot and asking, "WHERE DID YOU BUY YOUR BOX SET OF RED DEBIAN LINUX 9?"

Also, I have a way larger selection of WMs and DEs than just MATE and IceWM on this system, which is a ThinkPad R51 (though with a moderately moisture-damaged LCD but text is still readable) that I have as my laptop for Linux experimentation. I do have newer distros on some of my other systems.

I know some of you are gonna ask why I have Firefox and Chromium installed, as for the former, it was included in the standard Debian software package, and I never got around to removing it, and as for Chromium, it's so I can run that one Chrome exclusive add-on I sometimes use. Legend has it that Google Chrome prevents some people from going to sleep.
Instead, what I mean by that, is this:
mwm cropped.png
This is MWM's interpretation of what is officially called the "Debian Menu System", on the same installation, but I call this the "legacy Debian menu", as it's only really used by the window managers, not the full desktop environments.

Well, with Trinity being the exception, as it uses both menu systems. (Trinity's menu has the former in its main menu, and the latter in a folder named "Debian") Oh yeah, and MATE as well, but by unceremoniously dumping the contents of the Debian menu into the "Other" category.

Thing is, the latter is harder to navigate and add links to compared to the former, so some apps (like a number of MATE components, including Pluma) can't be found there, and I have to launch them through a terminal window, which can end up creating messes all over the bottom left corner after a while.

Step 1: So, to get around doing this, if you don't want to look at the documentation which I subtly linked to earlier, you can go ahead and copy and paste this file I made, into a text editor (in my case, Pluma in MATE)

Code: Select all

?package(palemoon):\
	title="Pale Moon"\
	command="palemoon"\
	needs="X11"\
	section="Applications/Network/Web Browsing"\
	hints="Goanna,Customisable,GTK"\

# icon32x32="/usr/lib/palemoon/browser/pixmaps/default32.xpm"\
# icon16x16="/usr/lib/palemoon/browser/pixmaps/default16.xpm"\
You don't need to copy over the lines beginning with "#", unless you're willing to convert the following files to XPMs (as the Debian menu system only accepts that format for icons) and put them in that folder:
  • /usr/lib/palemoon/browser/chrome/icons/default/default16.png
  • /usr/lib/palemoon/browser/chrome/icons/default/default32.png
Step 2: Then, if you installed PM by installing a package named "palemoon", you can skip this step.

However, if you installed PM by installing a package with a different name (like "palemoon-nonsse2"), change "palemoon" in the first line to the name of that package.

If you installed PM by manually extracting the tarball, or by using the pminstaller script, then change it to "local.palemoon" instead, and the same thing in line 3 but to /opt/palemoon/palemoon instead.

Step 3: Go and save the file (it should be UTF-8, and can be LaTeX or plain text) with the name palemoon to ~/.menu/, or in other words, /home/(your username)/.menu/. If you want the link to be system-wide, then make sure you're running the text editor as the "root" user, and save the file to /usr/share/menu/. Then, open a terminal and run the command update-menus (run that as the "root" user if you're doing it system-wide).

Step 4: Restart your window manager. You should know where to expect the link to be found. However, if you still can't find the link, then log out and log back in. If not, then restart your system. If you still can't find the link, then move it to the system-wide folder by doing this in a terminal window (assuming you're not logged on as "root"):

Code: Select all

sudo mv ~/.menu/palemoon /usr/share/menu/
sudo update-menus
and then restart your system.

Locked