Gentoo Archives: gentoo-dev

From: Svyatogor <svyatogor@g.o>
To: gentoo-dev@g.o
Subject: [gentoo-dev] [PROPOSAL] Menu system for all gentoo wm's.
Date: Thu, 29 May 2003 15:12:40
1 Hello Folks!
2 I have recently been thinking on implementing the menu system for gentoo,
3 something like what we have in mandrake (I guess it came from debian).
4 At the moment when a user installs a new app he needs to figure out what is
5 the name of the binary he needs and then add it to the menu of his window
6 manager(s). This is done automatically only if you're installing an app for
7 your desktop (i.e. gnome apps on gnome, kde apps on kde).
8 The whole idea is make thins process automatic - the user installs a programm
9 foo, log out back in and sees the menu entry in all window managers.
11 Here is my suggestion on who it should work.
12 On the system we have a central location for the menu, say /etc/menu.d/
13 Here all subfolders represent categories and files - menu entries
14 respectively. The file contains three entries, something like this:
16 Name=MyApp
17 Command=/usr/bin/myapp
18 Icon=icon.png
20 These entries are created when a pckage is merged by a special domenu command
21 in a ebuild. E.g. domenu Editors, GVim, gvim
22 In addition to the categories folder the menu.d/ would contain a folder
23 "rules", which has the ebuild style files describing how the menus for each
24 installed wm/de should be generated. It would look like this:
26 init_menu() {
27 #Do all nessecary init. here. Eg. touch the menu file.
28 }
30 start_menu() {
31 #Wright whatever should be in heading of the menu.
32 #Especially important for one file menus file fluxbox.
33 }
35 write_entry() {
36 #Ovious. Here we have ${Cat} ${Name} ${Com} vars defined and set.
37 }
39 end_menu() {
40 #whatever should be done to finish the menu.
41 }
43 Now the most important step: genrating users menu. First of all a user should
44 have a choice of whether to use this system or not. If the user likes it he
45 should add a call to syncmenu (a bash scipt) to the .bash_profile or whatever
46 file.
48 When the syncmenu starts it first of all syncronises the ~/.menu with
49 /etc/menu.d (It will basically sync everything except the files that have
50 Custom tag - means edited by user and don't touch). Then this file sources
51 the files in the /etc/menu.d/rules and calls the functions in the order:
52 init, start, write (for every entry), end.
54 I guess the system is quite flexible and allows to support any wm,
55 irrespectively of the menu style it uses. However, before starting woking on
56 it I just wanted to get some feedback on the idea.
58 Ok, waiting for your criticism ;)
60 --
61 Sergey Kuleshov <svyatogor@g.o>
62 Let the Force be with us!
65 --
66 gentoo-dev@g.o mailing list