Fixmenus: menu entries for the console programs

Moderators: 666philb, Forum moderators

Post Reply
Burunduk
Posts: 245
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 6 times
Been thanked: 123 times

Fixmenus: menu entries for the console programs

Post by Burunduk »

I've installed mc on Fossapup64 and the main menu entry generated for it is:
<Program ...>mc</Program>
while it should be:
<Program ...>urxvt -e mc</Program>

I've been advised to edit the .desktop file but maybe it's easier to edit the /usr/sbin/fixmenus script instead. The code below adds urxvt -e to every program in /root/.jwmrc that has "Terminal=true" in its .desktop file.

Code: Select all

termcmd="urxvt -e "
sedprg=""

for file in `grep -rl 'Terminal=true' /usr/share/applications` ; do
    cmd=`sed -n '/ -e /!s/^Exec=//p' $file`
    [ "$cmd" ] && sedprg="${sedprg}s|>$cmd<|>$termcmd$cmd<|;"
done
sed -i "$sedprg" /root/.jwmrc

Tested on Fossapup64 only. It may work on some other Puppy variants too.

Attachments
fixmenus.gz
Patched fixmenus script from Fossapup64 (gunzip it).
(1.56 KiB) Downloaded 26 times
dimkr
Posts: 2000
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 38 times
Been thanked: 912 times

Re: Fixmenus: menu entries for the console programs

Post by dimkr »

This is fixed in woof-CE for a long time, since https://github.com/puppylinux-woof-CE/woof-CE/pull/2543.

Some recent Puppy builds still use the old xdg-puppy-jwm package and don't have this fix and the pile of fixes in https://github.com/puppylinux-woof-CE/w ... -puppy-jwm :|

User avatar
Grey
Posts: 2003
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 365 times

Re: Fixmenus: menu entries for the console programs

Post by Grey »

Burunduk wrote: Tue Jun 28, 2022 8:32 am

I've been advised to edit

If you mean me, then this was not good advice, but rather an approximate plan of action :)

By the way, sometimes there is no "Terminal=" line in the desktop file at all :)

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

Burunduk
Posts: 245
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 6 times
Been thanked: 123 times

Re: Fixmenus: menu entries for the console programs

Post by Burunduk »

Thank you.

Now for the mc I have:
<Program ...>rxvt -title 'Midnight Commander' -e sh -c 'mc'</Program>
Still need to replace with urxvt to retain customizations (or edit .Xdefaults) and mc uses its own window title anyway.
Edit: replaced rxvt with urxvt in the patch, it's ok now.
Edit: With the patched jwm-xdgmenu, there is no need to remove subcategories from .desktop files - only one entry per submenu is added.

dimkr wrote:

This is fixed in woof-CE for a long time

Yes, this is a workaround for a still "latest" (on puppylinux.com) but forgotten fossapup. This is not a bug report.

I spent considerably more time trying to obtain the patched jwm-xdgmenu than writing those couple of lines in bash. Too many steps I think:

  • go to github - no option for download the dir, and I'm not going to rebuild the whole system

  • find a page that allows downloading a single directory

  • read the petbuild to understand that it's a part of something bigger

  • edit it because, yeah,

    Code: Select all

    # we don't need these
    rm -rf /usr/bin/gnome-menu-spec-test /usr/lib /usr/include /usr/share/locale

    I'm sure you don't but I'm not using a special build environment and my system may be unhappy without /usr/lib

  • finally, build that jwm-xdgmenu (Edit: It's bigger because of libgnome-menu.so)

I know it's puppy and I'm ok with its modus operandi but from the user perspective this kind of an "update system" is rather awkward. Maybe I've just been using mint for too long.

Post Reply

Return to “Fossapup64”