You are not logged in.
Hi,
I put together a dmenu(1) spinoff to use in the console. It takes input from stdin, reopens the tty, prints the UI to stderr, gets your input (again from stdin) and prints the result to stdout, so it mostly works as a drop-in replacement for dmenu. In fact, 90% of the code is dmenu's.
Stuff I don't use such as the multiline menu and runtime selectable colors is not implemented (yet?).
Should anyone be interested, the source is at
https://bitbucket.org/rafaelgg/slmenu/
And the AUR link
http://aur.archlinux.org/packages.php?ID=52017
Offline
This is a great utility. I've [already found a use for it].
Along the way, I think I may have found a bug that I'm not sure is actually a bug, but the [Home] and [End] keys aren't working as expected (URxvt), and, instead, print '~'.
Last edited by Wintervenom (2011-08-31 22:31:56)
Offline
the [Home] and [End] keys aren't working as expected (URxvt), and, instead, print '~'.
Offline
Wintervenom wrote:the [Home] and [End] keys aren't working as expected (URxvt), and, instead, print '~'.
URxvt*keysym.Home: \033[1~ URxvt*keysym.End: \033[4~
Thanks.
Offline
Along the way, I think I may have found a bug that I'm not sure is actually a bug, but the [Home] and [End] keys aren't working as expected (URxvt), and, instead, print '~'.
I just fixed this (and the same problem for xterm) in hg tip with a couple of case lines. I assumed that since both TERM=linux and TERM=st-256colors worked, everything else would do too. This could be avoided by reading terminfo (via curses?), but I'm sure there are not that many cases.
About the inputrc fix, I'm not sure it applies here: slmenu does not link libreadline, and nor do any of the shells I use (dash for scripting, mksh for interactive use).
Thanks for the report, I'll keep an eye for keys not working on the main terminal emulators out there. I might even install konsole or gnome-terminal.
Offline
Eh! I didn't read that far. Of course you can redefine what URxvt sends as Home/End.... well, I'll keep the fix just in case.
Apologies for the noise,
Rafa.
Offline
FWIW, a similar program is kingbash (https://bbs.archlinux.org/viewtopic.php?id=101010) it's in python, runs in the console and has a dmenu mode.
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
btw rafunchi, did you show this to the people on the suckless mailing list?
maybe it's worth considering/discussing making the matching stuff into a library so that dmenu and slmenu could share more code and only have the UI stuff separate.
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
btw rafunchi, did you show this to the people on the suckless mailing list?
maybe it's worth considering/discussing making the matching stuff into a library so that dmenu and slmenu could share more code and only have the UI stuff separate.
I did indeed, see http://lists.suckless.org/dev/1108/9239.html
Actually I thought of presenting slmenu as a patch to dmenu, maybe an alternative draw.c file. However, there's some X11 code in dmenu.c that I did not want to mess with. Also, key codes are processed differently in the console and in X. E.g. you can't bind an action to Shift-RET or Ctrl-RET in the console, because it *does* report the same as RET in most terminals. Finally, I removed stuff I don't use and that was mildly troublesome to port to the console such as the multi-line menu.
In the end I grew lazy and did my own slmenu.c file.
You are right: it would be cool to have slmenu and dmenu build from the same source, so you could patch and fix bugs without having to port the changes. If you feel up to it give it a try. Otherwise, I'll try and do it when I get some free time. I doubt it will be accepted by the suckless community tho
Offline
Hi this is great but as I am a complete and utter dumbass I had not a clue how to use it until I found
https://inconsolation.wordpress.com/201 … -wizardry/
You can like linux without becoming a fanatic!
Offline
Could someone advise how to create submenus (nested menus) with this tool without starting new program instances with different input files?
Last edited by nbd (2015-11-07 10:37:26)
bing different
Offline
Could someone advise how to create submenus (nested menus) with this tool without starting new program instances with different input files?
you can't
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline