From 4ec95c0bc1223aee10449bf831d29f4f683faff7 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Sat, 18 Oct 2025 01:36:29 -0400 Subject: fix output and swenu-run --- README.md | 17 +++++++++++------ config.h | 2 +- graphics.c | 4 ++-- registry.c | 2 +- swenu-run.sh | 9 +++++++++ 5 files changed, 24 insertions(+), 10 deletions(-) create mode 100755 swenu-run.sh diff --git a/README.md b/README.md index f21a1da..4f16dc2 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,14 @@ To build: `make` ## Todo - -- [ ] "Selection" -- [ ] Output results and exit code -- [ ] Cursor -- [ ] Scrolling -- [ ] Unicode -- [ ] Kerning +- [x] "selection" +- [ ] figure out whats going on with stderr and exit code +- [ ] cursor +- [ ] fuzzy filter and sort filtering by match % +- [ ] fancy highlights +- [ ] scrolling +- [ ] unicode +- [ ] kerning +- [ ] input fluff +- [ ] config file +- [ ] emacs keybindings diff --git a/config.h b/config.h index 61d0e7b..494ae97 100644 --- a/config.h +++ b/config.h @@ -4,6 +4,6 @@ #include static const uint32_t min_width = 600; -static const uint32_t font_size = 16; +static const uint32_t font_size = 15; #endif diff --git a/graphics.c b/graphics.c index d7b630a..e2f06a1 100644 --- a/graphics.c +++ b/graphics.c @@ -43,7 +43,7 @@ layout (location = 0) out vec4 frag_color;\n\ \n\ void main() {\n\ float d = texture(u_texture, o_uv).r;\n\ - float aaf = fwidth(d);\n\ + float aaf = fwidth(d) * 0.5f;\n\ float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d);\n\ frag_color = vec4(u_color, alpha);\n\ }"; @@ -113,7 +113,7 @@ bool init_gl(client_state* state) { GLint major, minor; glGetIntegerv(GL_MAJOR_VERSION, &major); glGetIntegerv(GL_MINOR_VERSION, &minor); - printf("GL version %u.%u\n", major, minor); + fprintf(stderr, "GL version %u.%u\n", major, minor); } glEnable(GL_BLEND); diff --git a/registry.c b/registry.c index 8230339..204281d 100644 --- a/registry.c +++ b/registry.c @@ -16,7 +16,7 @@ void setup_registry_and_globals(client_state* state) { void global(void *data, struct wl_registry *wl_registry, uint32_t name, const char *interface, uint32_t version) { client_state* state = data; - printf("iface: %s v%d\n", interface, version); + fprintf(stderr, "iface: %s v%d\n", interface, version); if (!strcmp(interface, wl_compositor_interface.name)) { state->compositor = wl_registry_bind(wl_registry, name, &wl_compositor_interface, 1); diff --git a/swenu-run.sh b/swenu-run.sh new file mode 100755 index 0000000..4ab3aa6 --- /dev/null +++ b/swenu-run.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +IFS=: +exec $( + for dir in $PATH; do + for file in "$dir"/*; do + [ -f "$file" ] && [ -x "$file" ] && printf '%s\n' "${file##*/}" + done + done | sort -u | ./swenu -a) -- cgit v1.2.3