File: README

package info (click to toggle)
menu-cache 1.1.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 1,856 kB
  • sloc: sh: 11,252; ansic: 4,988; makefile: 153
file content (92 lines) | stat: -rw-r--r-- 3,920 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Libmenu-cache is a library creating and utilizing caches to speed up
the manipulation for freedesktop.org defined application menus.
It can be used as a replacement of libgnome-menu of gnome-menus.

Advantages:
1. Shorten time for loading menu entries.
2. Ease of use. (API is very similar to that of libgnome-menu)
3. Lightweight runtime library. (Parsing of the menu definition files 
   are done by menu-cache-gen when the menus are really changed.)
4. Less unnecessary and complicated file monitoring.
5. Heavily reduced disk I/O.

Installing:

Since version 0.7.0 the Libmenu-cache requires Libfm-extra for the
menu-cache-gen menu cache generation binary. Since Libfm depends on
Libmenu-cache, there is some hint for bootstrapers how to build those
libraries together: you need create Libfm-extra first, you can easily
do this by passing '--with-extra-only' option to configure script and
installing Libfm-extra. Then you can succesfully build Libmenu-cache
and therefore build full version of Libfm.

Diagnostics:

Libmenu-cache uses cache generation in "fail-proof" mode when it will
ignore improper tags in XML menu file but fail only if that menu file
doesn't exist at all, or has invalid XML structure, or has no root menu
with name 'Applications'. If you want to explore how it is generated
then you can start menu-cache-gen manually in verbose mode, for example:

G_MESSAGES_DEBUG=all \
  /usr/lib/menu-cache/menu-cache-gen -v -i applications.menu -o /dev/null

so you can see all the processing of your XML file and it will fail on
any broken tag or at least show you a warning and you can inspect that
log.

Spec:

Cached menus are localized and stored in ~/.cache/menus/file_name.
file_name is a md5 hash of the name of the original menu +
                                       some environment variable +
                                       locale name.

Since most data in a menu are plain text (names, description comments,
icon names,...etc.), the cached file is in plain text rather than binary
to prevent byte order problems.

Format of the cached menu file, line by line.
(Spaces before the lines are for easier demostration of hierarchy.
 There are no spaces in the real cached file.
 Fields marked with [**] added only in the file format 1.2):

version number (major.minor)
menu name>
number of files to monitor
list of files/dirs which require monitor (prefix D or F indicate whether it
                                          is a dir or file)
list of DE names used in this menu other than the known DEs (LXDE, GNOME,
                                                             XFCE, KDE, ROX),
seperated by ;
+id of top menu dir (+ means dir entry, and - means an application entry)
  title
  comment
  icon name
  menu directory file basename
  dir in which menu directory file locates (use this number as index to get
                                            the string from array of preceding
                                            list of monitored files)
  [**] bitmask flags: (--)|(--)|(not displayed)
    -application desktop id (NOTE: desktop id is not necessarily the basename
                             of desktop file)
     title
     comment
     icon name
     app desktop file basename, empty means the same as desktop id.
     dir in which the desktop file localtes (use this number as index to get
                                             the string from array of
                                             preceding list of monitored files)
     generic name
     exec command line
     bitmask flags: (use terminal)|(use startup notification)|(not displayed)
     show_in_flags: bitwise or of masks for various DEs.
     [**] executable name to test for availability
     [**] working dir for exec
     [**] categories: list divided by semicolon
     [**] keywords: list divided by comma
    +sub dir id
     title
     comment
     icon name
     ...