diff options
| author | Abhinav Prasai <abhinav.prsai@gmail.com> | 2025-10-11 11:18:33 +0100 |
|---|---|---|
| committer | Abhinav Prasai <abhinav.prsai@gmail.com> | 2025-10-11 11:18:33 +0100 |
| commit | 74c33466e144e8a66fe9d9aaa3249f00aebc1e35 (patch) | |
| tree | 84a922c13d2ed9f9d0fab22b90fde90bfa77003f | |
| parent | 723222da1511a3f832e14f89cb143d053f6e6c27 (diff) | |
add/remove missing/useless headers + update sxwm-dev docs
| -rw-r--r-- | docs/sxwm-dev.md | 8 | ||||
| -rw-r--r-- | src/sxwm.c | 16 |
2 files changed, 11 insertions, 13 deletions
diff --git a/docs/sxwm-dev.md b/docs/sxwm-dev.md index e8e118a..b019815 100644 --- a/docs/sxwm-dev.md +++ b/docs/sxwm-dev.md @@ -1,9 +1,9 @@ # sxwm developer docs -# Table of Contents -1. [Headers](#headers) -2. [sxwm.c](#sxwmc) - 1. [Functions](#functions) +## Table of Contents +- [Headers](#headers) +- [sxwm.c](#sxwmc) + - [Functions](#functions) @@ -13,13 +13,13 @@ * (C) Abhinav Prasai 2025 */ -#include <err.h> #include <signal.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> +#include <sys/types.h> #include <unistd.h> #include <X11/keysym.h> @@ -1845,7 +1845,8 @@ void other_wm(void) int other_wm_err(Display *d, XErrorEvent *ee) { - errx(1, "can't start because another window manager is already running"); + fprintf(stderr, "can't start because another window manager is already running"); + exit(EXIT_FAILURE); return 0; (void)d; (void)ee; @@ -2196,7 +2197,8 @@ void send_wm_take_focus(Window w) void setup(void) { if ((dpy = XOpenDisplay(NULL)) == False) { - errx(1, "can't open display.\nquitting..."); + fprintf(stderr, "can't open display.\nquitting..."); + exit(EXIT_FAILURE); } root = XDefaultRootWindow(dpy); @@ -3324,13 +3326,9 @@ int main(int ac, char **av) printf("%s\n%s\n%s\n", SXWM_VERSION, SXWM_AUTHOR, SXWM_LICINFO); return EXIT_SUCCESS; } - else if (strcmp(av[1], "-b") == 0 || strcmp(av[1], "--backup") == 0) { - puts("sxwm: using backup keybinds"); - } else { - puts("usage:\n"); - puts("\t[-v || --version]: See the version of sxwm\n"); - puts("\t[-b || --backup]: Use backup set of keybinds with sxwm\n"); + printf("usage:\n"); + printf("\t[-v || --version]: See the version of sxwm\n"); return EXIT_SUCCESS; } } |
