| 1 | GLEP: 16 |
1 | GLEP: 16 |
| 2 | Title: Gentoo Menu System |
2 | Title: Gentoo Menu System |
| 3 | Version: $Revision: 1.1 $ |
3 | Version: $Revision: 1.7 $ |
| 4 | Last-Modified: $Date: 2003/10/04 13:51:00 $ |
4 | Last-Modified: $Date: 2004/11/11 21:33:13 $ |
| 5 | Author: Heinrich Wendel <lanius@gentoo.org>, |
5 | Author: Heinrich Wendel <lanius@gentoo.org>, |
| 6 | Status: Draft |
6 | Status: deferred |
| 7 | Type: Standards Track |
7 | Type: Standards Track |
| 8 | Content-Type: text/x-rst |
8 | Content-Type: text/x-rst |
| 9 | Created: 09-Sep-2003 |
9 | Created: 09-Sep-2003 |
| 10 | Post-History: 04-Oct-2003 |
10 | Post-History: 04-Oct-2003, 11-Dec-2003, 13-Dec-2003, 4-May-2004, 11-Nov-2004 |
| 11 | |
11 | |
| 12 | Definitions |
12 | Definitions |
| 13 | ============ |
13 | ============ |
| 14 | |
14 | |
| 15 | *APP* |
15 | *APP* |
| 16 | A graphical application that should be listed in the menus. |
16 | A graphical application that should be listed in the menus. |
| 17 | *WM* |
17 | *WM* |
| 18 | A program containing a menu manager (i.e. a program that can display a menu, e.g. a windowmanager). |
18 | A program containing a menu manager (i.e. a program that can display a menu, e.g. a windowmanager). |
| 19 | *rule file* |
|
|
| 20 | A python script that describes how to build the menu for a WM. |
|
|
| 21 | |
19 | |
| 22 | |
20 | |
| 23 | |
21 | |
| 24 | Abstract |
22 | Abstract |
| 25 | ======== |
23 | ======== |
| 26 | |
24 | |
| 27 | This GLEP handles a proposal for the following two goals: |
25 | This GLEP handles a proposal for the following two goals: |
| 28 | |
26 | |
| 29 | * Create a common menu layout, which would be independent of the WM. |
27 | * Create a common menu layout, which would be independent of the WM. |
| 30 | This point sound quite important for those people who use more than one WM. |
28 | This point is quite important for those people who use more than one WM. |
| 31 | * Provide a common way to add applications to the menus. |
29 | * Provide a common way to add applications to the menus. |
|
|
30 | |
|
|
31 | |
|
|
32 | Status |
|
|
33 | ====== |
|
|
34 | |
|
|
35 | Timed out (and now subsumed by the gentoo-desktop top-level project) |
| 32 | |
36 | |
| 33 | |
37 | |
| 34 | |
38 | |
| 35 | Motivation |
39 | Motivation |
| 36 | ========== |
40 | ========== |
| … | |
… | |
| 47 | Rationale |
51 | Rationale |
| 48 | ========= |
52 | ========= |
| 49 | |
53 | |
| 50 | The idea of a common menu system is not new to the Linux world, every big |
54 | The idea of a common menu system is not new to the Linux world, every big |
| 51 | distribution (Debian, Mandrake, RedHat, Suse) has such a system. The big DE's, |
55 | distribution (Debian, Mandrake, RedHat, Suse) has such a system. The big DE's, |
| 52 | KDE and GNOME, with the help of freedesktop.org [8]_ are also trying to |
56 | KDE and GNOME, with the help of freedesktop.org [8]_, are also trying to |
| 53 | implement one standard. That will most likely happen in GNOME 2.6 and KDE 3.2 |
57 | implement one standard. That will most likely happen in GNOME 2.6 and KDE 3.2 |
| 54 | (Currently they are only implementing different versions of the |
58 | (Currently they are only implementing different versions of the |
| 55 | desktop-entry-spec, but interpreting it in an incompatible way). But there |
59 | desktop-entry-spec, but interpreting it in an incompatible way). But there |
| 56 | are still many other WM's around that are not going to follow these specs in |
60 | are still many other WM's that currently don't support these specs. So we are |
| 57 | the near future. So we are trying to base our work on the specifications GNOME |
61 | trying to base our work on the specifications GNOME and KDE are going to use. |
| 58 | and KDE are going to use. (These are no official standards but evolving |
62 | (These are no official standards but evolving specifications). This has the |
| 59 | specifications). This has the following advantages: |
63 | following advantages: |
| 60 | |
64 | |
| 61 | * follow specified standards |
65 | * follow specified standards |
| 62 | * i18n support |
66 | * i18n support |
| 63 | * provide the necessary flexibility and modularity |
67 | * provide the necessary flexibility and modularity |
| 64 | * integrate with small changes to our ebuildtree. |
68 | * integrate with small changes to our ebuildtree. |
| 65 | * support for per system and per user menus |
69 | * support for per system and per user menus |
| 66 | |
70 | |
| 67 | This system will be completely optional, nobody will be forced to use it! |
|
|
| 68 | |
|
|
| 69 | Here an short overview, how it is supposed work: |
|
|
| 70 | |
|
|
| 71 | 1. Every APP installs a .desktop file. |
|
|
| 72 | 2. Every WM installs a rule file. |
|
|
| 73 | 3. There is a file which specifies the menu layout. |
|
|
| 74 | 4. A script is run and parses all rule and .desktop files and the menu |
|
|
| 75 | layout and creates the corresponding menus. |
|
|
| 76 | |
|
|
| 77 | We also intent to include a graphical editor for the menus, but this is not |
|
|
| 78 | the primary priority. |
|
|
| 79 | |
|
|
| 80 | |
71 | |
| 81 | |
72 | |
| 82 | Specification |
73 | Specification |
| 83 | ============= |
74 | ============= |
| 84 | |
75 | |
| 85 | 1. What packages with an APP should do |
76 | We are trying to follow these specifications: |
| 86 | -------------------------------------------- |
|
|
| 87 | |
77 | |
| 88 | 1.1 .desktop file format |
78 | * Desktop Entry Specification [9]_ |
| 89 | ''''''''''''''''''''''''' |
79 | * Menu Specification [10]_ |
| 90 | If you want users to be able to find your application you have to create a |
80 | * Icon Theme Specification [11]_ |
| 91 | menu entry in the following format:: |
|
|
| 92 | |
81 | |
| 93 | [Desktop Entry] |
82 | There are two libraries that offer an API to these specifications: |
| 94 | Encoding=UTF-8 |
|
|
| 95 | Type=Application |
|
|
| 96 | Name=KWord |
|
|
| 97 | GenericName=Word Processing |
|
|
| 98 | GenericName[it]=Textverarbeitung |
|
|
| 99 | Categories=Application;Office;Wordprocessor |
|
|
| 100 | Icon=kword |
|
|
| 101 | Exec=/usr/kde/3.1/bin/kword |
|
|
| 102 | |
83 | |
| 103 | This example does not show all translations of the name and comment, but you |
84 | * PyXDG [12]_ (written in python) |
| 104 | can see the format of the file and translations from it. The Categories field |
85 | * Desktop File Utils [13]_ (written in C) |
| 105 | specifies which menu group the application should appear under. In this |
|
|
| 106 | example, the entry is under System Tools. |
|
|
| 107 | |
86 | |
| 108 | The file should follow the xdg desktop-entry spec 0.9.4 [9]_. The Categories |
87 | Our goal is to patch the WM's with the help of these libraries to support the |
| 109 | field is used as described in the menu-spec 0.7 [10]_. |
88 | specifications. APP's then only have to install a .desktop entry [9]_ and |
|
|
89 | optionally an icon and will be listed in all menus. This installation could |
|
|
90 | easily be done by two portage commands (domenu, doicon). |
| 110 | |
91 | |
| 111 | |
92 | |
| 112 | 1.2 Validating the file |
93 | Implementation / Status |
| 113 | '''''''''''''''''''''''' |
|
|
| 114 | We will provide a tool (possibly included in repoman) which will validate |
|
|
| 115 | .desktop files. |
|
|
| 116 | |
|
|
| 117 | |
|
|
| 118 | 1.3 Icon |
|
|
| 119 | ''''''''' |
|
|
| 120 | There are two possibilities to install an icon for the application. |
|
|
| 121 | |
|
|
| 122 | 1. You install an icon in /usr/share/pixmaps and specify the absolute path to |
|
|
| 123 | the file in the .desktop file. |
|
|
| 124 | 2. You install the file as part of an icon-theme [11]_ and specify the name of |
|
|
| 125 | the icon in the .desktop file. Possible icon-themes are: |
|
|
| 126 | |
|
|
| 127 | * default.kde |
|
|
| 128 | * gnome |
|
|
| 129 | * gentoo |
|
|
| 130 | |
|
|
| 131 | The preferred format for icons is png with transparent background. |
|
|
| 132 | |
|
|
| 133 | |
|
|
| 134 | 1.4 Modifying the ebuild |
|
|
| 135 | ''''''''''''''''''''''''' |
|
|
| 136 | To actually install this file, you have add it to the filesdir of the ebuild. |
|
|
| 137 | The extension has to be .desktop. Then change the ebuild to contain a line |
|
|
| 138 | similar to this: "domenu ${FILESDIR}/file.desktop". |
|
|
| 139 | |
|
|
| 140 | |
|
|
| 141 | 2. What packages with a WM should do |
|
|
| 142 | --------------------------------------------- |
|
|
| 143 | Each WM should provide a rule file in /usr/share/menus/wms which follows a |
|
|
| 144 | specific format. Documentation for this format has still to be written, You |
|
|
| 145 | can find examples at [12]_. |
|
|
| 146 | |
|
|
| 147 | |
|
|
| 148 | 3. The Menu layout file |
|
|
| 149 | ------------------------- |
|
|
| 150 | |
|
|
| 151 | The format of the menu layout file will follow the xdg menu-spec 0.7 [10]_. |
|
|
| 152 | |
|
|
| 153 | Gentoo will provide a default menu structure. You can find the current |
|
|
| 154 | proposal at [14]_. |
|
|
| 155 | |
|
|
| 156 | |
|
|
| 157 | |
|
|
| 158 | 4. Customizing the menus |
|
|
| 159 | ------------------------ |
|
|
| 160 | |
|
|
| 161 | Customizing of this system can be done in two ways, system-wide or user-wide. |
|
|
| 162 | The locations of the files follow the xdg basedir-spec 0.6 [14]_. |
|
|
| 163 | |
|
|
| 164 | 4.1 Changing the default menu layout |
|
|
| 165 | '''''''''''''''''''''''''''''''''''' |
|
|
| 166 | The system menu layout is located in /etc/menu/applications.menu, it can be |
|
|
| 167 | overridden by $XDG_CONFIG_HOME/applications.menu. |
|
|
| 168 | |
|
|
| 169 | |
|
|
| 170 | 4.2 Adding own WM files |
|
|
| 171 | ''''''''''''''''''''''''''''''''' |
|
|
| 172 | The system WM files are located in $XDG_DATA_DIRS/menu/wms/, they can be |
|
|
| 173 | overridden or extended by $XDG_DATA_HOME/wms/. |
|
|
| 174 | |
|
|
| 175 | |
|
|
| 176 | 4.3 Adding own menu entries |
|
|
| 177 | ''''''''''''''''''''''''''' |
|
|
| 178 | The system .desktop files are located in $XDG_DATA_DIRS/menu/applications/, |
|
|
| 179 | they can be overridden or extended by $XDG_DATA_HOME/menu/applications/. |
|
|
| 180 | |
|
|
| 181 | |
|
|
| 182 | |
|
|
| 183 | Drawbacks |
|
|
| 184 | ========= |
|
|
| 185 | |
|
|
| 186 | A concern might be that it involves a changing a lot of ebuilds (every APP |
|
|
| 187 | needs to be changed). There has been a proposal for another solution that |
|
|
| 188 | generates menus from the current menu structures of GNOME/KDE. This would have |
|
|
| 189 | the advantage of not changing the ebuilds, but the disadvantage of not being |
|
|
| 190 | very flexible. A menu layout file or per system/users menus would not be |
|
|
| 191 | possibly. It seems more like a quick and dirty solution. Consider that we |
|
|
| 192 | don't have to provide massive file-updates, global lists coherent with our |
|
|
| 193 | tree, but each capable and installed package requires a small change that goes |
|
|
| 194 | back and forwards with versions without overhead for version bumps. |
|
|
| 195 | |
|
|
| 196 | |
|
|
| 197 | |
|
|
| 198 | Backwards Compatibility |
|
|
| 199 | ======================= |
94 | ======================= |
| 200 | |
95 | |
| 201 | People who want to use the new system have to recompile all packages that use |
96 | This GLEP exists for a long time now, still it is not accepted. I will outline |
| 202 | the "gentoo-menu" USE flag. This could be easily done by a tool that will parse |
97 | the current status: |
| 203 | /var/db/pkg and for all ebuilds find corresponding updates with menu info. |
|
|
| 204 | |
98 | |
| 205 | Since nobody is forced to use this system, there are no other backward |
99 | * KDE 3.2 (x86) supports this specification |
| 206 | compatibility issues, you just have to disable the "gentoo-menu" USE-Flag and |
100 | * GNOME 2.6 (~x86) support this specification |
| 207 | you'll get the vanilla situation. |
101 | * domenu[12_] has to be included in portage to be used by the ebuilds to |
|
|
102 | install a desktop entry |
|
|
103 | * Somebody needs to write patches for the other WM's: |
| 208 | |
104 | |
|
|
105 | We should focus on adding support to the following WM's first: |
| 209 | |
106 | |
|
|
107 | * xfce, blackblox / fluxbox / openbox / waimea / kahakai, icewm |
|
|
108 | * fvwm, windowmaker, enlightment, afterstep |
| 210 | |
109 | |
| 211 | Reference Implementation |
110 | The following are not so important, but support some kind of applications |
| 212 | ======================== |
111 | menu: |
| 213 | |
112 | |
| 214 | The reference implementation is nearly finished, it's written in Python, you |
113 | * aewm / aewm++ / evilwm / windowlab / oroborus, amiwm, ctwm, flwm |
| 215 | can find it here [15]_ [16]_. It contains a sample menu layout |
114 | * golem, larswm, pekwm, plwm, pwm, qvwm, selectwm, treewm, trwm |
| 216 | (/etc/menu/applications.menu), the domenu script, the update-menus script and |
115 | * vtwm, xpde |
| 217 | the gentoo icon theme. |
|
|
| 218 | |
|
|
| 219 | Domenu has to be included in Portage, it will install new menu entries in |
|
|
| 220 | /usr/share/menu/applications and run the update-menus script afterwards. |
|
|
| 221 | |
|
|
| 222 | Update-menus parses the menu layout file, the .desktop files and the rule |
|
|
| 223 | files and then creates the menus. If run as user it will create menus only for |
|
|
| 224 | that user, if run as root it will create system wide menus. |
|
|
| 225 | |
|
|
| 226 | |
116 | |
| 227 | |
117 | |
| 228 | Credits |
118 | Credits |
| 229 | ======= |
119 | ======= |
| 230 | |
120 | |
| 231 | Based on suggestions from former discussions on -dev and the Debian |
121 | Based on suggestions from former discussions on the gentoo bugzilla, |
| 232 | menu-system documentation [17]_. |
122 | mailinglists and forums. |
| 233 | |
123 | |
| 234 | |
124 | |
| 235 | |
125 | |
| 236 | References |
126 | References |
| 237 | ========== |
127 | ========== |
| … | |
… | |
| 245 | .. [7] http://bugs.gentoo.org/show_bug.cgi?id=25756 |
135 | .. [7] http://bugs.gentoo.org/show_bug.cgi?id=25756 |
| 246 | .. [8] http://www.freedesktop.org |
136 | .. [8] http://www.freedesktop.org |
| 247 | .. [9] Desktop Entry Specification |
137 | .. [9] Desktop Entry Specification |
| 248 | [http://www.freedesktop.org/standards/desktop-entry-spec/0.9.4/] |
138 | [http://www.freedesktop.org/standards/desktop-entry-spec/0.9.4/] |
| 249 | .. [10] Menu Specification |
139 | .. [10] Menu Specification |
| 250 | [http://www.freedesktop.org/standards/menu-spec/0.7/] |
140 | [http://www.freedesktop.org/standards/menu-spec/0.8/] |
| 251 | .. [11] Icon Theme Specification |
141 | .. [11] Icon Theme Specification |
| 252 | [http://www.freedesktop.org/standards/icon-theme-spec/0.7/] |
142 | [http://www.freedesktop.org/standards/icon-theme-spec/0.7/] |
| 253 | .. [12] Example rule files: |
|
|
| 254 | [http://www.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-menu/examples/?cvsroot=gentoo-src] |
|
|
| 255 | .. [13] Reference menu layout |
|
|
| 256 | [http://www.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-menu/etc/applications.menu?cvsroot=gentoo-src] |
|
|
| 257 | .. [14] Basedir Specification |
|
|
| 258 | [http://www.freedesktop.org/standards/basedir-spec/0.6/] |
|
|
| 259 | .. [15] PyXDG |
143 | .. [12] PyXDG |
| 260 | [http://cvs.cojobo.net/cgi-bin/viewcvs.cgi/pyxdg/] |
144 | [http://www.freedesktop.org/software/pyxdg] |
| 261 | .. [16] Gentoo-Menu |
145 | .. [13] Desktop File Utils |
| 262 | [http://www.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-menu/?cvsroot=gentoo-src] |
146 | [http://www.freedesktop.org/software/desktop-file-utils] |
| 263 | .. [17] Debian Menu System documentation |
147 | .. [14] domenu |
| 264 | [http://www.debian.org/doc/packaging-manuals/menu.html/] |
148 | [http://bugs.gentoo.org/show_bug.cgi?id=25756] |
| 265 | |
|
|
| 266 | |
149 | |
| 267 | |
150 | |
| 268 | Copyright |
151 | Copyright |
| 269 | ========= |
152 | ========= |
| 270 | |
153 | |