View previous topic :: View next topic |
Author |
Message |
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Fri Nov 08, 2002 1:18 pm Post subject: Solution for automating menu generation: menu.mask |
|
|
This is a follow-up to the following thread (reading not required):
https://forums.gentoo.org/viewtopic.php?t=10148&highlight=menu+update
Having thought about this, I believe I have come up with the solution.
People pointed out the following problems:
- Some DEs/WMs have their own structured menus eg KDE
- Some people would want their own menus and not automatically generated ones
- Having ebuilds determine the menu leaves a lot of work to be done with existing ebuilds
So I propose the following:
- Have a file 'menu.mask' in /usr/portage/profiles/ which will be the axis of generating the menu.
- Packages not in menu.mask will be ignored
- The user can have an optional menu.mask with settings to override as desired those in menu.mask
- The mask file specifies both menu structure and application placement within the menu structure
- Packages are specified as [package name][min version] [exception list]
- If, for a given package, an installed wm or de is not specified as an exception, then it is applied to that wm's or de's menu
- If there is a specified exception then the package is applied to the menu as per the rules of the exception or, if no rule is specified, is ignored for the particular wm or de
- If a package appears in the users' menu.mask then it is ignored in /usr/portage/profiles/menu.mask and the settings in the users' menu.mask are used. (btw why can't you do this is package.mask!?)
Example menu.mask (please note this is PSEUDO and hence specifics are probably wrong etc):
Code: |
# The following tree defines the menu structure
#
<root1>
<menuid1>
icon=x
text=submenu 1
</menuid1>
<menuid2>
icon=y
text=submenu 2
<menuid3>
icon=z
text=submenu 3
</menuid3>
</menuid2>
</root1>
<root2>
<menuid4>
icon=a
text=submenu 4
</menuid4>
<root2>
# Somehow specify an alternative menu root
# If unspecified, rootx defaults to menu root for wm
#
kde root1={/kdemenu/other programs}
kde root2={/kdemenu/testing}
gnome root2={/gnomemenu/testing}
<menuid1>
packageA_1.1 kde gnome # ie except for kde and gnome
packageB kde
</menuid1>
<menuid2>
packageA_1.3 kde={/kdemenu/testing} # put it elsewhere for kde
</menuid2>
|
Any opinions? _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Fri Nov 08, 2002 1:27 pm Post subject: |
|
|
Eh...I remember reading somewhere (though I can't remember where) that automatic menus was already under development. If so, you may want to jump over to gentoo-dev on IRC and see if you can find out more about it there.
--kurt _________________ The problem with political jokes is that they get elected |
|
Back to top |
|
|
thinair Tux's lil' helper
Joined: 01 Nov 2002 Posts: 144 Location: Suisse
|
Posted: Fri Nov 08, 2002 2:50 pm Post subject: |
|
|
It would be really a good think... because actually I think it's difficult to choose to activate masked package...
If you put ACCEPT_KEYWORDS="~arch" you have no control about masked package... I don't like that...
I had a bad experience with that...I put it in my make.conf file... and made sometimeslater ... emerge system -u (and gcc was updated to gcc-3.2-rc2 , now I am returning to gcc-3.2-rc1) |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Fri Nov 08, 2002 8:05 pm Post subject: |
|
|
Following up on klieber's post, my understanding was that the Debian menu system was "coming soon to a Gentoo near you". _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Tue Nov 12, 2002 12:39 pm Post subject: Re: Debian Menu System |
|
|
I get the impression it's not as customisable as the option I've offered here. Plus here you can add your own custom entries to your menus very easily, and the menus are customised according to the WM.
I'm going to see if I can hack a 'proof of concept' version once my ADSL link comes through at home, and see if it's warmly accepted.
_________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Tue Nov 12, 2002 12:41 pm Post subject: Re: Debian Menu System |
|
|
charlieg wrote: | I'm going to see if I can hack a 'proof of concept' version once my ADSL link comes through at home, and see if it's warmly accepted. |
Choice is (almost) always a good thing. Looking forward to giving your system a spin.
--kurt _________________ The problem with political jokes is that they get elected |
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Tue Jan 14, 2003 10:33 am Post subject: Still |
|
|
I've still not had a chance to do this yet, although that doesn't mean I no longer plan to.
I've just got to find an evening to put aside to hammer out a proof of concept and give it to somebody. That and Seemant told me to wait for the new XML oriented portage to be finished up and done. _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
noff Guru
Joined: 11 Nov 2002 Posts: 388 Location: College Park, Maryland
|
Posted: Wed Feb 12, 2003 2:24 am Post subject: |
|
|
I think it would be better to build functionality into portage to make it more automatic. Then you could USE "menu" and have them automatically put in KDE or Gnome, at least to start. You could have a menus.conf that would say in KDE a graphics program -> Graphics menu. A similar form to charlieg's, but have each ebuild classify itself, then allow you to tell which menu gets what type. This system would require newer versions of ebuilds but that is bound to happen.
I really think that the lack of functionality hurts gentoo and if an intelligent system-wide menu system were implemented it would be a great boon. _________________ What Larry was saying is that if you make it too easy for programmers, then poor programmers will be able to do things best left to good programmers, and will inevitably do them poorly. Everyone will suffer in the long term as a result." - Tom Chance |
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Wed Feb 12, 2003 9:43 am Post subject: |
|
|
I don't like the idea of making ebuilds specify where to go in various menus.
It sounds complicated. Not to mention, like you say, it requires direct changes to portage. _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
lanius Retired Dev
Joined: 08 Dec 2002 Posts: 160
|
Posted: Mon Mar 31, 2003 10:32 am Post subject: |
|
|
So are there any efforts of putting such a menu system in gentoo. I would like it, because it's really annoying to put all this apps into the icewm menu.
But for the structure I propose a different one. There are .desktop files and they are the base of the menus for both, kde and gnome. So I think every app should supply such a .desktop file and than we need some wrappers for the other windowmanagers like icem or fluxbox.
mfg, heino |
|
Back to top |
|
|
StrCrssd n00b
Joined: 17 Apr 2002 Posts: 68 Location: McAllen, TX USA
|
Posted: Mon Mar 31, 2003 5:07 pm Post subject: Menuing.... |
|
|
I really don't care which menu system gets implmented, as long as we can TURN IT OFF. I have played with Debian in the past and have found it very, very difficult to disable their menu system (or even hide packages from their menu system).
The only thing I ask is that whatever system we decide to use is OPTIONAL and, by default, not included in the base install.
Thanks, and sorry for digressing (slightly). _________________ StrCrssd
Give a man enough rope, he'll hang himself. Teach a man to make rope, he'll hang other people. |
|
Back to top |
|
|
lanius Retired Dev
Joined: 08 Dec 2002 Posts: 160
|
Posted: Mon Mar 31, 2003 6:37 pm Post subject: |
|
|
I think that can easily be done by setting a useflag or a portage option. But somebody should start to code such a system. I can also help in doing this but it should be something official so that it will be included in portage. |
|
Back to top |
|
|
seemant Retired Dev
Joined: 16 Nov 2002 Posts: 61 Location: Oakland, CA
|
Posted: Sun Apr 06, 2003 12:23 pm Post subject: Menus |
|
|
OK, it's like this. We played around with debian/drake's menu system. Didn't like it, really, the syntax is -- well "um" is probably the best way to describe it. Then we threw around the idea of XML'ifying menu entries. Then, Alastair Tse (liquidx) pointed out that GNOME and KDE are already confroming to the freedesktop.org standards. Now, that's something that we can handle -- since all the desktop entries for those DE specific apps are/will be in that format anyway. So, it remains then to create transformer scripts to convert that format to <insert your favourite wm here>'s format. Apart from that, if users really think it should be OPTIONAL, then we''ll introduce a USE flag for it to be done in postinst() for the packages. So, consider me your point man for this, and fire away ideas, scripts, etc into bug 18638. In my plan, this was not going to be a part of the 1.4 release. So we're looking at 1.5 or whatever release comes next.
Looking forward to y'all's input.
EDIT: For the lazy like me, I added a link to the bug report. -- pjp |
|
Back to top |
|
|
lanius Retired Dev
Joined: 08 Dec 2002 Posts: 160
|
Posted: Sun Apr 06, 2003 5:01 pm Post subject: |
|
|
I love the idea of using the freedesktop standard and I really think this menu entries should be optional, it would be no problem at all and could be set as standard If you need help with scripting, I'm here |
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Mon Apr 07, 2003 9:12 am Post subject: Re: Menus |
|
|
seemant wrote: | Alastair Tse (liquidx) pointed out that GNOME and KDE are already confroming to the freedesktop.org standards. |
As nice as it is to adhere to the freedesktop.org standards, it's always nice to have it customisable, especially so with a menu.
You might even want a different menu layout according to whatever DE you are using... or even whatever user you are logged in as. _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
seemant Retired Dev
Joined: 16 Nov 2002 Posts: 61 Location: Oakland, CA
|
Posted: Mon Apr 07, 2003 9:37 am Post subject: ok |
|
|
but how would you propoose to do that? |
|
Back to top |
|
|
lanius Retired Dev
Joined: 08 Dec 2002 Posts: 160
|
Posted: Mon Apr 07, 2003 12:26 pm Post subject: Re: Menus |
|
|
charlieg wrote: | seemant wrote: | Alastair Tse (liquidx) pointed out that GNOME and KDE are already confroming to the freedesktop.org standards. |
As nice as it is to adhere to the freedesktop.org standards, it's always nice to have it customisable, especially so with a menu.
You might even want a different menu layout according to whatever DE you are using... or even whatever user you are logged in as. |
You can still customize your menu via your personal .kde or .gnome directories.
If you want a different menu according to your DE, you can unset the menu useflag and manage it completly on your own. |
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Mon Apr 07, 2003 3:35 pm Post subject: Re: Menus |
|
|
heino wrote: | If you want a different menu according to your DE, you can unset the menu useflag and manage it completly on your own. |
Actually, it wouldn't be particularly difficult to produce a better method.
I've talked to seemant about this, but I've yet to follow through on it (but, as ever, planning to do so as soon as I have some decent spare time).
Basically, I've drafted up a layout xml/dtd and a definition xml/dtd, where layout is the layout of the menu (the menu layouts of each of the des, including dirs and subdirs) and the definition is the definition of which packages go where in the menu, done in a similar way to packages.mask (eg >=mozilla-1.3 to match mozilla 1.3 and above), and these will exist in /usr/portage/profile, and be optionally overridden by something in the users home dir.
My next step is to write some basic python that inspects the world file, and generates the corresponding menus for each de and user according to what's installed.
The advantages to this approach are 1) it's highly flexible, 2) it requires absolutely no changes to portage/ebuilds, 3) it's fairly simple, architecture-wise and 4) the xml is easy enough to edit manually so you don't have to be a genius to modify your menus. For 95% of users the default menus, defined by the gentoo dev team, will probably be good enough. _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
lanius Retired Dev
Joined: 08 Dec 2002 Posts: 160
|
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Tue Apr 08, 2003 3:20 pm Post subject: |
|
|
Ooo er... I'll just have to eat a bit of humble pie on that one. Thanks for the link Heino.
I'll read up on it tonight. I'm trying to set aside some free time to get this done. _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
noff Guru
Joined: 11 Nov 2002 Posts: 388 Location: College Park, Maryland
|
Posted: Wed Apr 30, 2003 7:35 pm Post subject: |
|
|
Are people saying this should be done on the kde and gnome level and not on the distro level? I think this is a pressing issue as well icon location.
In the meantime I think we should just do Code: | pkg_postinst() {
use kde && cp gaim.desktop {$ROOT}/usr/kde/$kdev/share/applnk/Internet
use kde && cp icons {$ROOT}/usr/kde/$kdev/share/icons/default.kde
} | It would b a good stopgap at least for major apps.undefined _________________ What Larry was saying is that if you make it too easy for programmers, then poor programmers will be able to do things best left to good programmers, and will inevitably do them poorly. Everyone will suffer in the long term as a result." - Tom Chance |
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Thu Feb 05, 2004 12:20 am Post subject: |
|
|
noff wrote: | Are people saying this should be done on the kde and gnome level and not on the distro level? |
Yes they were, and I think this is wrong. Given how differently distributions work, I think it's really the position of the distro to be deducing what should be included in the application menu.
I'm reviving this thread because I just spotted Menu2WM, a nifty little application for generating WMs for most common WM menus from an XML source file. _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
regeya Apprentice
Joined: 28 Jul 2002 Posts: 270 Location: Desoto, IL, USA
|
Posted: Thu Feb 05, 2004 1:53 am Post subject: Re: Menus |
|
|
charlieg wrote: | seemant wrote: | Alastair Tse (liquidx) pointed out that GNOME and KDE are already confroming to the freedesktop.org standards. |
As nice as it is to adhere to the freedesktop.org standards, it's always nice to have it customisable, especially so with a menu.
You might even want a different menu layout according to whatever DE you are using... or even whatever user you are logged in as. |
I suppose I'm suffering from a lack of sleep, so maybe I'm not understanding what you're saying here. I would think the point of an automated menu generation system would be to have a consistent menu structure; custom menu structures could always be left as an exercise of the reader. Aren't flexible, per-DE per-login-session menus what we have in most WMs now? |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Thu Feb 05, 2004 2:56 am Post subject: |
|
|
The fdo spec provides for per-user, per-WM/DE customisation of menus (adding, moving, removing and rearranging items and folders). I really don't see the point of trying to reinvent the wheel when the fdo solution does what's needed. |
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Thu Feb 05, 2004 10:43 am Post subject: |
|
|
ecatmur wrote: | The fdo spec provides for per-user, per-WM/DE customisation of menus (adding, moving, removing and rearranging items and folders). I really don't see the point of trying to reinvent the wheel when the fdo solution does what's needed. |
+1
My comments were made a long time ago, before fdo was in full swing. _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
|