--- /dev/null
+momen
+momen.1
--- /dev/null
+Copyright (c) 2021 Armaan Bhojwani
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
--- /dev/null
+all:
+ ${CC} momen.c -o momen -lXm -lXt -lcurl ${LDFLAGS} -std=c99 ${CFLAGS} -Wall \
+ -Wextra -pedantic
+ scdoc < momen.1.scd > momen.1
+
+install:
+ mkdir -p /usr/local/bin /usr/local/man
+ cp momen /usr/local/bin/momen
+ cp momen.1 /usr/local/man/man1/momen.1
+
+uninstall:
+ rm /usr/local/bin/momen
+ rm /usr/local/man/man1/momen.1
--- /dev/null
+momen
+-----
+
+A dmenu replacement in motif.
+
+MIT License Armaan Bhojwani 2021.
--- /dev/null
+momen(1)
+
+# NAME
+momen - program runner
+
+# SYNOPSIS
+*momen*
+
+# LICENSE
+MIT License, Armaan Bhojwani 2021.
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <Xm/Text.h>
+
+void
+execute(Widget text_w, XtPointer client_data, XtPointer call_data)
+{
+ // Discard unused parameters
+ (void)client_data;
+ (void)call_data;
+
+ char *value = XmTextGetString(text_w);
+ char *valuep = (char *) calloc(strlen(value) + 2, sizeof(char));
+ sprintf(valuep, "%s &", value);
+ printf("Launching %s\n", valuep);
+ system(valuep);
+ XtFree(value);
+ free(valuep);
+ exit(0);
+}
+
+int
+main(int argc, char *argv[])
+{
+ Widget toplevel, text_w;
+ XtAppContext app;
+
+ XtSetLanguageProc(NULL, NULL, NULL);
+ toplevel = XtVaOpenApplication(&app, "momen", NULL, 0, &argc, argv, NULL,
+ sessionShellWidgetClass, NULL);
+ text_w = XmCreateText(toplevel, "text", NULL, 0);
+ XtManageChild(text_w);
+ XtAddCallback(text_w, XmNactivateCallback, execute, NULL);
+ XtRealizeWidget(toplevel);
+ XtAppMainLoop(app);
+}