aboutsummaryrefslogtreecommitdiff
path: root/hotkeythingy.c
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-06-17 15:22:58 +0530
committerAkshay Nair <phenax5@gmail.com>2020-06-17 15:22:58 +0530
commit266c9c2e780ac0f0c898620ad672f1baaba17bea (patch)
tree02b7d9ad51ad80ab2b6216dd00a2655a577955e6 /hotkeythingy.c
parent23fa9a9aa7b5a203646e48609bbc1986b68fe753 (diff)
downloadshotkey-266c9c2e780ac0f0c898620ad672f1baaba17bea.tar.gz
shotkey-266c9c2e780ac0f0c898620ad672f1baaba17bea.zip
Renames daemonic to hotkeyhingy
Diffstat (limited to '')
-rw-r--r--hotkeythingy.c (renamed from daemonic.c)26
1 files changed, 4 insertions, 22 deletions
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;