You are not logged in.
^ Ah yes, thanks -- that does indeed fix it, well done sir!
“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.
Offline
Would
#!/usr/bin/env python
solve it?
Offline
I think so. We just need to make sure the script works in both python 2 and 3.
Offline
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
@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
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:
cwm(1) pictured, btw
“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.
Offline
Very nice. If will be part of tint2 menu will be huge. Thanks both of you for your active work.
OS: Devuan & OpenBSD | WM: CWM
\m/ Ijime, Dame, Zettai「イジメ、ダメ、ゼッタイ」\m/
Offline
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
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
If you are open to suggestions I will meditate on this.
Yes - very open to suggestions.
Offline
Could we use
#!/usr/bin/env python3
Would that work on OpenBSD?
Sadly not:
env: python3: No such file or directory
Last edited by Head_on_a_Stick (2016-10-16 21:54:51)
“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.
Offline
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)
- 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
@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
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
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.
Offline
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
![]()
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
I feel a bit stupid here, but I still can't get it working...
"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.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )
Offline
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
^ Same here, on a stock BL in Virtualbox.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
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
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
“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.
Offline
^ Sorry. I probably should have said - I've done some renaming since v0.4.2 (all to support this python2.7 thing )
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
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.
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)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )
Offline
I don't understand the last bit.
What happens if you domake 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...
“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.
Offline
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...
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.
Offline
^ 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