On Fluxbox, I use fbmenugen to generate the root menu. It works great, and now I want a pacman hook to automatically regenerate it whenever I install or uninstall packages.
So far it is registered by pacman, but it will not execute with the option I use in the terminal, which is
fbmenugen -g
This option is necessary for fbmenugen to run.
What I’ve done:
sudo mkdir /etc/pacman.d/hooks
sudo mkdir /etc/pacman.d/hooks.bin
sudo nano /etc/pacman.d/hooks/50-fbmenugen.hook
where I put:
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Regenerate Fluxbox menu when installing or removing packages
When = PostTransaction
Exec = /bin/bash -c fbmenugen -g
When I run
sudo pacman -S htop
what I get in the terminal is:
:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [##########################################################] 100%
(1/1) checking package integrity [##########################################################] 100%
(1/1) loading package files [##########################################################] 100%
(1/1) checking for file conflicts [##########################################################] 100%
(1/1) checking available disk space [##########################################################] 100%
:: Running pre-transaction hooks...
(1/1) Performing snapper pre snapshots for the following configurations...
==> root: 146
:: Processing package changes...
(1/1) reinstalling htop [##########################################################] 100%
:: Running post-transaction hooks...
(1/5) Arming ConditionNeedsUpdate...
(2/5) Regenerate Fluxbox menu when installing or removing packages
[!] To generate a new menu, please specify option `-g`.
(3/5) Updating icon theme caches...
(4/5) Updating the desktop file MIME type cache...
(5/5) Performing snapper post snapshots for the following configurations...
==> root: 147
So from what I can tell, everything seems to be OK except for that fbmenugen needs the -g option to function. Htop gets installed, but the menu isn’t regenerated.
I’ve tried all sort of variations with parenthesises and ’ , from what I’ve seen online, but none work.
The question is what I am doing wrong?