You are not logged in.

#26 2016-10-16 12:01:46

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

Re: jgmenu

^ Ah yes, thanks -- that does indeed fix it, well done sir!

smile


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

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

Offline

#27 2016-10-16 13:11:20

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

Re: jgmenu

Would
#!/usr/bin/env python
solve it?

Offline

#28 2016-10-16 15:36:49

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

Re: jgmenu

I think so. We just need to make sure the script works in both python 2 and 3.

Offline

#29 2016-10-16 15:45:09

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

Re: jgmenu

o9000 wrote:

I think so. We just need to make sure the script works in both python 2 and 3.

I did try it with python3 a while ago and think it worked fine. I'll double check and then change it when I'm next on a computer.

Offline

#30 2016-10-16 16:01:26

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

Re: jgmenu

malm wrote:

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

If you are open to suggestions I will meditate on this.

Offline

#31 2016-10-16 17:14:57

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

Re: jgmenu

malm wrote:

Would
#!/usr/bin/env python
solve it?

Well, the only instance of "python" I can find is in jgmenu-parse-pmenu.py and if I change the shebang at the top to:

#!/usr/bin/env python

It still fails with:

env: python: No such file or directory

However, this works:

#!/usr/local/bin/python2.7

With that shebang the dodgy symlink is no longer needed and with x11/gnome/menus installed everything works exactly as expected:

2016_10_16_181045_1280x800_scrot.png

cool

cwm(1) pictured, btw smile


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

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

Offline

#32 2016-10-16 17:30:14

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 867
Website

Re: jgmenu

Very nice. If will be part of tint2 menu will be huge. Thanks both of you for your active work.


Nothing beats peace and quiet. - Tomoki Sakurai

Offline

#33 2016-10-16 17:45:58

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

Re: jgmenu

Looks like other people have hit similar problems with the shebang being different on various distributions: https://bugzilla.mozilla.org/show_bug.cgi?id=957721

Offline

#34 2016-10-16 19:42:29

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

Re: jgmenu

Head_on_a_Stick wrote:

However, this works:

#!/usr/local/bin/python2.7

Yes, jgmenu-parse-pmenu.py is the only python file.

Could we use

#!/usr/bin/env python3

Would that work on OpenBSD?

Offline

#35 2016-10-16 19:44:58

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

Re: jgmenu

brontosaurusrex wrote:

If you are open to suggestions I will meditate on this.

Yes - very open to suggestions.

Offline

#36 2016-10-16 19:55:55

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

Re: jgmenu

malm wrote:

Could we use

#!/usr/bin/env python3

Would that work on OpenBSD?

Sadly not:

env: python3: No such file or directory

sad

Last edited by Head_on_a_Stick (2016-10-16 21:54:51)


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

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

Offline

#37 2016-10-17 14:53:48

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

Re: jgmenu

malm wrote:
brontosaurusrex wrote:

If you are open to suggestions I will meditate on this.

Yes - very open to suggestions.

Things "I have" so far:
- must be fast
- not sure about gui (But pretty sure I don't want to see search box by deafult, perhaps it materializes only when user starts typing)
thatPerfectMenu.png
- filter is locked (must also survive restart unless command line filter is isued) until manually removed (escape or delete or something) < This is different than most search stuff does but I'am using this in certain php script for a decade now, so tested.
- understand tree structure to some point (if I search for "graphics*")
- can be started with filter (jgmenu --filter "fav AND graphics"  < example) < and again by default filter is locked until escape is pressed (or something). This would also allow the user to set multiple buttons on say tint2, reducing the tree depth.
- being aware that any kind of history is possibly a bad thing (not necessarily)
- ability to setup some sort of taging system, probably in config file (and tags are valid search entries):

firefox* 'browsers' 'web' 'internet'
*chrome* 'browsers' 'web' 'internet' 

- ...
slightly related:
- rmb add/remove to favorites (and favorites are displayed on top of tree menus) < search for "fav" will show only that
- mmb moves favorites up/down (or/and the order is set somehow in config file)
- option to not show icons (Perhaps already integrated?).

Last edited by brontosaurusrex (2016-10-17 15:57:46)

Offline

#38 2016-10-17 22:53:15

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

Re: jgmenu

@o9000: I've added gnome-menus as a dependency in the README.md

@HoaS:    I've added a Makefile-helper-script to sort out the python shebang issue. I hope it works and that I haven't broken it for anyone else.
Happy to use strlcpy() and friends. Is there a complete list of the "friends".

@bronto: Thanks very much for your thoughts on filtering. I like it.
I'll start playing with the basics and see how we go. I think I'll need to refactor jgmenu.c a bit before I do too much, so it'll be a step at the time.

Offline

#39 2016-10-18 06:22:31

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

Re: jgmenu

malm wrote:

Happy to use strlcpy() and friends. Is there a complete list of the "friends".

You will have to excuse me, I was tired when I posted that and waffling on about things I don't really understand -- please accept my apologies  ops

See http://man.openbsd.org/?query=strlcpy&a … SD-current & co. for the technical details but on further consideration I don't really think this is worth pursuing.


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

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

Offline

#40 2016-10-18 08:07:49

earlybird
ほやほや
Registered: 2015-12-16
Posts: 605
Website

Re: jgmenu

Head_on_a_Stick wrote:
malm wrote:

Happy to use strlcpy() and friends. Is there a complete list of the "friends".

You will have to excuse me, I was tired when I posted that and waffling on about things I don't really understand -- please accept my apologies  ops

See http://man.openbsd.org/?query=strlcpy&a … SD-current & co. for the technical details but on further consideration I don't really think this is worth pursuing.

strlcpy and friends are BSD inventions. Don't use them when writing portable code; they're not part of a POSIX standard.

You can use your own implementation however or import from BSD libc or musl libc (https://github.com/BlankOn/musl/blob/ma … /strlcpy.c). It's generally a more caveat-free version of strncpy() (https://lwn.net/Articles/507319/).

Offline

#41 2016-10-18 08:15:13

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

Re: jgmenu

I feel a bit stupid here, but I still can't get it working...  ops
"make" now runs OK, but with a warning:

john@bunsen1:/data/john/downloads/jgmenu-master$ make
...snip...
jgmenu-icon-find.c: In function ‘main’:
jgmenu-icon-find.c:59:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Checkinstall (without sudo) ran, but only after I added ~/share/man (the directories were left empty at the end). Also
./scripts/set-python-path.sh was not executable - I made it so, and got a .deb file, but it contained only docs.

Gave up, and did a direct 'sudo make install'. I dislike doing this because sometimes it's hard to back out again. It was still necessary to make ./scripts/set-python-path.sh executable:

john@bunsen1:/data/john/downloads/jgmenu-master$ sudo make prefix=/usr install
[sudo] password for john: 
make: execvp: ./scripts/set-python-path.sh: Permission denied
install: cannot stat ‘jgmenu-parse-pmenu’: No such file or directory
Makefile:66: recipe for target 'install' failed
make: *** [install] Error 1
john@bunsen1:/data/john/downloads/jgmenu-master$ sudo make prefix=/usr install
sed: -e expression #1, char 18: unknown option to `s'
john@bunsen1:/data/john/downloads/jgmenu-master$ sudo make install

I was unable to set a /usr prefix, but the final command did install some executable files. However:

john@bunsen1:/data/john/downloads/jgmenu-master$ jgmenu_run pmenu
warning: could not open config file /home/john/.config/jgmenu/jgmenurc
warning: jgmenu icon-cache has not been created
warning: no xsettings daemon found
warning: no xsettings daemon found
fatal: input file contains no menu items

Something seems to be still missing.

Finally I tried to uninstall:

john@bunsen1:/data/john/downloads/jgmenu-master$ sudo make uninstall
make: *** No rule to make target 'uninstall'.  Stop.

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

Offline

#42 2016-10-18 10:59:42

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

Re: jgmenu

getting some errors as well on jessie

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    xpm-loader.o
     CC    xdgdirs.o
     CC    xdgapps.o
     CC    xsettings.o
     CC    xsettings-helper.o
     CC    config-xs.o
     CC    filter.o
     CC    jgmenu.o
     LINK  jgmenu
     CC    jgmenu-parse-xdg.o
     LINK  jgmenu-parse-xdg
     CC    jgmenu-icon-find.o
jgmenu-icon-find.c: In function ‘main’:
jgmenu-icon-find.c:59:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
     LINK  jgmenu-icon-find
     CC    jgmenu-xsettings.o
     LINK  jgmenu-xsettings

Offline

#43 2016-10-18 11:34:40

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

Re: jgmenu

^ Same here, on a stock BL in Virtualbox.


Be Excellent to Each Other...

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

Offline

#44 2016-10-18 20:43:17

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

Re: jgmenu

Sorry for breaking "make install" last night. It was rather careless of me. I have just pushed a fix (hope it works this time!)

@johnraff: The simplest way is to just do a "make" followed by "make install", that will install the programs in your local ~/bin/ directory (without needing sudo). It assumes that you have ~/bin in your $PATH. In this scencario, the man pages are installed to ~/share/man/man1 where you can read them with "man ./jgmenu.1" etc.
No need to create a .deb package.

If I were you, I'd do the following:
remove jgmenu* from /usr/bin/
remove jgmenu* from ~/bin/
cd /data/john/downloads/jgmenu
git pull
make clean
make
make install

@HoaS: When you get a chance - does "jgmenu_run pmenu" work now without the symlink you created?
What shebang do you get in ~/bin/jgmenu-parse-pmenu (after "make install")?
I've assumed your /usr/bin is symlinked to /usr/local/bin (if it's not, let me know and I'll modify the script)

Offline

#45 2016-10-18 21:21:35

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

Re: jgmenu

malm wrote:

does "jgmenu_run pmenu" work now without the symlink you created?

Yes, the program works properly without any added symlinks.

However, I do have to change the shebang in jgmenu-parse-pmenu.py to !#/usr/local/bin/python2.7 before running:

gmake && gmake install

http://openports.se/devel/gmake

What shebang do you get in ~/bin/jgmenu-parse-pmenu (after "make install")?

As mentioned above, I have to change the shebang before compiling the program.

OpenBSD: ~ $ head -n1 bin/jgmenu-parse-pmenu.py                
#!/usr/local/bin/python2.7

If the shebang is not changed then the original error message is shown:

env: python: No such file or directory

I've assumed your /usr/bin is symlinked to /usr/local/bin

No, those directories are not linked.

Software is handled slightly differently under the BSDs, only packages in the base system have binaries in /usr/bin -- all other packages (called "ports" in BSD land) place their binaries in /usr/local/bin

Finally, just to note that your current HEAD appears to have an error somewhere -- it compiles fine but shows this error:

OpenBSD: ~/git/jgmenu $ jgmenu_run pmenu 
/home/empty/bin/jgmenu-pmenu.sh[3]: jgmenu-parse-pmenu: No such file or directory
OpenBSD: ~/git/jgmenu $ ls -l /home/empty/bin/jgmenu-parse-pmenu                                                                                           
-rwxr-xr-x  1 empty  empty  7498 Oct 18 22:24 /home/empty/bin/jgmenu-parse-pmenu

v0.4.2 works fine though smile


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

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

Offline

#46 2016-10-19 05:31:51

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

Re: jgmenu

^ Sorry. I probably should have said - I've done some renaming since v0.4.2 (all to support this python2.7 thing smile )
In the git repo jgmenu-parse-pmenu.py keeps the original shebang (#!/usr/bin/env python). I didn't want the install script to touch this one as your source tree would then change.

When you run "make install", jgmenu-parse-pmenu.py is renamed to jgmenu-parse-pmenu (without the .py) and has its shebang changed to whatever will work on your system.

It shouldn't matter, but for the sake of cleanliness, ~/bin/jgmenu-parse-pmenu.py could (should) be deleted.

I don't understand the last bit.
What happens if you do

make clean
make
make install
cd ~
jgmenu-parse-pmenu

You should be able to run jgmenu-parse-menu (without .py) from the command line.
jgmenu-pmenu.sh and jgmenu_run are just convenience wrappers to call jgmenu-parse-pmenu

Offline

#47 2016-10-19 06:18:25

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

Re: jgmenu

malm wrote:

If I were you, I'd do the following:
remove jgmenu* from /usr/bin/
remove jgmenu* from ~/bin/
cd /data/john/downloads/jgmenu
git pull
make clean
make
make install

Thank you! This time it all went smoothly, no error messages or warnings. (I didn't clone the git repo, just downloaded the zip.)

'jgmenu_run pmenu' brought up a very nice-looking menu.  cool
jgmenu_191016_15_22_34.jpg

When I've played with the config I might have some comments/requests from a user point of view...

Last edited by johnraff (2016-10-19 06:24:08)


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

Offline

#48 2016-10-19 06:31:34

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

Re: jgmenu

malm wrote:

I don't understand the last bit.
What happens if you do

make clean
make
make install
cd ~
jgmenu-parse-pmenu

I started from fresh so used these first:

rm -rf ~/git/jgmenu
rm ~/bin/jgmenu*

Then I cloned a fresh repository and ran your commands (with 's/make/gmake/'):

OpenBSD: ~ $ jgmenu-parse-pmenu                     
ksh: jgmenu-parse-pmenu: No such file or directory
OpenBSD: ~ $ bash -c 'jgmenu-parse-pmenu'           
bash: /home/empty/bin/jgmenu-parse-pmenu: /usr/bin/python2.7: bad interpreter: No such file or directory
OpenBSD: ~ $ head -n1 ~/bin/jgmenu-parse-pmenu 
#!/usr/bin/python2.7
OpenBSD: ~ $

So it should be /usr/local/bin/python2.7 rather than /usr/bin/python2.7

I should note here that there are three versions of python available in OpenBSD:
http://openports.se/lang/python

I have both 2.7 and 3.5 installed, no idea why...
big_smile


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

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

Offline

#49 2016-10-19 17:42:00

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

Re: jgmenu

Update: version v0.4.2 works perfectly without any modifications at all.

The problem was that I had failed to configure Python properly on my system -- when the packages are installed a symlink should be made from the desired version to /usr/local/bin/python and I forgot to do this...
ops

Please accept my humble apologies for wasting your time with this, the v0.4.2 release works as expected under OpenBSD-current with no modifications needed.


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

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

Offline

#50 2016-10-19 18:18:36

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: jgmenu

^ I figured as much, as Debian seems to respect /usr/bin/python, which suggests to me that it is symlinked, most likely to python 2.7. There is potentially a gotcha in that though, if the code I develop depends on python3.

Edit: Yep it is symlinked to python2.7, so well-written python code most likely needs to target a specific python binary if it depends on certain features, etc. Debian also provides /usr/bin/python2 and /usr/bin/python3 for a more minor version agnostic shebang call.

I tend to use #! /usr/bin/python in my scripts and can see now that I need to stop that.

Offline

Board footer

Powered by FluxBB