Even More Openbox XDG-Menu Rambling
There are a few xdg menus appearing for openbox, but I still don’t think any of them are as good (or as simple) as the one provided by Fedora, which, as I understand it, is still the only one that properly respects user customisation.
The problem is that it does not update, I have seen some very fanciful method of updating menus, probably the sanest way is to just manually update your menu when you feel the inclination. But I have a script (it has been in my git for a while but I’ve never viewed it as that important) I run with the fedora menu that is really uncomplicated:
#!/bin/bash
# folder watching using inotifywait
COMMAND="xdg-menu > ~/.config/openbox/rootmenu_tmp.xml && mv -f ~/.config/openbox/rootmenu_tmp.xml ~/.config/openbox/rootmenu.xml"
#try and be selective?
ACTIONS='--event modify --event attrib --event close_write --event moved_to --event moved_from --event move --event create --event delete --event delete_self'
PLACES="$HOME/.local/share/applications/* /usr/share/applications/* $HOME/.config/menus/applications.menu"
while inotifywait $ACTIONS $PLACES; do
bash -c "$COMMAND"
done
It simply uses inotifywait (which is part of inotify-tools) to watch for certain actions and then run a command, it could not be less interesting. You can obviously change the command to whatever you want to use to create your menu, if you are not liking the Fedora one. It is not perfect at all and you could probably tweak the actions and places a bit, but it is far less extravagant than some solutions I have seen, and it seems to catch most, if not all, changes to .desktop files.
That’s all.
No Comments yet »
RSS feed for comments on this post. TrackBack URI