1
0
mirror of https://github.com/Cloudef/bemenu synced 2024-11-23 17:32:11 +01:00
Commit Graph

97 Commits

Author SHA1 Message Date
Michael Hsu
81b509155c Fix --ch cursor height option parsing 2022-03-11 17:56:04 +09:00
Stacy Harper
9b8da12467 Add a feedback for touchscreen support
The idea is to write "Scroll up…", "Scroll down…" when the finger
touching bemenu will trigger a page scroll on release.
2022-02-08 22:23:02 +09:00
Stacy Harper
a111aa2afa mouse and touch support on wayland 2022-02-08 22:23:02 +09:00
Maxim Karasev
43255bbbe8 Add relative width option
It works on Wayland and X11 and acts as a complement to margin. Exact
behavior is as follows:
- If width factor is 0, width minus margin is used.
- If width multiplied by factor is greater than width minus margin,
  width minus is used. (so margin may be used to make sure that bemenu
  is at least N pixels away from the view border)
- Otherwise width multiplied by factor is used.

I think it's fine to disable warnings about floating point numbers
comparision. We don't do any arithmetics on them anyway, so we can't
suffer from inaccuracy.
2021-12-29 17:22:10 +09:00
lunacb
cd41b1b52c add missing newline 2021-11-03 17:57:18 +09:00
lunacb
21ff4e47da fixed indentation 2021-11-03 17:57:18 +09:00
lunacb
a96ed87472 redesigned vertical alignment
single enum determines if the menu is at the top, in the center,
or at the bottom. implemented in wayland and x11 renderers.
2021-11-03 17:57:18 +09:00
lunacb
bddeea05b6 created margin option
-M or --margin option sets the horizontal margin of the window
2021-11-03 17:57:18 +09:00
Stacy Harper
9b2a2cabf2 Add -s to disable title spacing on entries 2021-10-07 00:25:20 +09:00
Ben Brown
0589962d1c Add option to configure cursor height
If set to 0 (the default), the height of the cursor is set to the
height of the line (as is the current behaviour).
2021-08-27 04:01:13 +09:00
Stacy Harper
a42fa97a49 add -c center mode on wayland 2021-08-16 17:46:57 +09:00
Maximilian Bosch
702a04c374 Ignore hidden files in bemenu
On most systems it's fairly uncommon to have hidden files within
`$PATH`, but in case of NixOS this is fairly regularly the case as we
have the convention to add `foo` and `.foo-wrapped` to a `bin`-directory
if `foo` is supposed to be a wrapper which sets e.g. env-vars for the
program.

These `.foo-wrapped`-executables are almost never needed, but are shown
in `bemenu` right at the start, so I modified the selection code to skip
hidden files which is also what `dmenu` does for instance.
2021-06-11 01:29:17 +09:00
Robert Günzler
4612f9d327 wayland: Allow showing the menu on the focused monitor
This adds an alias 'focused' for selecting the current monitor, which
becomes the default on x11 and wayland. The previous wayland default of
displaying on all outputs moves under '-2' or 'all'.

ref: https://github.com/Cloudef/bemenu/issues/102#issuecomment-604562234

Signed-off-by: Robert Günzler <r@gnzler.io>
2021-05-22 04:12:59 +09:00
Sören Tempel
934aa6fbb9 client: make sure the monitor index defaults to -1
This ensures that the menu spawns on the current monitor by default when
using X11 or on all monitors when using Wayland.
2021-04-27 14:24:02 +09:00
Sören Tempel
1475c3ce45 client: improve stripping of getline(3) newline
The previous version of this code operated under the assumption that
getline(3) lines are always \n\0 terminated. Unfortunately, this is not
the case as readline will return input which is not terminated with a
newline character if EOF is reached before encountering this newline. In
these cases, the code would falsely strip the last character. As an
example, consider the following bemenu invocation:

	printf foo | ./bemenu

This would start bemenu with `fo` instead of `foo` as a menu item. This
commit fixes this edge case and also hardens the loop body a bit by only
entering it if getline wrote more than zero characters to the buffer.
2021-04-04 19:03:52 +09:00
Sören Tempel
38395e92c7 client: use getline(3)
Not sure why the code didn't use this function previously, but
getline(3) is mandatory since POSIX.1-2008 and should thus be supported
by all maintstream operating systems. The proposed changes make the code
easier to read and should also make it more efficient memory-wise as it
does not necessarily cause the entire input to be copied into memory at
once.
2021-04-04 17:45:04 +09:00
Harley Swick
e74224a406 Use -m option for setting monitor name and monitor + cleanup 2021-02-05 16:53:43 +09:00
Robert Günzler
52547807b0
support hiding filter input (#150)
* support hiding filter input

"password mode"

Signed-off-by: Robert Günzler <r@gnzler.io>
2021-02-05 13:12:48 +09:00
Julian Mehne
7523af7d18 Add --filter option. 2020-11-15 11:30:03 +09:00
Dominic Monroe
64c38dde50 Add custom key support 2020-08-28 21:01:22 +09:00
Daniel Lublin
5387677720 Add --scrollbar none
Useful in aliases or scripts to override a previously enabled scrollbar
on the commandline.

Also correct documentation of bm_scrollbar_mode.
2020-06-15 15:09:42 +09:00
Jari Vetoniemi
6343a658bb wayland: support showing bemenu on all monitors 2020-03-25 19:16:57 +02:00
Corey Hinshaw
42ba51857d Add no-exec option to bemenu-run 2020-02-23 01:41:50 +09:00
Jari Vetoniemi
467ac971d1 bemenu: reuse the calculated buffer end
Also assert that we don't overflow on realloc
2020-02-11 10:23:33 +02:00
Jari Vetoniemi
a89799a6b5 bemenu: fix null termination of input 2020-02-11 10:19:57 +02:00
Jari Vetoniemi
2187fa8157 bemenu-run: no argument for --fork 2020-02-08 14:01:18 +02:00
Jari Vetoniemi
56231f8119 bemenu-run: add --fork option
Make terminal backends not fork by default.
Use this option to fork again on curses.
For non terminal backends this option is no-op.
2020-02-08 13:21:36 +02:00
Jari Vetoniemi
178a58253a wayland: implement set_monitor (untested) 2020-02-08 10:10:58 +02:00
Jari Vetoniemi
f30449738b client: set overlap in menu_with_options 2020-02-08 10:09:33 +02:00
Jari Vetoniemi
dac1ffde7e clients: add BEMENU_OPTS env var support
It's possible to pass any CLI argument through BEMENU_OPTS env variable
instead.
2020-02-07 23:15:21 +02:00
Jari Vetoniemi
bc584cc5f0 menu: make SHIFT_RETURN handling more elegant
Don't handle this on client side. Instead have a filter item and return
it if filter text is requested.
2020-02-07 21:54:13 +02:00
Jari Vetoniemi
acb24be411 ignore_ret warns on clang *sigh* 2020-02-07 16:23:52 +02:00
Jari Vetoniemi
5a4d364d50 Nuke CMake from existance
Welcome glorious GNU Makefile
2020-02-07 16:03:08 +02:00
Thomas Kerpe
5d787629a5 Prevent a deadloop in PATH handling
Empty PATH segments should no longer cause
a deadloop.

Fixes #59
2019-06-05 15:59:16 +02:00
Alyssa Ross
93cde4831b
bemenu: add --line-height / -H option
Text is displayed vertically centered in a line. If unspecified, or 0,
the previous behaviour of making the height the size of the text, plus
two pixels on either side, is used, so there will be no change in
behaviour if this option is not used.

Fixes https://github.com/Cloudef/bemenu/issues/44.
2019-05-31 23:20:54 +00:00
samihda
5f01531482 Fix typo 2019-05-03 17:36:21 +02:00
Ilia Bozhinov
38069992ec Add option to respect panel position (#48)
* implement option to make menu respect panel boundaries

* fixup! implement option to make menu respect panel boundaries
2019-03-25 23:21:17 +02:00
Dominique Martinet
67c3c04acb client: update help (--bottom available for wayland) 2018-04-29 20:50:56 +09:00
Jari Vetoniemi
d6261274cf bemenu: Add --ifne option 2017-02-14 21:53:15 +02:00
Jari Vetoniemi
5d4b35ec68 bemenu-run: Use bemenu-run default title 2017-02-14 21:52:57 +02:00
Jari Vetoniemi
944989c094 bemenu: Remove unneccessary initializers 2017-02-14 21:52:28 +02:00
Jari Vetoniemi
8cfa530b89 bemenu: Reuse code more 2017-02-14 21:51:02 +02:00
Jari Vetoniemi
0ff5f20178 bemenu: const correctness 2017-02-14 21:50:15 +02:00
Jari Vetoniemi
8c93e0081b bemenu: Disable early grab on -f for now
We can't handle input yet during read because renderers are very dumb.
Thus -f can potentially lock your system with grab.
2017-02-14 21:29:27 +02:00
Jari Vetoniemi
7b8b38bc21 bemenu: Do not eat newlines 2017-02-14 19:20:44 +02:00
Jari Vetoniemi
208af51c0e clients: Make -f option show menu immediately 2017-02-14 19:20:44 +02:00
Jari Vetoniemi
30ed5b1916 Copy better tokenizer from chck for now. 2015-04-06 00:47:18 +03:00
Jari Vetoniemi
eb46ba7bdc Remove bg color option as you never see the real bg anyways. 2015-01-20 18:42:29 +02:00
Jari Vetoniemi
c2eabf2be1 Make scrollbar autohideable 2015-01-18 02:07:30 +02:00
Jari Vetoniemi
f2eaf599f6 Change default scrollbar style and make colors configurable 2015-01-18 01:38:25 +02:00