aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.gitignore2
-rw-r--r--Makefile24
-rw-r--r--hotkeythingy.c (renamed from daemonic.c)26
3 files changed, 17 insertions, 35 deletions
diff --git a/.gitignore b/.gitignore
index 627c86e..26ca78a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-daemonic
+hotkeythingy
*.o
diff --git a/Makefile b/Makefile
index c655b67..7c86960 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,15 @@
-# daemonic - dynamic window manager
+# hotkeythingy - dynamic window manager
# See LICENSE file for copyright and license details.
include config.mk
-SRC = daemonic.c
+SRC = hotkeythingy.c
OBJ = ${SRC:.c=.o}
-all: clean options daemonic
+all: clean options hotkeythingy
options:
- @echo daemonic build options:
+ @echo hotkeythingy build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
@@ -19,22 +19,22 @@ options:
${OBJ}: config.mk
-daemonic: ${OBJ}
+hotkeythingy: ${OBJ}
${CC} -o $@ ${OBJ} ${LDFLAGS}
clean:
- rm -f daemonic ${OBJ}
+ rm -f hotkeythingy ${OBJ}
install: all
mkdir -p ${DESTDIR}${PREFIX}/bin
- cp -f daemonic ${DESTDIR}${PREFIX}/bin
- chmod 755 ${DESTDIR}${PREFIX}/bin/daemonic
+ cp -f hotkeythingy ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/hotkeythingy
mkdir -p ${DESTDIR}${MANPREFIX}/man1
- sed "s/VERSION/${VERSION}/g" < daemonic.1 > ${DESTDIR}${MANPREFIX}/man1/daemonic.1
- chmod 644 ${DESTDIR}${MANPREFIX}/man1/daemonic.1
+ sed "s/VERSION/${VERSION}/g" < hotkeythingy.1 > ${DESTDIR}${MANPREFIX}/man1/hotkeythingy.1
+ chmod 644 ${DESTDIR}${MANPREFIX}/man1/hotkeythingy.1
uninstall:
- rm -f ${DESTDIR}${PREFIX}/bin/daemonic\
- ${DESTDIR}${MANPREFIX}/man1/daemonic.1
+ rm -f ${DESTDIR}${PREFIX}/bin/hotkeythingy\
+ ${DESTDIR}${MANPREFIX}/man1/hotkeythingy.1
.PHONY: all options clean dist install uninstall
diff --git a/daemonic.c b/hotkeythingy.c
index 3798441..f546231 100644
--- a/daemonic.c
+++ b/hotkeythingy.c
@@ -5,8 +5,6 @@
#include <X11/Xutil.h>
#include <unistd.h>
-#define VERSION "0.0.1"
-
typedef struct Command {
char* command;
unsigned int mode;
@@ -49,11 +47,11 @@ void unbind_key(Display *dpy, Window win, unsigned int mod, KeySym key) {
int error_handler(Display *disp, XErrorEvent *xe) {
if (xe->error_code == BadAccess) {
- printf("daemonic: [BadAccess] Cant grab key binding. Already grabbed\n");
+ printf("hotkeythingy: [BadAccess] Cant grab key binding. Already grabbed\n");
return 0;
}
- printf("daemonic: Something went wrong\n");
+ printf("hotkeythingy: Something went wrong\n");
return 1;
}
@@ -61,7 +59,7 @@ void spawn(char** command) {
if (fork() == 0) {
setsid();
execve(command[0], command, environ);
- fprintf(stderr, "daemonic: execve %s", command[0]);
+ fprintf(stderr, "hotkeythingy: execve %s", command[0]);
perror(" failed");
exit(0);
}
@@ -157,23 +155,7 @@ void keypress(Display *dpy, Window win, XKeyEvent *ev) {
}
}
-void help_menu(char* x) {
- printf("Usage: %s [-vh]\n", x);
-}
-
-int main(int argc, char *argv[]) {
- int opt;
- while (argc > 1 && (opt = getopt(argc, argv, "vh")) != NormalMode) {
- switch (opt) {
- case 'v': printf("%s\n", VERSION); return 0;
- /*case 'm': printf("%s\n", get_mode_label()); return 0;*/
- case 'h':
- default:
- help_menu(argv[0]);
- return opt != 'h';
- }
- }
-
+int main() {
XSetErrorHandler(error_handler);
int running = 1, i = 0;