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
.
grep -L
returns "files without match", lower case-l
returns files with matches and does get things going – Xen2050 Dec 24 '14 at 09:47sed ... $DESKTOP_FILE > ~/.local/share/applications/$DESKTOP_FILE
. – muru Dec 24 '14 at 12:54cp
command, I'll look for a "no-clobber" type option maybe... or I'll just paste your comment in there instead :) [maybe I'll delete some comments too...] Thanks for the help – Xen2050 Dec 24 '14 at 13:18