I couldn't get j4-dmenu to compile. There was a message about the
compiler not being able to connect to the j4-dmenu github site properly.
I got the same message with any archive variant of j4-dmenu. So I
used less to take my revenge!
Using less, I wrote a pseudo-dmenu to list the executables buried in the
*.desktop files at /usr/share/applications.
It works like this: you launch the list, you find the app you want to
launch in the list, then you type <!application > on the line provided by
less. You can alternatively highlight the name of the app in the list, copy
it with the middle button of your mouse, and then type exclamation
mark, Shift-Insert and Return.
To return to the list immediately after the program is launched, you can
add space+ampersand to the name of the executable.
For example, to launch dillo and return to the list immediately:
Code: Select all
!dillo &
So you can also work this script selectively from the command line(...)
# Usage: from CLI you can limit the display to a subset, like so:
# menu-share-apps.sh p will list all p*.desktop files.
# From the launcher, lists all *.desktop files.(...)
terminal and ask for a reduced listing, for the a*.desktop files or
the p*.desktop files, for example.
If you use the launcher, all entries are displayed. This script launcher is
also in the zip archive below.
Finally, the entries are numbered. Numbering makes it easier for you to
find your way around in the list. Power users can easily have up to 300
*.desktop files in /usr/share/applications. So, numbering is good.
Caveat 1: please check your *.desktop files for any composite line at
< Exec= >, make those into executable wrappers in a suitable folder,
and replace the composite line with the name of the wrapper. Same
with < java -jar etc. > commands, and with lines containing a "%" sign.
This is not a frivolous request. If you don't do that, the list will become
jaggered, and the program <> category concordance will be off.
Caveat 2: launching programs through less exposes their errors in the
alternate panel that opens in less... Users, do not be surprised,
although you will be, undoubtedly. Some well-known apps are full of
errors, you'll see... and they run in spite of them, God knows why!
Programmers: I didn't do this on purpose, less has always been like
that, and launching an app from any terminal shows the same. So
please double-check, triple-check, quadruple-check your work if you
don't want to lose face???!!!
TODO: a *.desktop file for this script! (hehe)
In short, I wrote this script out of spite, but by golly, it turned out to
be almost as good as dmenu, and it has its own pluses. So I decided to
keep it! Enjoy!
musher0