From 41e8599392a543a537f15447e20fd7bc8d8f2297 Mon Sep 17 00:00:00 2001 From: adnano Date: Thu, 2 May 2024 21:39:54 -0400 Subject: Add wmenu-run executable --- main.c | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 main.c (limited to 'main.c') diff --git a/main.c b/main.c deleted file mode 100644 index 7eae947..0000000 --- a/main.c +++ /dev/null @@ -1,28 +0,0 @@ -#define _POSIX_C_SOURCE 200809L - -#include - -#include "menu.h" -#include "wayland.h" - -static void read_items(struct menu *menu) { - char buf[sizeof menu->input]; - while (fgets(buf, sizeof buf, stdin)) { - char *p = strchr(buf, '\n'); - if (p) { - *p = '\0'; - } - menu_add_item(menu, strdup(buf)); - } -} - -int main(int argc, char *argv[]) { - struct menu *menu = menu_create(); - menu_getopts(menu, argc, argv); - if (!menu->passwd) { - read_items(menu); - } - int status = menu_run(menu); - menu_destroy(menu); - return status; -} -- cgit v1.2.3