You are not logged in.

#1 2016-12-10 12:57:04

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

This is a step-by-step guide for implementing jgmenu in tint2 or plank on bunsenlabs. jgmenu is a standalone X11 menu application. It provides a conventional launcher/start menu for openbox and tint2 with some hackable features (size, position, color, transparency, etc.). As you can read in the jgmenu thread, this brilliant application was created by forum member malm (thank you for the help with installing the menu) and also forum member Ovi (o9000) contributed a lot to jgmenu, not just code, but guidance and advice. On tint2 the menu looks like this:

MenuScreenshot.md.png

Installation steps:

A. It's possible to use the package from the backports:

sudo apt install jgmenu


B. Using the source code from github:

1. Create a directory called src and cd into it:

mkdir ~/src && cd ~/src

2. Clone the codebase

git clone https://github.com/johanmalm/jgmenu.git

This command did not work for me as it gave me an error message: "gnutls_handshake() failed: Public key signature verification has failed." Therefore I downloaded the zip file from the following site and extracted it:
https://github.com/johanmalm/jgmenu

3. Cd to the directory where the files from the zip archive were extracted and run the following command to install the required packages

./scripts/install-debian-dependencies.sh

On my system the dependencies were altogether around 40 MB (50 packages).

4. In the same folder (where the data from the zip file ended up) run the following command (without needing sudo or root privileges):

make

You should get something similar:

     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    xpm-loader.o
     CC    xdgdirs.o
     CC    xdgapps.o
     CC    xsettings.o
     CC    xsettings-helper.o
     CC    config-xs.o
     CC    filter.o
     CC    compat.o
     CC    jgmenu.o
     LINK  jgmenu
     CC    jgmenu-parse-xdg.o
     LINK  jgmenu-parse-xdg
     CC    jgmenu-icon-find.o
     LINK  jgmenu-icon-find
     CC    jgmenu-xsettings.o
     LINK  jgmenu-xsettings

5. The following command - without needing sudo or root - will install files to /home/username/bin (if you want to have a different target location e.g. /usr/bin, use PREFIX like “sudo make prefix=/usr install”):

make install

6. Create a jgmenu directory 

mkdir ~/.config/jgmenu

7. The extracted zip file created a folder called "docs". From this folder copy the file jgmenurc into the previously created ~/.config/jgmenu directory. When you open "jgmenurc" in ~/.config/jgmenu with an editor, you can configure different features of the menu like size, alignment, launch at pointer position, etc.

8. Check if a menu package is already installed. If not (the menu won't start properly after jgmenu_run, it might only show one single entry), let's install such a package

sudo apt-get install lxmenu-data

9. In the folder /home/username/.local/share/applications there is a jgmenu.desktop file. You can drag-and-drop this file to Plank in order to get a start icon in the dock.

10. For having a #bĺ jgmenu-launcher icon in tint2 open tint2rc in: openbox-menu/Preferences/Tint2/Edit Tint2s/Default tint2rc. Paste the following code in the file and save it:

launcher_item_app = /home/username/.local/share/applications/jgmenu.desktop

The full path is not necessary on newer tint2 versions, only "jgmenu.desktop" works fine (on 0.11 it only works if the path is defined). After “Restart tint2” from the openbox-menu (same place as above) the BunsenLabs-logo should appear in tint2 as a menu-launcher.

11. If you want to customize the menu, open "jgmenurc" in /home/username/.config/jgmenu. You can change the menu size, let the menu launch at pointer position (at_pointer=1), change transparency, etc. There is also a search-feature, after opening the menu just start typing. After changing jgmenurc open the menu and press F10 to close it -> after opening it again the changes should be implemented. The menu also launches at the terminal command:

jgmenu_run

(For earlier versions it was "jgmenu_run pmenu").

If it does not work, check whether /home/username/bin is in the path:

echo $PATH

12. In order to configure a keybinding for opening the menu go to: openbox-menu/Display Keybindings/Backup and Edit rc.xml. After opening the rc file in an editor paste the following code at an appropriate place (e.g. for me it was line 355-363):
 

  <keybind key="W-y">
      <action name="Execute">
        <startupnotify>
          <enabled>false</enabled>
          <name>Start Menu</name>
        </startupnotify>
        <command>jgmenu_run</command>
      </action>
    </keybind>

Save the file and go to openbox-menu/Preferences/Openbox/Restart. After a restart the binding should work. In the code above “W-y” means “pressing super key (also known as windows key [brrr])+y”, but you can choose whatever combination you like.

13. It is possible to make the menu appear without clicking just by pulling the mouse cursor to the upper left/right corner (with the help of bl-hotcorners you can also configure a different corner).

First make the bl-hotcorners-daemon autostart by pasting the following code in /home/username/.config/openbox/autostart (e.g. before starting xscreensaver)

## Start bl-hotcorners
bl-hotcorners --daemon &

14. Second create a /home/username/config/bl-hotcorners/bl-hotcornersrc with the following content:

[Hot Corners]
top_left_corner_command = jgmenu_run

After an openbox-restart the feature should be available.

When the daemon is already running, other corners for further features can be configured the same way.

15. The manual is available via “man jgmenu“ and “man jgmenu_run".

16. For Installing new versions use

git pull
make clean
make
make install

Without much tweaking with vertical tint2 the menu looks like this (very easy to implement in tint2 or Plank):

jgmenu.th.png

Edit: Corrected some details according to the remarks from j. malm and Ovi (o9000) - thank you for them! Also the steps for bl-hotcorners were added. 21.01.17: Corrected step five.  25.01.17: Added step 15 for installing the latest version. 25.02.2017: Changes after ver. 0.45 implemented (jgmenu_run without pmenu). 30.06.2017: Steps for installation updated, inserted second picture.

Last edited by martix (2017-11-02 20:41:41)

Offline

#2 2016-12-11 10:11:12

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

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

Thank you.

Regarding the svg icon, the tint2 from the backports repository should support it, so no png conversion is needed.

It would also be great if the icon theme was patched so that distributor-logo pointed to the correct file in the first place.

Last edited by o9000 (2016-12-11 10:11:40)

Offline

#3 2016-12-11 17:34:39

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

@o9000 All credit goes to your work and j. malm - without you there would be no guide  smile  I hope the steps are complete, maybe someone will try them and comment on it.

While using the bl-hotcorners I found  - while starting the menu - there is just a bit too much delay and bl-hotcorners kind of "kicks back" the cursor. Otherwise the menu is lightning fast, bl-hotcorners might need a little tweaking.

Last edited by martix (2016-12-11 22:46:02)

Offline

#4 2016-12-11 20:01:56

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

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

Martix

Thanks for all your work. Just a couple of thoughts.

For me, it works to just add the following to my tint2rc (i.e. without the full path)

launcher_item_app = jgmenu.desktop

I generally use o9000's tint2 master branch, but have tried the v0.12.12 (from Arch) and it works with that that too.

Regarding your comments regarding the menu being slow with the bl-hotcorners daemon. Do you get a difference in speed betweeen "jgmenu_run pmenu" and "jgmenu_run csv"? I.e. is it quicker if you do:

jgmenu_run parse-pmenu >~/pmenu-cache.csv
cat ~/pmenu-cache.csv | jgmenu

On my anchient machine, I do notice a delay whenever a python script is involved (such as pmenu).

In paragraph 10, the jgmenurc variable is "at_pointer" with an underscore. (The command line options is --at-pointer).

It might be worth suggesting that it's "safer" to download the latest release (or checkout the last tagged version) rather than the "master" branch.

P.S. Ovi (o9000) has contributed a lot to jgmenu too. Not just code, but guidance and advice.

Last edited by malm (2016-12-11 20:03:47)

Offline

#5 2016-12-12 00:08:04

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

malm wrote:

Regarding your comments regarding the menu being slow with the bl-hotcorners daemon. Do you get a difference in speed betweeen "jgmenu_run pmenu" and "jgmenu_run csv"?

First thank you for the remarks, tried to implement them in the OP. Tried jgmenu.desktop and with tint2 version 0.11 it only works with the full path.

As for the delay: It did not make any difference with csv, the menu itself is lightning fast. I tried to tweak the bl-hotcorners script, reduced check_intervall and I'm still trying to get rid of the mouse cursor jump-back. So basically it's a bl-hotcorners issue, I'm not sure how to make it to work as smooth as e.g. plank auto-hide. However you just pointed out a new brilliant feature of jgmenu:

Let's say someone has a basic jgmenu (jgmenurc) configuration, just like on the picture above. This user might also be a multimedia-guy with all kinds of players, music and video tools, which are not configured in plank or openbox (not to make them too cluttered).

In this case, to start something via menu-click it would be helpful to have a special menu only for the multimedia-stuff. This is where someone could configure a default.csv for multimedia only and instead of a click on the icon it could start a different way, e.g. via keybinding or hotcorner. I tried it already, put default.csv in /.config/jgmenu and changed bl-hotcornersrc to “jgmenu_run csv”. Works like a charm – on click comes the jgmenurc-menu, on hotcorner the default.csv-menu. I'm not sure though whether this setup would lead to some issues with the menu.

Offline

#6 2016-12-12 03:43:43

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,654
Website

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

o9000 wrote:

It would also be great if the icon theme was patched so that distributor-logo pointed to the correct file in the first place.

What's the problem here? On my system distributor-logo-bunsenlabs brings up the right icon. I don't know why the original icon theme developer chose to make distributor-logo point to Ubuntu's logo, but do we need to change that? (start-here has been patched already)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#7 2016-12-12 10:22:45

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

^If I have start-here.png in /home/username/.local/share/applications/jgmenu.desktop, I get an Ubuntu logo on red background in plank, on grey background in tint2. distributor-logo-bunsenlabs shows me the nice flame-logo in plank and a gear on grey background in tint2 (I have Faenza Dark icon theme). An easy solution though to use the full path to whatever icon I'd like to have in plank or tint2.

Offline

#8 2016-12-13 08:32:21

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,654
Website

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

Ah yes, I forgot, the start-here fix has been committed to a git branch that hasn't yet been released in the bunsen-faenza-icon-theme package. It should arrive soonish, so 'start-here' will bring up the same BL icon as 'distributor-logo-bunsenlabs'.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#9 2016-12-13 12:26:36

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

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

johnraff wrote:
o9000 wrote:

It would also be great if the icon theme was patched so that distributor-logo pointed to the correct file in the first place.

What's the problem here? On my system distributor-logo-bunsenlabs brings up the right icon. I don't know why the original icon theme developer chose to make distributor-logo point to Ubuntu's logo, but do we need to change that? (start-here has been patched already)

IMHO yes. I think distributor-logo and start-here should be consistent, and point to the Bunsenlabs icon.

See for example what Arch does:

https://git.archlinux.org/svntogit/comm … icon-theme

Last edited by o9000 (2016-12-13 12:35:05)

Offline

#10 2016-12-14 02:29:49

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,654
Website

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

OK I'll have a look - maybe we can add it to the "deuterium" point release.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#11 2017-01-09 06:18:54

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,654
Website

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

o9000 wrote:

I think distributor-logo and start-here should be consistent, and point to the Bunsenlabs icon.

distributor-logo icons are now symlinks to distributor-logo-bunsenlabs. Pushed to bunsen-faenza-icon-theme, deuterium branch.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#12 2017-01-09 10:25:02

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

Re: How to implement a Start Menu (jgmenu) in tint2 or Plank on #BĹ

Thank you!

Offline

Board footer

Powered by FluxBB