aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authoradnano <me@adnano.co>2024-05-02 21:39:54 -0400
committeradnano <me@adnano.co>2024-05-02 21:39:54 -0400
commit41e8599392a543a537f15447e20fd7bc8d8f2297 (patch)
treee14de0c571a1653968cc383d8a9b1c3cd7726c06 /main.c
parent1f221a73cf290ff509ef6c066ff692bb48f8625e (diff)
downloadwmenu-41e8599392a543a537f15447e20fd7bc8d8f2297.tar.gz
Add wmenu-run executable
Diffstat (limited to 'main.c')
-rw-r--r--main.c28
1 files changed, 0 insertions, 28 deletions
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 <string.h>
-
-#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;
-}