Debian Menu for DSL
Topic: Debian Menu for DSL
started by: cbagger01
Posted by cbagger01 on May 23 2005,04:19One of the things that I always liked about Debian and specifically Knoppix is this:
If you added a new program via apt-get, dpkg -i, or Synaptic, a new entry was added for this program in the KDE "start" menu if appropriate. And if you removed the program via apt-get remove, the menu entry would disappear automatically.
I did a little bit of research and learned about the Debian /usr/lib/menu/ files and their syntax. This knowledge enabled me to write a short script that will create a new submenu titled "Debian" inside the main fluxbox menu, immediately above the "Apps" submenu.
If you install or remove programs via apt-get, if you run the script again, it will dynamically rebuild the Debian menu and add or remove entries as appropriate.
It is my hope that a "Regenerate Debian Menu" item will eventually be added to DSL and this script would also be run at the end of the "Start Synaptic" script.
Anyways, here is how to use it.
1) Make a backup copy of your fluxbox menu, just in case you have a problem and need to restore your original menu:
cp /home/dsl/.fluxbox/menu /home/dsl/.fluxbox/menu.backup
2) Then use Firefox to highlight the script below and then open Beaver and paste it into a new, blank text file. You can paste highlighted text by pushing the middle mouse button, or scrollwheel button.
3) Save the file as build_debmenu.sh
4) Open an xterminal and type this to make it an executable script:
chmod 755 build_debmenu.sh
5) Run the script by typing:
Let me know how it works (or doesn't work) for you. All feedback is welcome.
Posted by cbagger01 on June 01 2005,03:21OK,
It's been over a week and after 98 views, no feedback.
Can someone try this thing out and see if it works for them?
I know that there are hd install users out there that would like to use apt-get/Synaptic to install applications, but prefer to use myDSL extensions because newly installed Debian packages don't appear in the DSL Fluxbox menu like the myDSL system works.
This script should solve this, while maintaining the original Fluxbox menu structure (both pre and post myDSL installs).
You don't need to be a hd user in order to give it a try.
If you are a livecd user with 128MB of RAM or more, just "Enable Apt" or choose "Synaptic" from the menu and play around a little bit.
If you don't like it, just reboot and you are back to a fresh livecd desktop.
Either way, please reply with info that it works OK or with info that it does not and exactly what appears to be wrong.
Posted by ke4nt1 on June 01 2005,05:54Had I've known before now....
I would have NOT removed all the /usr/lib/menu items
from all the extensions in the past to "trim the fat"..
These files were useless to DSL before this..
Posted by ke4nt1 on June 01 2005,06:10Seems to work for me..
I installed a few small things from debian unstable..
One was xbubble..
Another was XDigger
Another was vgagamespack
last was xblast-x11
Seems I got some bonus apps when I did..
My Debian menu reads..
High-Speed shoot 'em up game
Seems some of them don't follow the usual debian menu format..
vgagamespack didn't even have an entry..
and you see the lengthy entry for xblast-x11..
But the script works nicely, repeatedly..
Good work, cbagger01..
Posted by clivesay on June 01 2005,12:11I tested also. Not sure if I was doing everything exactly right but after installing circuslinux I had the menu items:
Posted by cbagger01 on June 01 2005,17:49Thanks to everyone who is testing and providing information.
I installed circuslinux (Debian Testing) and got the same menu entry.
I then examined the /usr/lib/menu file for further information and found out there is an (optional) variable to a menu entry called "longtitle", in addition to the regular "title" entry, and since both names end with the letters TITLE, it confuses things somewhat.
So I will need to rework the script to ignore "longtitle" and focus on "title".
I'll post the next revision when it is ready for testing.
Thanks again for the feedback. It is appreciated.
Posted by cbagger01 on June 02 2005,03:11OK,
Give this revision a try. It should filter out all of the longtitles and you should see "Circus Linux" in the menu and the one with the exclamation point should no longer be there.
Posted by roberts on June 02 2005,04:54Once this is thoroughly tested it would make a nice addition to the dpkg-restore.dsl
Posted by clivesay on June 02 2005,13:26You scripters just blow my mind!
If this was in dsl-dpkg we would have mydsl and debian apt dynamic menu building in fluxbox?!! We don't need no stinkin' KDE or Gnome
Posted by friedgold on June 05 2005,15:53I'm going to try giving this a go today. Definately a big win being able to have the fluxbox menus automatically updated.
Out of interest was there any reason the debian update-menus program (part of the debian menu package) couldn't be used/modified instead of writing a completely new script?
Posted by cbagger01 on June 05 2005,18:04Debian update menus can be used, but I believe that it would change the basic structure of the DSL menu tree (IE: myDSL dynamic menu and all of the custom DSL static menus).
But then again, I could be wrong. I have never used it except as already integrated with KNOPPIX and KDE.
I'm sure it is also possible to modify the program so that it plays nice with DSL but what fun is that?
I must admit that it offers superior functionality because it creates an entire submenu structure (Games, Tools, Office, etc) instead of just a single "Debian" submenu.
If I run into an unsolvable (by me) problem with my script, then plan B is to modify debian update-menus but I am not there yet.
I also don't know what the space requirements of debian update-menus are. Hopefully it is just a script or a simple C program with no weighty dependencies.
Posted by friedgold on June 05 2005,23:11Just tried this now and it runs great. Just a few points/ideas
-The menu items for text mode programs are not being created properly. For example if I install aptitude the script creates the following menu item:
Which fails to open aptitude properly (since it is not a X program). What is needed is something like
The menu file for aptitude is as follows:
I guess the needs="text" is what would normally tell debian's update-menus program it's a text app and should be run in a terminal.
-If you create a symlink from /usr/sbin/update-menus to /home/dsl/build_debmenu.sh (or wherever you've put it) then your script should be automatically called by the post installation scripts of any packages that need menu items. When I did this and used sudo apt-get install prog_name the menu items were added automatically. Similarly I used synaptic to install gaim and it added the menu item automatically with this symlink present. The only problem I encountered was if you use
It doesn't update the user dsl's menu but the /root/.fluxbox/menu instead. While this makes sense it is probably not what the user would want.
Posted by friedgold on June 05 2005,23:26
The debian menu which includes update-menus package is 400KBs and has no dependecies not already in DSL. Although I'm not hugely familiar with it then menu creation is script based (there's a different script for each wm to create the menu) so it should be possible to modify how it behaves. I would think incorperating the static DSL menu would be fairly straightforward as update-menus already provides a mechanism to specify your own menu items seperate from those in /usr/lib/menu. What would be harder is getting it to work with the dynamic DSL menu.
I just suggested using update-menus as it seems sensible to make use of the pre-existing structure if possible rather than reinvent the wheel. However the update-menus stucture/scripts do seem pretty complicated at a first glance so maybe your way is best.
Posted by cbagger01 on June 06 2005,03:38friedgold,
Thanks for your feedback. Assuming the "needs" variable is always included in every menu file item, it should not be too hard to add the rxvt -e part to the appropriate items.
Also, thanks for the /usr/sbin/update-menus information.
It appears that this is the appropriate place to trigger the menu update script, since this is when the "real" menu update tool would get triggered.
400KB is probably too big for DSL, but if the "Fluxbox" script was reasonable in size and could be made to work with DSL, then it would be a good candidate for modification.
Despite my efforts, I am not totally convinced that my way is best. However, I am convinced that my way is better than no menu updates at all.
Posted by wageslave on June 08 2005,12:47Hey,
I'm a linux noobie. I've done a hdd install of dsl onto an old laptop for a friend of mine, she's even less savvy than me so I want to make things as straightforward as possible for her. This debian menu sounds like a great way to give her easy access to extra programs i add to dsl. Has anyone run into any problems with it yet?