SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2015-03-20 23:08:16

obsolete-hw
New Member
From: UK
Registered: 2015-03-18
Posts: 5
Website

obmenu-generator

I think that using obmenu-generator (Github) for the Openbox menu would be a good idea. I use it on my #! Waldorf installations with the schema.pl file set up to emulate the default #! menu since I'm lazy and don't want to add applications to menu.xml everytime I install them. My install process for obmenu-generator is as follows

sudo apt-get install cpanminus build-essential git # Assuming build-essential & git are not already installed
git clone git://github.com/trizen/obmenu-generator
sudo cp obmenu-generator/obmenu-generator /usr/bin
sudo cpanm Linux::DesktopFiles
sudo cpanm Data::Dump

and my ~/.config/obmenu-generator/schema.pl

#!/usr/bin/perl

# obmenu-generator - schema file

=for comment

    item:      add an item inside the menu               {item => ["command", "label", "icon"]},
    cat:       add a category inside the menu             {cat => ["name", "label", "icon"]},
    sep:       horizontal line separator                  {sep => undef}, {sep => "label"},
    pipe:      a pipe menu entry                         {pipe => ["command", "label", "icon"]},
    raw:       any valid Openbox XML string               {raw => q(xml string)},
    begin_cat: begin of a category                  {begin_cat => ["name", "icon"]},
    end_cat:   end of a category                      {end_cat => undef},
    obgenmenu: generic menu settings                {obgenmenu => ["label", "icon"]},
    exit:      default "Exit" action                     {exit => ["label", "icon"]},

=cut

# NOTE:
#    * Keys and values are case sensitive. Keep all keys lowercase.
#    * ICON can be a either a direct path to an icon or a valid icon name
#    * Category names are case insensitive. (X-XFCE and x_xfce are equivalent)

require "$ENV{HOME}/.config/obmenu-generator/config.pl";

## Text editor
my $editor = $CONFIG->{editor};

our $SCHEMA = [
	{item => ['gmrun', 'Run Program', 'system-run']},
	
	{sep => undef},
	
	{item => ['terminator', 'Terminal', 'terminal']},
	{item => ['x-www-browser', 'Web Browser', 'web-browser']},
	{item => ['thunar', 'File Manager', 'file-manager']},
	{item => ['geany', 'Text Editor', 'text-editor']},
	{item => ['vlc', 'Media Player', 'media-player']},
	
	{sep => undef},
    
    {cat => ['utility',     'Accessories', 'applications-utilities']},
    {cat => ['development', 'Development', 'applications-development']},
    {cat => ['education',   'Education',   'applications-science']},
    {cat => ['game',        'Games',       'applications-games']},
    {cat => ['graphics',    'Graphics',    'applications-graphics']},
    {cat => ['audiovideo',  'Multimedia',  'applications-multimedia']},
    {cat => ['network',     'Network',     'applications-internet']},
    {cat => ['office',      'Office',      'applications-office']},
    {cat => ['other',       'Other',       'applications-other']},
    {cat => ['settings',    'Settings',    'applications-accessories']},
    {cat => ['system',      'System',      'applications-system']},

    #{cat => ['qt',          'QT Applications',    'qt4logo']},
    #{cat => ['gtk',         'GTK Applications',   'gnome-applications']},
    #{cat => ['x_xfce',      'XFCE Applications',  'applications-other']},
    #{cat => ['gnome',       'GNOME Applications', 'gnome-applications']},
    #{cat => ['consoleonly', 'CLI Applications',   'applications-utilities']},

    #                  LABEL          ICON
    #{begin_cat => ['My category',  'cat-icon']},
    #             ... some items ...
    #{end_cat   => undef},

    #            COMMAND     LABEL        ICON
    #{pipe => ['obbrowser', 'Disk', 'drive-harddisk']},

    ## Generic advanced settings
    {sep       => undef},
    
    {obgenmenu => ['Openbox Settings', 'openbox']},
    
    {sep       => undef},
    
    {pipe => ['cb-places-pipemenu', 'Places', 'places']},
    {pipe => ['cb-recent-files-pipemenu', 'Recent Files', 'recent-files']},
    
	{sep => undef},
	
	{item => ['cb-lock', 'Lock Screen', 'lock-screen']},
	{item => ['cb-exit', 'Exit', 'exit']},
]

Would this be something that the #!/Bunsen community is interested in?

Offline

Be excellent to each other!

#2 2015-03-21 07:04:51

pressanykey
Member
Registered: 2013-08-28
Posts: 33

Re: obmenu-generator

^ Nice Job!
Yes - a menu generator every time apps are downloaded and installed would be nice. Or at least whenever update-menu is executed.
I think that's a worthy goal for BunsenLabs. You ought figure out how to package up and incorporate your idea into BunsenLabs. I know most see hand-editing menus as a chore. I went as far as writing a perl script that I executed everytime I installed a new application to update the openbox menu vis static pipe-menus.

Offline

#3 2015-03-21 07:33:57

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: obmenu-generator

Have you looked at Debian menu? There is also the xfce one which works on Crunchbang.

I'm one of those who seriously dislike an auto-updating menu. I like to decide what goes where wink


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#4 2015-03-21 10:58:58

obsolete-hw
New Member
From: UK
Registered: 2015-03-18
Posts: 5
Website

Re: obmenu-generator

damo wrote:

Have you looked at Debian menu? There is also the xfce one which works on Crunchbang.

I'm one of those who seriously dislike an auto-updating menu. I like to decide what goes where wink

I've seen the Debian menu but I don't like how it sorts applications or the fact that it's a submenu. Something I should've mentioned in my original post is that obmenu-generator allows you to generate a static menu or with some editing to schema.pl you can set it up so that you have complete control of the menu.

Offline

#5 2015-03-21 11:06:27

obsolete-hw
New Member
From: UK
Registered: 2015-03-18
Posts: 5
Website

Re: obmenu-generator

pressanykey wrote:

^ Nice Job!
Yes - a menu generator every time apps are downloaded and installed would be nice. Or at least whenever update-menu is executed.
I think that's a worthy goal for BunsenLabs. You ought figure out how to package up and incorporate your idea into BunsenLabs. I know most see hand-editing menus as a chore. I went as far as writing a perl script that I executed everytime I installed a new application to update the openbox menu vis static pipe-menus.

I may look into packaging it as a deb file to make it easy to install. It has the option of generating a static or pipe menu.

From github:

usage: obmenu-generator [options]

Options:
    -p  : (re)generate a pipe menu
    -s  : (re)generate a static menu
    -o  : static menu file (default: ~/.config/openbox/menu.xml)
    -m  : menu id (default: 'root-menu')
    -t  : menu label text (default: "Applications")
    -r  : regenerate the config file
    -i  : use icons in menus
    -d  : regenerate icons.db (with -i)
    -u  : update the config file
    -c  : reconfigure openbox automatically
    -R  : reconfigure openbox now and exit

Help:
    -h  : print this message
    -v  : print the version number

Examples:
   ** Static menu without icons:
        obmenu-generator -s -c

   ** Dynamic menu with icons:
        obmenu-generator -p -i

Offline

#6 2015-03-21 12:00:54

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: obmenu-generator

just my plus one for obmenu-generator.
it's absolutely genious becasue it's:

  • fast as hell despite being

  • dynamically generated

  • configurable (easy once you get used to the syntax. easier than xml, imho).

  • so you can also have static items in there, and submenus and everything

  • icons or not (if you choose icons they are cached so it doesn't slow down too much)

  • it adds its own configuration submenu

see a scrot.
archbang uses this.
it's made by trizen, the same guy who also made (gtk-)youtube-viewer.
i tried a few menu generators for openbox, and this one is by far the best.

Last edited by ohnonot (2015-03-21 12:03:39)

Offline

#7 2015-03-21 13:36:54

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: obmenu-generator

pressanykey wrote:

^ Nice Job!
Yes - a menu generator every time apps are downloaded and installed would be nice. Or at least whenever update-menu is executed.

That's going to be infeasible to implement since a) programs come in all shapes and forms, not only GUI's, and it is impossible to determine which is which since less-used packages' debtags might be incomplete, b) must be invoked with different parameters and c) the Debian menu is good at registering programs in its menu, or rather programs which want a menu entry get one.

Moreover, the menu system is customizable both in structure and content.

For these reasons, I am against using it on a system-level since it duplicates functionality that is already there.


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#8 2015-03-21 20:40:25

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: obmenu-generator

^ good point twoion.

just to explain, obmenu-generator grabs anything it finds in /usr/share/applications and ~/.local/share/applications.
some apps don't show up there by themselves, i had to create/adapt a few .desktop files to my liking.
esp. terminal apps...
debian menu is better in that, but then it's worse in everything else (the terminal app doesn't open when i click the entry. too many submenus).
customizing it to a usable level would indeed be preferable.

then again, i've seen more than one discussion here to continue #! so that it becomes independent from debian.

i think there's even more menu specifications/implementations?
i'm using fbpanel, it has a nice menu with icons and categories, and doen't depend on anything but gtk2. i'm not quite sure where it gets the menu.

Offline

#9 2015-03-21 22:30:12

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: obmenu-generator

^ Menu entries come from the packages themselves at install time. If you've found one that doesn't work as expected, I think you should report the bug to Debian?

Since .desktop files do also need to ship with the packages and not every packages provides one, the labour going into either approach is probably the same smile

I agree though that Bunsen should make sure that desktop files + Debian menu entries for programs it has selected to be the default exist, like the default GTK image viewer.

Last edited by twoion (2015-03-21 22:31:25)


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#10 2015-07-16 22:10:53

heart1010
Member
Registered: 2015-03-13
Posts: 16

Re: obmenu-generator

Sorry... but how should I use this exactly?

I installed the obmenu-generator and did 'obmenu-generator -p -i' and now no right click on desktop is working anymore (no menu pops out)  hmm

edit: Ok, after a reboot I have my obmenu (right click) again. It takes 3 times longer as default bunsen menu without images until the menu opens but I think that's ok because of the icons and my aged laptop, ...?

And how to completly go back to bunsen default implementation?

Last edited by heart1010 (2015-07-17 06:42:49)

Offline

#11 2015-07-17 02:56:24

LabRat
#! CrunchBanger
From: Tornadoville, USA
Registered: 2015-04-20
Posts: 153

Re: obmenu-generator

@heart1010,

Funny, I've not had a single problem such as you've described. Perhaps if you were just a tad more coherent and concise, someone would be happy to help.   smile


Peace

Offline

#12 2015-07-18 08:38:41

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 3,264

Re: obmenu-generator

Meh...I prefer managing the openbox menu manually.


Linux User #586672
Come and Die -- Kyle Idleman

Offline

#13 2015-07-18 09:02:51

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: obmenu-generator

heart1010 wrote:

And how to completly go back to bunsen default implementation?

cp /etc/skel/.config/openbox/menu.xml ~/.config/openbox/menu.xml

Or copy it from here:
https://github.com/BunsenLabs/bunsen-co … x/menu.xml

Offline

#14 2015-07-19 19:02:15

heart1010
Member
Registered: 2015-03-13
Posts: 16

Re: obmenu-generator

Head_on_a_Stick wrote:
heart1010 wrote:

And how to completly go back to bunsen default implementation?

cp /etc/skel/.config/openbox/menu.xml ~/.config/openbox/menu.xml

Or copy it from here:
https://github.com/BunsenLabs/bunsen-co … x/menu.xml

Thanks!

Offline

#15 2015-07-22 06:48:10

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: obmenu-generator

Head_on_a_Stick wrote:
heart1010 wrote:

And how to completly go back to bunsen default implementation?

cp /etc/skel/.config/openbox/menu.xml ~/.config/openbox/menu.xml

...

Just FYI, skel has now moved to /usr/share/bunsen, so that line would be:

cp /usr/share/bunsen/skel/.config/openbox/menu.xml ~/.config/openbox/menu.xml

John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo