Thomas Funk t.f...@web.de writes:
2012/7/18 Dan Espen des...@verizon.net:
I'm guessing dbus or some other abomination does the job
for the desktops...
I've checked the internet for finding infos how the Distributions/
Desktops do the automatic menu update process. Here're my results:
Debian:
When a package that wants to add/remove something to/from the menu tree
gets installed/removed, it will run update-menus in its postinst/postrm
script.
http://www.debian.org/doc/packaging-manuals/menu.html/ch2.html
- see chapter 2.1
http://www.debian.org/doc/packaging-manuals/menu.html/ch4.html
- See chapter 4.2
KDE:
Use kbuildsycoca4 to update the configuration cache in KDE
https://bbs.archlinux.org/viewtopic.php?id=64514
Gnome:
found nothing about how they do it. I send an email to the LinuxMint
developers because they made their own menu (mintmenu) but got no response
back yet.
Xfce:
Before 4.8 they use libxfce4menu. In the sources there're comments that they
use filesystem monitoring - down line 171
http://bazaar.launchpad.net/~vcs-imports/libxfce4menu/trunk/view/head:/STATUS
Since 4.8 garcon is used. Also with filesystem monitoring
- http://wiki.xfce.org/dev/garcon
In the Xfce wiki page (http://wiki.xfce.org/howto/customize-menu) they said
also that xfdesktop session starts, changes to the menu file are
implemented
immediately. (for Xfdesktop 4.5 or higher) Or reload xfdesktop
Fluxbox and other WMs:
Per default no automatic update. User have to do this manually.
The thoughts doing this over dbus or other stuff:
found nothing about specific messages used by package systems to
inform tools
to start menu updating.
Summary:
- Debian do updating Debian specific - not usable - depends on package mgmt.
- Some DEs do updating specific too via daemons - too much dependencies
- Xfce do filesystem monitoring/scanning
- Other WMs don't update automatically
- No event messages available to initialize menu updating
Looks deflating.
2012/7/23 Dan Espen des...@verizon.net:
Over here:
http://crunchbanglinux.org/forums/topic/5370/how-to-set-up-a-dynamic-xdg-menu-for-openbox/
http://tinyurl.com/84jdvcy
I see they are talking about using inotify to know when menus have been
updated. Not something I'd recommend. Manual update still seems
preferable (to me).
inotify sounds interesting but another dependency again. I still prefer
the filesystem scan by ourself if at all. I found the idea in the sources
of Marchfluxmenu:
They do this with 'ls /usr/share/applications/*.desktop | wc -l'. They
remember the count and if it changed a menu update starts. One directory
is enough for them because they use the applications menu only. But I
am not sure if this is enough for our menus. Must check this first. But
if so a scan tooks milliseconds and the load is insignificant. We could
do a scan perhaps every minute. This could be enough to rebuild the menus
without recognition by the user. Another advantage is no dependency with
dbus and other 'abomination' as you said. We need no entries for daemons
to register us, no restarts of them and so forth ...
Personally I haven't either a problem with manual nor with automatic
updating. Both have their own charm ...
But for a automatic menus update we need another solution - a module
as Thomas suggested.
Excellent work.
Lots of people expect their system to be able to go to sleep,
hence my dislike for polling.
Sounds to me like Debian has it right.
(Specifically invoking a process after menus change.)
I wouldn't be surprised to see a solution being implemented in other
distros in due time. In the mean time, I think we're fine as is.
Again, personal issues piling up.
Forgive me for dragging my feet on patch application.
I'll try to get to it ASAP.
--
Dan Espen