aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin <calvin@bastille>2014-02-08 18:30:01 -0500
committerCalvin <calvin@bastille>2014-02-08 18:30:01 -0500
commite5bab1afd979a462a6663c1839232d9b70ce93bb (patch)
treeeddce9e6c2ffaf57e17eb031cc9392903668f740
parent27f96fbf85a39d6dcd1a4f33888e0d3359cc758d (diff)
udpate make and seperate keys
-rw-r--r--Makefile6
-rw-r--r--hotkey.c10
-rw-r--r--keys.h7
3 files changed, 13 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 7cf74ec..a3805e1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
CC =gcc
CFLAGS = -O3 -s -mtune=native -Wall -Wextra
-CLIBS = -X11
+CLIBS = -lX11
-hotkey: hotkey.c
- $(CC) -o hotkey -c hotkey.c $(CFLAGS)
+hotkey: hotkey.c keys.h
+ $(CC) hotkey.c -o hotkey $(CFLAGS) $(CLIBS)
clean:
rm hotkey
diff --git a/hotkey.c b/hotkey.c
index 7978baf..27051e8 100644
--- a/hotkey.c
+++ b/hotkey.c
@@ -1,11 +1,11 @@
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/Xutil.h>
-#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+
#define len(X) (sizeof X / sizeof X[0])
typedef struct {
@@ -14,11 +14,7 @@ typedef struct {
KeySym key;
} Key;
-static const Key hotkeys[] = {
- //"Command MOD Key
- { "svte &", Mod1Mask, XK_g },
- { "svte -e mocp &", ShiftMask|ControlMask, XK_y }
-};
+#include "keys.h"
int main() {
Display* dpy = XOpenDisplay(0);
@@ -30,7 +26,7 @@ int main() {
}
XSelectInput(dpy, root, KeyPressMask );
- while(true) {
+ while(1) {
XEvent ev;
XNextEvent(dpy, &ev);
diff --git a/keys.h b/keys.h
new file mode 100644
index 0000000..783a938
--- /dev/null
+++ b/keys.h
@@ -0,0 +1,7 @@
+static const Key hotkeys[] = {
+ //"Command MOD Key
+ { "xterm &", Mod1Mask, XK_g },
+ { "xterm -e mail &", ShiftMask|ControlMask, XK_m },
+ { "chromium &", Mod1Mask, XK_z }
+};
+