0

As you know, many application have a generic name.

For example, the generic name of Audacious is: Music Player.

How do you get Lubuntu to use this name instead of the regular name.

I realize that a lot of the applications have the same name and generic name, but that is okay.

Note: I am talking about the lxpanel menu.

Christopher King
  • 346
  • 7
  • 27

1 Answers1

1

Are you talking about in a program menu (lxmenu), or shortcuts on a desktop or panel bar? For those you should be able to add new shortcuts with the generic name (or any name) you'd like. Or a "personal" section with just the apps you commonly used, named however you'd prefer (that's what I'd do).

But, since you clarified that "I would like to change all the names to the generic names at once, not do them individually ... Each application has a generic name built-in to its .desktop file" here's an answer to "how to do that."

This uses some command line tools like grep & sed to search for the "Name=..." part and replace it with the "GernericName=..." part.

NOTE:

  • You should use a local copy of the .desktop files by placing them in your ~/.local/share/applications/ first, with

    cp -R --no-clobber -v /usr/share/applications/ ~/.local/share > ~/cp-applications.log

    (this may add more files than you want or need, but it writes a "log" to ~/cp-applications.log of what's been copied to where in case you want to undo it later) but leaving the original's alone, and not overwriting any local files already there. I'm also using sed's -i option to make a backup copy of the files too named *.BAK. And .

  • If you ever want to go back to the original versions of the .desktop files, you can overwrite the .desktop file with it's .desktop.BAK copy, or with the original from /usr/share/applications/.
  • If there are other .desktop files you'd like to play with, you could search everywhere for them if you like with find / -type f -name "*.desktop" (piped to less, or a file perhaps) but that will return more than you want.
  • And if you want the language-specific generic name just edit to hit that one (for example "GenericName[en_GB]=").

This only changes the first occurrence of "Name=" (so it leaves things like Firefox's "Open a New Window" as-is):

#!/bin/bash
targetdir=~/.local/share/applications/

for i in $(grep -l "^GenericName=" "$targetdir"/*.desktop)
do
    echo Hit on $i
    tmphit=$(sed -n 's/^GenericName=//p' "$i")
    echo Generic name is:"$tmphit"
    sed -iBAK "0,/^Name=/s/^Name=.*/Name=$tmphit/g" "$i" || echo "SED FAILED!!!!"
done

There's probably a way to do this with a one-liner in perl or even sed, awk, but "meh".

Feel free to remove the echo's too. And see these answers for more info:


Or if you want to run them from a terminal, just add some links to the real program, under whatever generic name you'd like. Find the program's location with which (often /usr/bin) and link with ln.

Xen2050
  • 8,943