aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.mk2
-rw-r--r--hotkeythingy.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/config.mk b/config.mk
index 64289e3..1aab402 100644
--- a/config.mk
+++ b/config.mk
@@ -1,4 +1,4 @@
-# dwm version
+# hotkeythingy version
VERSION = 0.1
# Customize below to fit your system
diff --git a/hotkeythingy.c b/hotkeythingy.c
index f546231..93c21c2 100644
--- a/hotkeythingy.c
+++ b/hotkeythingy.c
@@ -46,9 +46,10 @@ 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("hotkeythingy: [BadAccess] Cant grab key binding. Already grabbed\n");
- return 0;
+ switch(xe->error_code) {
+ case BadAccess:
+ printf("hotkeythingy: [BadAccess] Cant grab key binding. Already grabbed\n");
+ return 0;
}
printf("hotkeythingy: Something went wrong\n");
@@ -67,6 +68,7 @@ void spawn(char** command) {
char* get_mode_label() {
if (current_mode == NormalMode) return "";
+ if (LENGTH(mode_properties) <= current_mode) return "";
ModeProperties props = mode_properties[current_mode];
return props.label;
}