aboutsummaryrefslogtreecommitdiff
path: root/i3/bin
diff options
context:
space:
mode:
authorCamil Staps2023-02-16 22:16:14 +0100
committerCamil Staps2023-02-16 22:16:14 +0100
commit1b8c62a2c32c35f3e271ec15861e48c8a1fd4f40 (patch)
treedd420f99fb19ea6140eee4e12960922d9bcba0a1 /i3/bin
parentRemove clean directory (outdated now that we use nitrile) (diff)
Minor improvements to kbdlayout
Diffstat (limited to 'i3/bin')
-rw-r--r--i3/bin/Makefile2
-rw-r--r--i3/bin/kbdlayout.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/i3/bin/Makefile b/i3/bin/Makefile
index 221dde7..b4886a1 100644
--- a/i3/bin/Makefile
+++ b/i3/bin/Makefile
@@ -1,3 +1,3 @@
kbdlayout: kbdlayout.c
- $(CC) $(CCFLAGS) -lX11 $< -o $@
+ $(CC) $(CCFLAGS) $< -o $@ -lX11
diff --git a/i3/bin/kbdlayout.c b/i3/bin/kbdlayout.c
index bb030bb..7b1fdf6 100644
--- a/i3/bin/kbdlayout.c
+++ b/i3/bin/kbdlayout.c
@@ -28,6 +28,10 @@ int main(void) {
int min = XkbMinorVersion;
Display* disp = XkbOpenDisplay("", &evCode, &errRet, &maj, &min, &rsnRet);
+ if (disp == NULL) {
+ fprintf(stderr,"Failed to open display, is X running?\n");
+ exit(1);
+ }
// State
XkbStatePtr state = calloc(1, sizeof(XkbStateRec));