You are not logged in.

#1 2013-02-19 12:53:29

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Replacing openbox-menu

In the process of replacing openbox-menu. It works fine but it drags in a lot of deps that really do make it quite bloated. Looking at archlinux-xdg-menu and it does seem to run ok, it does use icons but it is not as pretty as openbox-menu. Need to read up more about it. If anyone uses it let me know.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#2 2013-02-19 22:36:21

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Replacing openbox-menu

I was playing with the different menu choices.  archlinux-xdg-menu appeared to work the best, is in the main repos, is small, and does not appear to have much for dependencies (except perl).

In another thread you mentioned replacing gmrun with dmenu.  The Arch wiki has a dmenu page: https://wiki.archlinux.org/index.php/Dmenu.  At the bottom was a link to the dmenu-launch (AUR) package with a description: A simple Dmenu-based application launcher. Launches binaries and XDG shortcuts.  I wondered if this could be added as the "pipe menu".  I will look into it another day when I get a chance.


Free Software Foundation member 10865

Offline

#3 2013-02-20 02:16:18

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

Seems to work ok but I am not totally happy with it. It uses xterm for terminal applications by default and looks like its hard coded in. Also icons are hit and miss. For the small number of applications we have with ArchBang it might be worth simply creating a default menu. Of course that means I have to be careful not to forget to add something...

Of course I could rework perl script but its a couple of thousand lines long and does not seem worth the effort.

For now I will run with openbox-menu (as its set up)


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#4 2013-02-20 05:51:02

dragonauta
Member
Registered: 2012-05-15
Posts: 313
Website

Re: Replacing openbox-menu

hardcoded terminal?
which one: dmenu or gmrun?

gmrun has a gmrunrc file which can be used to define your terminal application
check /usr/share/gmrun/gmrunrc

Last edited by dragonauta (2013-02-20 06:34:47)


me
"Politicians and diapers need to be changed often ... and for the same reasons."

Offline

#5 2013-02-20 11:57:20

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

Sorry I was talking about archlinux-xdg-menus... uses xterm...


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#6 2013-02-20 22:44:38

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Replacing openbox-menu

I got no where with the dmenu-launch.

For the archlinux-xdg-menus I found there is a pipe menu option.  I updated my menu.xml with the following line:

<menu execute="xdg_menu --format openbox3-pipe --root-menu /etc/xdg/menus/arch-applications.menu" id="xdg-menu" label="Applications"/>

It is a true pipe menu.  It will regenerate each time you pass over it.  So no manually updating the menu or adding a line to the autostart.  Oddly, the icons were better than the version created with update-menus.

I did see how it wanted to make you use xterm.  A poor man's fix would be to ln -s xterm to the terminal of choice.  Then you would need to put xterm in the Ignore group in pacman (otherwise the link will get removed each time xterm is updated).

I noticed even more options in the AUR.  I will check them out as I get time.


Free Software Foundation member 10865

Offline

#7 2013-02-21 01:19:08

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

That is interesting, update-menus has to run as root so could only be run either during boot or with sudo. Will look at xdg_menu options, could hack it to switch to use our terminal (or if it uses $TERM change that). Like you I was not impressed with menu created by update-menus it either had icons or not. Personally I can live without them smile

Would save me a lot of work updating menu with every build plus make it easier for uses to add applications without having to edit menu.

openbox-menu needs gnome-menus which takes up a of valuable space,

Thanks Mike


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#8 2013-02-21 09:12:00

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

Seems to work ok other than the fact icons are stock ones rather than our installed Awoken (that does not seem to be an issue)... If we could remove icons might give a cleaner look.... Something I will look at.

EDIT wonder if its possible to 'sed' out the icon="..." ???? could then wrap it in a script.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#9 2013-02-21 22:36:01

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Replacing openbox-menu

I was playing with uxdgmenu-git in the AUR tonight.  It looked promising as there is a config file that you can set the filemanger, terminal, icon set, icon size, etc.  The PKGBUILD requires pyxdg package, which I can't find.  I did find a python-xdg package, so I downloaded the PKGBUILD and modified it.  But still got an error when I ran the program.  It wanted a python module that could not be found.  I did not look into it anymore (been up to late too many nights in a row).


Free Software Foundation member 10865

Offline

#10 2013-02-22 03:18:34

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

If I had the time I would write my own, problem with uxd is it drags in python. If you were running multiple desktops then yes it would be ideal and does seem highly configurable. Did have a go at building it but got the same problem. Post install would be great for gui lovers. Have been hacking archlinux-xdg-menu to get it work with our terminal.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#11 2013-02-22 04:22:08

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

obmenugen works highly configurable but again a little over the top for our needs. Not keen on menu look either mix of menu-headers and pipes...


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#12 2013-02-22 09:49:05

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

Is it possible to remove a patch?

https://bugs.archlinux.org/task/32205

Managed to do a dirty hack on script to remove icons, would be nice to have an option


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#13 2013-02-22 10:10:08

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: Replacing openbox-menu

patch -R (I think)

probably easier to install via ABS and not apply it to begin with though

Offline

#14 2013-02-22 10:18:47

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

I might just create our own version icon free with our default terminal.. think patch was added in as an update to allow icons to be displayed. Anything that gets rid of gnome-menus is good!!!


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#15 2013-02-22 23:45:57

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Replacing openbox-menu

This xterm thing is really starting to irritate me.  I like the archlinux-xdg-menu pipe-menu option but can not get rid of xterm.  When I boot to the command line and check for TERM, I get:

set | grep TERM
TERM=linux

but after startx I get TERM=xterm.  So something in starting X or Openbox is setting this.  I looked around and could not find it.  I thought I would try to set it to another terminal.  Openbox has a ~/.config/openbox/environment file.  I tried adding TERM= to that file, no change.  I tried changing in in autostart, no change.  I even added a line in .xinitrc, still no change.  Finally I found where the cache for xdg_menu was (~/.xdg_menu_cache).  Deleted that directory.  Exported TERM= and then let it rebuild the pipe-menu.  It was still requiring xterm for a program like HTOP.  I then tried creating an alias called xterm that was really my terminal of choice, but that only worked within a terminal (I need to learn more about bash).

So in the end I uninstalled xterm (not required by anything) and ran:

sudo ln -s /usr/bin/terminator /usr/bin/xterm

Now everything that wants to run in xterm goes to terminator.

I also was playing with the icons.  I commented out my <showIcons>yes</showIcons> line in rc.xml.  Even after deleting the cache folder and rebooting, it was still putting in icons.  But I am ok with the icons, so I am going to live with it.  At least I am away from AUR packages and gnome-menus.


Free Software Foundation member 10865

Offline

#16 2013-02-23 03:14:50

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

@mike4ca I used sed to replace xterm with xfce4-terminal

sed -i 's|xterm|xfce4-terminal|g' /usr/bin/xdg_menu

Icons I can remore them by editing a couple of lines look for :

my $menu_icon

and edit it too:

my $menu_icon = "";

Clear cache good to go, a patch for script (if i knew perl!) would simply either use $TERM or add in a command line option.

Will hack something together for next release .... only worry is if I should ship with a custom version to overcome any future update issues?


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#17 2013-02-23 21:52:21

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Replacing openbox-menu

I found obmenu-generator in the AUR here: https://aur.archlinux.org/packages/obmenu-generator/.  It uses perl, the author of the app is the AUR package maintainer (also maintains another AUR dependency), can be run with or without icons, can specify the icon set (did not play with myself), you can specify the editor and terminal, has well documented config file, can be run as a static menu or pipe, etc.

It completely takes over your menu.xml (at least in my short trial tonight).  There is a schema file for adjusting what you want and where, so there is no reason for obmenu package anymore.

I was generally a pipe-menu fan as I did not like having to add an item after installing a new package, but the menu has an item for regenerating the static menu that is quick and easy.

I haven't figured out how to add a Places or Recent Files pipemenu (yet), but I don't use those a lot.Upon closer reading of the schema file's help, you can enter any valid Openbox xml string (i.e., pipemenu).  For example, the schema.pl file would have a line like

{raw => q(<menu execute="~/.config/openbox/pipemenus/obpipemenu-places ~/" id="places" label="Places"/>)},

for the places pipemenu.

Last edited by mike4ca (2013-02-23 22:31:41)


Free Software Foundation member 10865

Offline

#18 2013-02-24 01:56:49

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

@mike4ca I did try it and it does wipe over menu.xml, was not that keen on layout. Maybe config will allow an applications only pipe menu and then it would be perfect. Do not like the idea of having to hack archlinux-xdg-menu due to future upgrade problems. Will have to do some reading up ....


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#19 2013-02-24 04:03:27

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

Looking at 'obmenu-generator -p' (pipe-menu) do not want to write over my menu.xml again smile need to put then generated pipe menu somewhere... and then use it in our menu.xml. Icons option works but it does slow down generation of menu so for live use i am going to say no icons.

Only problem I can see is that it wipes over menu.xml completely....?


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#20 2013-02-24 12:37:16

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Replacing openbox-menu

I played with obmenu-generator some more.  To move the application categories to an Applications menu from the root menu change the schema.pl file like:

original file (only part is shown):
    {sep => 'Applications'},

    #          NAME            LABEL                ICON
    {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 => ['settings',    'Settings',    'applications-accessories']},
    {cat => ['system',      'System',      'applications-system']},
	
Changed portion of file:
    {sep => undef},
    {raw => q(<menu id="Applications" label="Applications">)},
    #          NAME            LABEL                ICON
    {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 => ['settings',    'Settings',    'applications-accessories']},
    {cat => ['system',      'System',      'applications-system']},
    {raw => q(</menu>)},

Move the separators around or delete per your taste.  After changing the file, regenerate the static menu and reconfigure Openbox to take the new static menu.

To use only as a pipemenu within your static menu, add this line to your menu.xml:

<menu execute="/usr/bin/obmenu-generator -i" id="desktop-app-menu" label="Applications"/>

Don't include the -p as I think that option is used to change your menu.xml to have the one line that makes the whole menu a pipemenu. You would want to change the schema.pl file to only have the category lines (comment out the other lines with #).  The -i flag is optional for icons.  More help is available on the command line

obmenu-generator -h

Free Software Foundation member 10865

Offline

#21 2013-02-24 14:32:04

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

I was using '-p' and it wiped menu.xml. Want to get a more ArchBang feel to menu. Adding icons does slow it done but unlike other brands does use our icon set.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#22 2013-02-25 01:08:05

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

Added to ArchBang iso build so will start testing. Thanks mike4ca wink

EDIT: Works ok have included icons, one thing that does bother me is preferred applications. As File Manager is not set you get a dialog if you try to open it. Not sure how to get around that one. For now I will build and test then upload for others to test in next few days.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#23 2013-02-26 01:44:01

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

Think we might need to edit menu.xml output from obmenu-generator with

sed -i '/exo-open/d' <obmenu-generator output>.xml

Gets rid of preferred applications dialog. Might ask developer about that in the near future.

EDIT ignore me mike4ca I was testing on my own desktop, under iso live its all fine smile


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#24 2013-02-27 21:31:33

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Replacing openbox-menu

If you want to add a little ArchBang flair to the menu add a separator at the top of the schema.pl file.

[user@archbang ~]$ our $SCHEMA = [
	{sep => 'ArchBang'},
    #             COMMAND                 LABEL                ICON
    {item => ['spacefm',             'File Manager',      'file-manager']},

Really don't need a separator at the top, but it adds a nice touch to the top of the menu.  If using a static menu it looks like this in the menu.xml

<separator label="ArchBang"/>

Free Software Foundation member 10865

Offline

#25 2013-02-27 23:37:31

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: Replacing openbox-menu

mike4ca wrote:

If you want to add a little ArchBang flair

ArchBang should be required to have 15 pieces of flair



(sorry, can't resist)

Offline

#26 2013-02-28 00:43:52

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Replacing openbox-menu

@ mike4ca This is the schema.pl that is shipped with ArchBang

#!/usr/bin/perl

# SCHEMA supports the following keys: item, cat, begin_cat, end_cat,
#                                     exit, raw, sep, obgenmenu

=for comment

item: add an item into the menu
{item => ["command", "label", "icon"]}

cat: add a category into the menu
{cat => ["name", "label", "icon"]}

begin_cat: begin of a category
{begin_cat => ["name", "icon"]}

end_cat: end of a category
{end_cat => undef}

sep: menu line separator
{sep => undef} or {sep => "label"}

exit: default "Exit" action
{exit => ["label", "icon"]}

raw: any valid Openbox XML string
{raw => q(xml string)},

obgenmenu: category provided by obmenu-generator
{obgenmenu => "label"}

scripts: executable scripts from a directory
{scripts => ["/my/dir", BOOL, "icon"]}
BOOL - can be either true or false (1 or 0)
0 == open the script in background
1 == open the script in a new terminal

wine_apps: windows applications installed via wine
{wine_apps => ["label", "icon"]}

=cut

# NOTE:
#    * Keys and values are case sensitive. Keep all keys lowercase.
#    * ICON can be a either a direct path to a icon or a valid icon name
#    * By default, category names are case insensitive. (e.g.: X-XFCE == x_xfce)

require '/home/mrgreen/.config/obmenu-generator/config.pl';

our $SCHEMA = [
    #             COMMAND                 LABEL                ICON
   # {item => ['spacefm',             'File Manager',      'file-manager']},
   # {item => [$CONFIG->{terminal},   'Terminal',          'terminal']},
   # {item => [$CONFIG->{editor},     'Editor',            'text-editor']},
   # {item => ['firefox',       'Web Browser',       'web-browser']},
   # {item => ['gmrun',               'Run command',       'system-run']},
   # {item => ['pidgin',              'Instant messaging', 'system-users']},

   # {sep => 'Applications'},

    #          NAME            LABEL                ICON
    {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 => ['settings',    'Settings',    'applications-accessories']},
    {cat => ['system',      'System',      'applications-system']},

    #{cat => ['qt',          'QT Applications',    'qtlogo']},
#    {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},

    #                  LABEL             ICON
    #{wine_apps => ['Wine apps', 'applications-other']},

    #                DIR     BOOL       ICON
    #{scripts => ['/my/path', 1,  'text-x-script']},

   # {obgenmenu => 'Openbox Settings'},
   # {sep       => undef},

   # {item => ['xscreensaver-command -lock', 'Lock', 'lock']},

    # This options uses the default OpenBox action "Exit"
   # {exit => ['Exit', 'exit']}
]

Made it more like old openbox-menu menu,

Gave up flares in the 70's....


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

Board footer

Powered by FluxBB