Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo Common Menu
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jstubbs
Retired Dev
Retired Dev


Joined: 05 Jul 2003
Posts: 126
Location: Tokyo

PostPosted: Thu Aug 28, 2003 11:20 pm    Post subject: Reply with quote

Heino: There's quite an active discussion regarding Gentoo-customized desktops that seems to have focused on unified menus happening on ML gentoo-dev at the moment. You may want to check it out and add your ideas to the mix!

Regards,
Jason
Back to top
View user's profile Send private message
lanius
Retired Dev
Retired Dev


Joined: 08 Dec 2002
Posts: 160

PostPosted: Fri Aug 29, 2003 10:20 am    Post subject: Reply with quote

I have read it, but I won't reply there...

It would cause the same discussion as in the last thread "python vs. bash rule files", some people will heavily disagree with this idea and come up with another, it wil end in a flame-war, but the people are not going to do anything to get their system working ..

Svyatogor and me are doing something, working on this system, we had not much time in the last two weeks, but we will continue to work on it to get it finally done :)
Back to top
View user's profile Send private message
jstubbs
Retired Dev
Retired Dev


Joined: 05 Jul 2003
Posts: 126
Location: Tokyo

PostPosted: Fri Aug 29, 2003 10:34 am    Post subject: Reply with quote

Quote:
It would cause the same discussion as in the last thread "python vs. bash rule files", some people will heavily disagree with this idea and come up with another, it wil end in a flame-war, but the people are not going to do anything to get their system working ..


I see your point! The thread did degenerate rather quickly, didn't it. :?

Quote:
Svyatogor and me are doing something, working on this system, we had not much time in the last two weeks, but we will continue to work on it to get it finally done.


Do you have any documented game-plan? I would like to help, simply as it's something I'd like to use. However, I had a look at the CVS and I couldn't see a logical next step - probably because my Python skills are about as good as my heiroglyphics knowledge! But, hey, there's no better way to learn that by doing, right? :wink:
Back to top
View user's profile Send private message
lanius
Retired Dev
Retired Dev


Joined: 08 Dec 2002
Posts: 160

PostPosted: Sun Aug 31, 2003 8:50 pm    Post subject: Reply with quote

Currently there is not much to help :/

Svyatogor is working on a documentation and a gui to edit the menus and I'm cleaning up the backend code.

But I think I will post a request for translations and icons for the categories sometime (hope very soon).
Back to top
View user's profile Send private message
etnoy
Apprentice
Apprentice


Joined: 29 Aug 2003
Posts: 255
Location: Västerås, Sweden

PostPosted: Tue Jan 27, 2004 9:39 pm    Post subject: Reply with quote

I do really like this menu-generation thingy. And I could also make a patch to fluxbox, so that it would support the freedesktop.org "standard" :)
_________________
The md5sum of the above post is 06280ccd85ef9deb49c336e7945f4b5c

God is dead! - Nietzsche
Nietzsche is dead! -God
Back to top
View user's profile Send private message
lanius
Retired Dev
Retired Dev


Joined: 08 Dec 2002
Posts: 160

PostPosted: Tue Jan 27, 2004 9:59 pm    Post subject: Reply with quote

It was decided that we are not going to write generators for the menuf-formats of the wm, but patches for the wm's to natively support the freedesktop.org spec.

A patch for fluxbox would really be great :)

Discussion on this topic is currently underway on gentoo-desktop-research@gentoo.org .
Back to top
View user's profile Send private message
chashab
n00b
n00b


Joined: 16 Jun 2004
Posts: 71
Location: Republic of Alumbia

PostPosted: Wed Jun 16, 2004 11:45 pm    Post subject: Reply with quote

just wondering if progress was still moving forward on this idea.

does anybody care to give an update? or has it been dropped by those interested?

thanks, just curious!
Back to top
View user's profile Send private message
rmalolepszy
Apprentice
Apprentice


Joined: 01 Jan 2004
Posts: 167

PostPosted: Thu Jun 17, 2004 3:20 pm    Post subject: Reply with quote

lol, yea looks like it's been a while. I'm interested in this as well.
_________________
Cheers,
Ryan
Back to top
View user's profile Send private message
syadnom
Guru
Guru


Joined: 09 May 2002
Posts: 531

PostPosted: Wed Jun 23, 2004 7:25 am    Post subject: solution Reply with quote

1)
script checks installed packages, writes this list to a file. programs_menu

2)
small util displays this list and allows check/uncheck for menu desired programs and creates a mask file user_menu.mask, also checks user_menu.mask for previous editing to avoid tedious reselection of menu items.

3)
system_menu.mask file made to automatically remove items known to have no function on the menu.

4)
each new program auto added to menu when util is run, has a switch for simple update to aviod selection and just add new items to menu.

cat, grep, less, etc have no use on a menu, so they are in the menu.mask file and never show on the menu. the util provides an easy way to remove unwanted items from the menu and remember this selection.

--
ideas? opinions?
Back to top
View user's profile Send private message
syadnom
Guru
Guru


Joined: 09 May 2002
Posts: 531

PostPosted: Wed Jun 23, 2004 7:25 am    Post subject: bumpo Reply with quote

bump for thread reserection
Back to top
View user's profile Send private message
syadnom
Guru
Guru


Joined: 09 May 2002
Posts: 531

PostPosted: Wed Jun 23, 2004 7:26 am    Post subject: bumpity bump Reply with quote

ka-bump di-ti-bump bump
Back to top
View user's profile Send private message
syadnom
Guru
Guru


Joined: 09 May 2002
Posts: 531

PostPosted: Wed Jun 23, 2004 7:27 am    Post subject: and then Reply with quote

another util can convert this menu to whatever menu format desired

examp:

menu-util -kde -gnome -fluxbox
Back to top
View user's profile Send private message
rmalolepszy
Apprentice
Apprentice


Joined: 01 Jan 2004
Posts: 167

PostPosted: Wed Jun 23, 2004 12:58 pm    Post subject: Reply with quote

I think that is an accurate solution.
_________________
Cheers,
Ryan
Back to top
View user's profile Send private message
chashab
n00b
n00b


Joined: 16 Jun 2004
Posts: 71
Location: Republic of Alumbia

PostPosted: Wed Jun 23, 2004 5:57 pm    Post subject: Reply with quote

sounds good to me.

idea's on how to go about this? i can code and script, but i'm new to OSS devel and gentoo in particular.

i've posted to gentoo-desktop-research@gentoo.org, but no response. last thread on mailing list was about closing the list due to lack of action. it looks like we'll have to start over.
Back to top
View user's profile Send private message
syadnom
Guru
Guru


Joined: 09 May 2002
Posts: 531

PostPosted: Wed Jun 23, 2004 6:54 pm    Post subject: ok. Reply with quote

chashab

first, in portage all installed packages are in /var/db/pkg

they are sorted my app type as in portage, ie. x11-base has X, net-fs has samba and so on

so you need a directory listing of each program
each programs fold has a file CONTENTS, which has all the paths to everything that ebuild installs. this file 'CONTENTS' has lists starting with 'obj' which are the installed binaries for the program

so in the zsnes folder, in CONTENTS, this is

dir /whatever
dir /thisorthatdoesn't matter
obj /usr/games/bin snes9x

we need to pull that obj line and add that to the menu.

--

so we need a script to traverse all the /var/db/pkg directories and then find 'obj' lines in each CONTENT file. put this into the menu sorted but the top level directory in /var/db/pkg such as anthing in app-emulation should be sorted to the emulation menu item, and games-fps should be in the games folder. an so on.

i think thats a start.

chashab, if you are doing the coding, i will do any reasearch you need.

another thought is how to associate icons with entries on the menu..
Back to top
View user's profile Send private message
chashab
n00b
n00b


Joined: 16 Jun 2004
Posts: 71
Location: Republic of Alumbia

PostPosted: Thu Jun 24, 2004 5:42 pm    Post subject: Reply with quote

sounds good syadnom!

i will whip up some scripts for testing. is there an appropriate place around here to post them?

regarding icons, wouldn't it be handy to have the full set of icons available for download individually using portage? example, our script comes to the conclusion that it needs 4 new icons, it calls on emerge to yank them from a local mirror.

thoughts?

also, i'm assuming we might as well continue discussing here, rather than jumping into some mailing list.
Back to top
View user's profile Send private message
syadnom
Guru
Guru


Joined: 09 May 2002
Posts: 531

PostPosted: Thu Jun 24, 2004 6:02 pm    Post subject: . Reply with quote

for icons yes, but I think we need to focus on simplicity and then add features.

maybe we could use an exsisting icon set and have the script choose the icon based on the name of the program. for instance, KDE has an icon named the same as all the KDE programs. so if you get a kaffeine menu entry, then the script can say to use the icon /usr/kde/3.2/share/icons/crystalsvg/32x32/apps/kaffiene

also, build the script right in this thread and post it here, maybe that will draw attention and we can get a larger interest.
Back to top
View user's profile Send private message
chashab
n00b
n00b


Joined: 16 Jun 2004
Posts: 71
Location: Republic of Alumbia

PostPosted: Thu Jun 24, 2004 6:09 pm    Post subject: Reply with quote

i suppose you can't add attachments to these posts?

i'm going to build it in perl, unless you can give me a non-flameware reason to code in python :-) i noticed portage is done with python, but perl seems a little easier to do the text parsing.
Back to top
View user's profile Send private message
syadnom
Guru
Guru


Joined: 09 May 2002
Posts: 531

PostPosted: Thu Jun 24, 2004 6:17 pm    Post subject: wel.. Reply with quote

python might be prefered but if perl is the eisies for you then most certainly perl is what to use.

Quote:
also, no attachments, but just put the script in a quote
Back to top
View user's profile Send private message
chashab
n00b
n00b


Joined: 16 Jun 2004
Posts: 71
Location: Republic of Alumbia

PostPosted: Thu Jun 24, 2004 7:13 pm    Post subject: Reply with quote

just taking a look through a CONTENTS file. there are quite a few lines starting with obj.

i recal reading earlier that someone suggested having each e-build specify what menu category it should fit under, and what the binaries are. this was idea was killed as all the e-builds would have to be remade.

i'm thinking that binaries are added to a directory that is known to be in a path. so the script should search of obj lines that contain files in known binary directories.

on my machine root shows path as being:
Code:
/sbin:/bin:/usr/sbin:/usr/bin

and a user has the path of:
Code:
/usr/local/bin:/usr/bin:/bin

are these gentoo defaults? should i hard code to look for these directories?
Back to top
View user's profile Send private message
syadnom
Guru
Guru


Joined: 09 May 2002
Posts: 531

PostPosted: Fri Jun 25, 2004 5:25 am    Post subject: these are gentoos defaults Reply with quote

/bin;/usr/bin;/usr/local/bin;/opt/bin;/usr/X11R6/bin;/usr/games/bin

this is the user default on my box. I don't see the need to have the root binary directories. The thing I worried about doing this was you wouldn't know what each file in /usr/bin was for.

you would need to block so many entries, thought the menu would be quite easier to create.


here is a thought,

compare the directory names against portage, then compare that list agains all the bin directories.

like so.

/var/db/pkg/app-admin/fam-x.x
compare to /usr/portage/app=admin/fam-x.x

anything that exsists in both directory trees would go to a buffer or file.

i ran the command

diff /var/db/pkg /usr/portage

and i got a number of lines saying "Common subdirectories: /x/x/x/whatever
and also lines saying Only in /usr/portage/: /x/x/x/whatever

if you could take the "Common subdirectories" and compare the names before the first dash(-) against the files in PATH, i get whis via 'echo $PATH'

anything that exsists in all 3 directorys/trees would end up on the menu, minus anything in the exlusions mask.

I think your shooting down of the original plan may lead to a more simple and effiecient system.

so
Quote:

diff /var/db/pkg /usr/portage | grep "Common" -> /var/commonlist
ls /usr/bin/ | cat -> binlist
ls /bin | cat > binlist

comm binlist commonlist | cat -> fullmenu
diff fullmenu exclusionmask | cat -> realmenuentries

then realmenuentries would need to be applied to the kde menu in some way..

what do you think?
Back to top
View user's profile Send private message
syadnom
Guru
Guru


Joined: 09 May 2002
Posts: 531

PostPosted: Fri Jun 25, 2004 5:30 am    Post subject: more Reply with quote

more explaining
Quote:

diff /var/db/pkg /usr/portage | grep "Common" -> /var/commonlist
ls /usr/bin/ | cat -> binlist
ls /bin | cat > binlist

comm binlist commonlist | cat -> fullmenu
diff fullmenu exclusionmask | cat -> realmenuentries


these lines

Quote:
ls /usr/bin/ | cat -> binlist
ls /bin | cat > binlist


i'm using to create a new binlist whenever the script is run and the adding to that same list in line 2, I'm not sure if their is a more elegant way to do this. but i'm a poor coder so this is my best.

--

now i'm not sure where the kde menu is located so I can't look at it to see the format or anything..

ok.
Back to top
View user's profile Send private message
chashab
n00b
n00b


Joined: 16 Jun 2004
Posts: 71
Location: Republic of Alumbia

PostPosted: Sat Jun 26, 2004 7:20 pm    Post subject: Reply with quote

i'm don't think there is an advantage in comparing directories. for instance
Code:
 diff /var/db/pkg /usr/portage

shows many directories in only /usr/portage, but it shows no directories in only /var/db/pkg. the reason for this is that you don't have any e-builds emerged from the categories that are only directories in /usr/portage.

i hope that made sense. :-)

code is coming up next.
Back to top
View user's profile Send private message
chashab
n00b
n00b


Joined: 16 Jun 2004
Posts: 71
Location: Republic of Alumbia

PostPosted: Sat Jun 26, 2004 8:06 pm    Post subject: Reply with quote

here it is.

it should be noted !JAPH (i am not a perl hacker). suggestions are welcome. but this is more just proof of concept.

to run save it, chmod appropriatly and ./binfind.pl like any script. by default it prints binaries that have been installed into a set path, namely the one i have hard coded. this could be changed to print binaries that are installed into the current users path, if desired.

you can also run it as:
Code:
./binfind.pl simple
which will print all binaries that are in a directory that has /bin/ in the name. one suggestion is to run
Code:
./binfind.pl > list1 ; ./binfind.pl simple > list2 ; diff list1 list2
and see the difference.

the results are printed as category, binary.

i have a number of comments on this, which i'll say in the next post.

Code:
#!/usr/bin/perl

# binfind.pl - ver .1 by chashab - 2004 june 26
# dirty script that looks for all the binaries you've installed with emerge
# outputs results as: category, binary path and name

# add the simple argument to use simple path matching

use File::Find;
find(\&wanted, "/var/db/pkg");
sub wanted {
   if($_ eq "CONTENTS"){   #find all files in /var/db/pkg that are named CONTENTS
      printbin();   #print the binary files from that file
   }
}

sub printbin(){
   open(CURRENT, $File::Find::name);   # Open the file
   @lines = <CURRENT>;   # Read it into an array
   close(CURRENT);      # Close the file
   
   foreach $line (@lines){      # go through line by line
         if(isabindir($line)){   # if it's a line we are looking for, format and pring
            print(substr($File::Find::dir, 12, index($File::Find::dir, "/", 12)-12). ", ");
            print(substr($line, 4, index($line, " ", 4)-4) . "\n");
      }
   }
}

sub isabindir(){
   if($ARGV[0] eq "simple"){   # check to see if we are going to do simple binary path matching
      #checks if it starts with obj and contains /bin/
      if($line =~ /\/bin\// && $line =~ /^obj/){
         return true;
      }
   }else{
      #checks for exact paths
      if($line =~ /^obj \/bin|obj \/usr\/bin|obj \/usr\/local\/bin|obj \/opt\/bin|obj \/usr\/X11R6\/bin|obj \/usr\/games\/bin/){
         return true;
      }
   }
}
Back to top
View user's profile Send private message
chashab
n00b
n00b


Joined: 16 Jun 2004
Posts: 71
Location: Republic of Alumbia

PostPosted: Sat Jun 26, 2004 8:21 pm    Post subject: what i suggest Reply with quote

i've been doing a lot of thinking while i coded this up, and the current method we are persuing has several drawbacks. we can categorize things to some extent, so that seems to be ok.

but what about those extra binaries that aren't needed? having a mask setup was suggested, and at first i thought this was resonable, as we might be able to get away with masking out whole categories. then it occured to me that there is going to be apps that install some binaries for people to run, and other binaries for apps to run. and so we would need to get app specific, and that is going to be really tedious and high-maintence!

finally when the time to properlly do icons comes along, we would have to maintain a list of what binary uses what icon. again, not very fun.

the way to properlly go about a Gentoo Common Menu is to have each e-build specify what binaries are to be listed in the menu, and for each binary provide:
  • the user-friendly name of the binary
  • the path to the binary
  • the category and sub categories for the menu tree
  • the icon name/source of some kind

this info could then be put into an appropriate file somewhere.

to be honest, i see no way of properlly managing this info outside of having each ebuild specify it.

if it should be this way, i guess the next step is to develop a proper plan of where this info should be stored, and lobby those in charge accordingly.

thoughts?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum