Use dmx, dmy offsets even when centered

I should also probably upstream this as a patch to center[0].

This allows for arguments to be combined, like

	dmenu -c -y -100

if you want the menu to have a smaller width, be centered on x, and be
100 pixels above the center on y.

[0]: https://tools.suckless.org/dmenu/patches/center/
Merge branch 'suckless' into smlss
Reformat smlss README.md header
ba1a347d — Hiltjo Posthuma 7 months ago suckless
readstdin: allocate amount of items

Keep track of the amount of items (not a total buffer size), allocate an array of
new items. For now change BUFSIZ bytes to 256 * sizeof(struct item)).
bcbc1ef5 — Hiltjo Posthuma 7 months ago
readstdin: add a comment

Maybe too obvious / redundant, but OK.
fix leak when getline fails

according to the getline(3) documentation, the calling code needs to
free the buffer even if getline fails.

dmenu currently doesn't do that which results in a small leak in case of
failure (e.g when piped /dev/null)

	$ ./dmenu < /dev/null
	==8201==ERROR: LeakSanitizer: detected memory leaks
	Direct leak of 120 byte(s) in 1 object(s) allocated from:
	    #0 0x7f6bf5785ef7 in malloc
	    #1 0x7f6bf538ec84 in __getdelim
	    #2 0x405d0c in readstdin dmenu.c:557

moving `line = NULL` inside the loop body wasn't strictly necessary, but
IMO it makes it more apparent that `line` is getting cleared to NULL
after each successful iteration.
e42c0366 — Hiltjo Posthuma 7 months ago
dmenu: small XmbLookupString code improvements

* Increase the length of composed strings to the same limit as st (32 to 64 bytes).
* Initialize ksym to NoSymbol to be safe: currently this is not an issue though.
* Add comments to clarify the return values of XmbLookupString a bit.
1d2b462a — Hiltjo Posthuma 8 months ago
bump version to 5.2
dmenu: use die() to print the usage message
fce06f43 — Hiltjo Posthuma 8 months ago
remove workaround for a crash with color emojis on some systems, now fixed in libXft 2.3.5

1e8c5b68 — Hiltjo Posthuma 9 months ago
fix a regression in the previous commit for tab complete

Reported by Santtu Lakkala <inz@inz.fi>, thanks!
tab-complete: figure out the size before copying

we already need to know the string length since `cursor` needs to be

so just calculate the length beforehand and use `memcpy` to copy exactly
as much as needed (as opposed to `strncpy` which always writes `n`
readstdin: use getline(3)

currently readstdin():
   - fgets() into a local buffer,
   - strchr() the buffer to eleminate the newline
   - stdups() the buffer into items

a simpler way is to just use getline(3), which will do the allocation
for us; eliminating the need for stdup()-ing.

additionally getline returns back the amount of bytes read, which
eliminates the need for strchr()-ing to find the newline.
Merge branch 'suckless' into smlss
e35976f4 — Hiltjo Posthuma 9 months ago
sync code-style patch from libsl
28fb3e28 — Hiltjo Posthuma 1 year, 1 month ago
Makefile: add manual path for OpenBSD
fe5d5c67 — Hiltjo Posthuma 1 year, 1 month ago
fix incorrect comment, math is hard