You are not logged in.

#1 2016-10-13 17:18:03

malm
jgmenu developer
Registered: 2016-10-13
Posts: 228
Website

jgmenu

I've written a small, standalone X11 menu application. I'm posting this here
in the hope that you would wish to try it with your openbox+tint2 setup.

It provides a "conventional start menu" without using xdotool hacks with the
openbox menu.

It uses cairo/pango, so can easily be aligned with your tint2 configuration.

It's written from scratch and has a pretty small code base.

It's free from toolkits such as GTK and Qt (although I'm temporarily using
the gtk+-3.0 library to convert xpm icons to cairo_surfaces).

The jgmenu binary reads "menu items" from stdin in a similar way to dmenu and
dzen2, but  with seperate fields for the name and command. There are a number
of wrappers to generate XDG type menus, etc.

If you're interested in checking it out, have a look at:

https://github.com/johanmalm/jgmenu

There is a screenshot in the README.md

Offline

#2 2016-10-13 17:41:15

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: jgmenu

This is awesome, thank you smile

In case you're interested, it compiles & runs under Alpine Linux and pops up in my dwm desktop:

2016-10-13-184039_1280x800_scrot.th.png


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#3 2016-10-13 18:45:40

ututo
Member
Registered: 2015-09-29
Posts: 253

Re: jgmenu

This is great! I'll give it a try asap!


BunsenLabs en Español
BunsenLabs on deviantArt

Offline

#4 2016-10-13 19:30:14

malm
jgmenu developer
Registered: 2016-10-13
Posts: 228
Website

Re: jgmenu

Head_on_a_Stick - thank you. Yes of course I'm interested.
I'm glad it compiled and ran fine.
Does the window positioning work in dwm? I.e. did you set menu_valign=top or did the window default to top+left?

Offline

#5 2016-10-13 19:35:57

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: jgmenu

malm wrote:

Does the window positioning work in dwm? I.e. did you set menu_valign=top or did the window default to top+left?

It works very well indeed, exactly as specified in ~/.config/jgmenu/jgmenurc

menu_margin_x     = 0
menu_margin_y     = 20
menu_width        = 200
menu_radius       = 1
menu_border       = 0

#
# valid options for menu alignment are:
#   - horizontal: left, right
#   - vertical:   top, bottom
#
menu_halign       = left
menu_valign       = top

item_margin_x     = 3
item_margin_y     = 3
item_height       = 25
item_padding_x    = 4
item_radius       = 1
item_border       = 0

max_items         = 80
min_items         = 0
font              = Liberation Sans 10
icon_size         = 22
icon_theme        = Moka
ignore_xsettings  = 0
ignore_icon_cache = 0
show_title        = 0

color_menu_bg     = #002b36 100
color_menu_fg     = #93a1a1 100
color_norm_bg     = #002a36 100
color_norm_fg     = #93a1a1 100
color_sel_bg      = #2aa198 100
color_sel_fg      = #000000 100
color_noprog_fg   = #eeeeee 100
color_title_bg    = #ffffff 20

smile


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#6 2016-10-13 20:24:23

damo
....moderator....
Registered: 2015-08-20
Posts: 4,385

Re: jgmenu

Compiles and runs on Mint Sarah + OB +Tint2 (well it did, once I installed a missing -dev package  monkey  )

I still prefer the Openbox menu, but I will swap out the MintMenu for jgmenu, and see how that goes.

Great work smile


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#7 2016-10-14 02:03:41

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

Re: jgmenu

@malm thank you for this! I would like to try it out, but hit a problem compiling. After running 'make' once and checking the "missing package" errors I installed:

libcairo2-dev libpango1.0-dev librsvg2-dev libgtk-3-dev libxml2-dev

That got rid of most of the error messages, but this remained:

john@bunsen1:/data/john/downloads/jgmenu-master$ make
     CC    xsettings.o
xsettings.c: In function ‘parse_settings’:
xsettings.c:141:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
  for (size_t i = 0; i < n_entries; i++) {
  ^
xsettings.c:141:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
xsettings.c: In function ‘free_xsettings’:
xsettings.c:214:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
  for (size_t i = 0; i < count; i++) {
  ^
Makefile:58: recipe for target 'xsettings.o' failed
make: *** [xsettings.o] Error 1

This looked pretty much like a failure so I didn't proceed to 'make install' (in fact I was planning to use checkinstall).

@malm do you have any advice?

@others did no-one else get this error message? (I downloaded from GitHub about 1/2 hr ago.)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#8 2016-10-14 02:08:09

damo
....moderator....
Registered: 2015-08-20
Posts: 4,385

Re: jgmenu

^ I didn't get that error; and I only needed to install 'libxml2-dev'

D/l and compiled about 6 hrs ago

I got a warning on first run though...

$ jgmenu_run pmenu
warning: value must be > 0; value='0'; key='min_items'

Last edited by damo (2016-10-14 02:11:01)


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#9 2016-10-14 05:25:33

malm
jgmenu developer
Registered: 2016-10-13
Posts: 228
Website

Re: jgmenu

johnraff: I have pushed a fix for the errors in xsettings.c
In ANSI C (C89), variables have to be declared at the start of a block.
The "size_t i" bit was written in C99/C++ style. Let me know if it still doesn't compile.

Offline

#10 2016-10-14 05:43:31

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

Re: jgmenu

Hi malm. I'm still getting an error, but in a different function this time:

john@bunsen1:/data/john/downloads/jgmenu-master$ make
     CC    x11-ui.o
     CC    config.o
     CC    util.o
     CC    geometry.o
     CC    isprog.o
     CC    sbuf.o
     CC    icon-find.o
     CC    icon.o
     CC    xdgdirs.o
     CC    xdgapps.o
     CC    xsettings.o
     CC    xsettings-helper.o
xsettings-helper.c: In function ‘print_settings’:
xsettings-helper.c:32:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
  for (size_t i = 0; i < count; i++) {
  ^
xsettings-helper.c:32:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
Makefile:58: recipe for target 'xsettings-helper.o' failed
make: *** [xsettings-helper.o] Error 1

EDIT: This is on BunsenLabs Hydrogen (Debian Jessie).

Last edited by johnraff (2016-10-14 07:15:41)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#11 2016-10-14 06:32:27

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: jgmenu

johnraff wrote:

@others did no-one else get this error message?

No errors for me once the dependencies were satisfied but Alpine Linux uses musl rather than the GNU libc and I'm tracking the edge branch, which keeps pace with my Arch [testing] system in respect of package versions.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#12 2016-10-14 10:46:04

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 396
Website

Re: jgmenu

Just pitching in. I've been discussing with Johan since June about his project, and over all this time it was a pleasure to interact with him.

I was trying to find a simple start menu implementation that is not coupled to any existing Desktop Environment and does not come with heavy dependencies. This is because many users have asked in the past for a start menu in tint2, so that they can use the panel in WMs that do not provide one. jgmenu looks like a perfect candidate. It's simple, lightweight and themable.

I'm thinking about adding a start button to tint2, which can be configured to run jgmenu, the openbox menu or any other menu the user wishes. (I know it can be done with launchers, but it's a bit complicated, the user needs to write a custom desktop file; also one might want to place the start button separate from the launchers). I think this would make all users happy, regardless of the menu they prefer to use.

So please take a look at jgmenu if you have time, and offer feedback, I'm very curious to see what you think.

Offline

#13 2016-10-14 16:36:44

ohnonot
...again
Registered: 2015-09-29
Posts: 3,198
Website

Re: jgmenu

i really like the looks & sound of this.
do i understand correctly that you strive to get rid of all gtk (or any toolkit) dependencies, but haven't yet?
i tried the AUR package, and as you yourself pointed out i complains about some gtk3 stuff not being found.
can i expect this to change soon? because i really do not have any gtk3 on my system.

Offline

#14 2016-10-14 17:30:42

damo
....moderator....
Registered: 2015-08-20
Posts: 4,385

Re: jgmenu

ohnonot wrote:

... complains about some gtk3 stuff not being found....

I got complaints about gtk (gtk is installed), but they went away once I had installed 'libxml2-dev'.


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#15 2016-10-15 14:53:05

malm
jgmenu developer
Registered: 2016-10-13
Posts: 228
Website

Re: jgmenu

Thanks for all the feedback.

damo - the warning you got regarding "min_items" is a complaint that "min_items" in your jgmenurc config file is not greater than zero. That's my fault for doing "min_items=0" in example jgmenurc. I have now changed it.
"min_items" is the minimum menu height expressed in items, so this config option only has an affect if it's greater than the actual number of items in the menu.

johnraff - I should have looked a bit further when I changed xsettings.c. I've made the same change to xsettings-helper.c. Let me know if you still have a problem compiling.

ohnonot - yes. The only gtk dependency is in "icon.c" for the get_xpm_icon() function. I will get rid of it, just haven't figured out how yet. @o9000 have got a few ideas, so between us I'm sure we'll get there. Rest assured, the "#include <gtk/gtk.h>" in icon.c will disappear!
I have added gtk3 to the AUR package for the time being.

Offline

#16 2016-10-15 16:10:03

malm
jgmenu developer
Registered: 2016-10-13
Posts: 228
Website

Re: jgmenu

Like passing ships at night. @o9000 has just sorted an xpm-loader. Thanks Ovidiu, you're a genius.
The gtk dependency is gone.

Offline

#17 2016-10-15 17:02:50

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 396
Website

Re: jgmenu

It was not hard, I've just ported the GDK implementation, stripped of all the glib stuff smile

By the way, I propose we all share a moment of silence in gratitude to the GTK developer who wrote this sad comment in 1999: https://github.com/GNOME/gdk-pixbuf/blo … -xpm.c#L39

Offline

#18 2016-10-15 19:13:19

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,596

Re: jgmenu

Is there a search/filter integrated?

Online

#19 2016-10-15 20:13:59

malm
jgmenu developer
Registered: 2016-10-13
Posts: 228
Website

Re: jgmenu

@brontosaurusrex - No, but we should be able to get there. Maybe similar to dmenu?

Offline

#20 2016-10-15 20:28:08

ohnonot
...again
Registered: 2015-09-29
Posts: 3,198
Website

Re: jgmenu

malm wrote:

Like passing ships at night. @o9000 has just sorted an xpm-loader. Thanks Ovidiu, you're a genius.
The gtk dependency is gone.

awesome. now i can play.
kiss

Offline

#21 2016-10-16 00:02:43

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: jgmenu

Just a quick update to note that the package compiles under OpenBSD-current and will actually run if a dodgy symlink is made:

# ln -s /usr/local/bin/python2.7 /usr/bin/python2

Unfortunately, the applications are managed differently in that OS so they all show up in "Other":
2016_10_16_005310_1280x800_scrot.png
All ports are stored under /usr/local/share/applications and the base system does not have /usr/share/applications at all.

All of my GUI programs show up in the menu smile

I don't have a full icon set installed, hence the patchy coverage lol


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#22 2016-10-16 10:00:10

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 396
Website

Re: jgmenu

HoaS, I don't have any OpenBSD system to test this, but I think that installing the package gnome-menus might make it work. Those are some files that describe the application categories (name, icon).

@malm, I think we should add this to the list of dependencies. I think gnome-menus is available on all distributions. If not, we can find another solution.

Offline

#23 2016-10-16 10:43:28

mrneilypops
The BL Scrot.Moe Guy
From: luxembourg
Registered: 2015-09-30
Posts: 511
Website

Re: jgmenu

Looks great!
Might try this on dwmX...

Offline

#24 2016-10-16 11:45:29

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: jgmenu

o9000 wrote:

I think that installing the package gnome-menus might make it work

Unfortunately, that package is not in the ports tree:

http://openports.se/search.php?so=gnome-menu

As I said, I think it's just the use of /usr/share/local/applications for the .desktop files that is causing them to be added under "Other" rather than under the main categories.

I will have a look and see if I can port it to OpenBSD properly without that hideous symlink hack.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#25 2016-10-16 11:58:53

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 396
Website

Offline

Board footer

Powered by FluxBB