#include <string.h>
#include <strings.h>
#include <time.h>
+#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
drw_setscheme(drw, scheme[SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0);
- drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL);
+ curpos = TEXTW(text) - TEXTW(&text[cursor]);
if ((curpos += lrpad / 2 - 1) < w) {
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
die("no fonts could be loaded.");
lrpad = drw->fonts->h;
- if (fast) {
+#ifdef __OpenBSD__
+ if (pledge("stdio rpath", NULL) == -1)
+ die("pledge");
+#endif
+
+ if (fast && !isatty(0)) {
grabkeyboard();
readstdin();
} else {