Skip to content

Commit 402f462

Browse files
committed
Initial implementation
0 parents  commit 402f462

File tree

14 files changed

+1706
-0
lines changed

14 files changed

+1706
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bin/
2+
obj/
3+
.cache/
4+
*.json

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
PREFIX=/usr/local/
2+
3+
INCLUDE_DIRS_NOTIFY=/usr/include/glib-2.0 /usr/lib/glib-2.0/include /usr/include/gdk-pixbuf-2.0
4+
CFLAGS_NOTIFY=-DHAVE_NOTIFY $(INCLUDE_DIRS_NOTIFY:%=-I%)
5+
LDFLAGS_NOTIFY=-lnotify
6+
7+
# Uncomment if you want to be able to select the output folder via zenity
8+
# CFLAGS_ZENITY=-DHAVE_ZENITY
9+
10+
CFLAGS_ALL=-Wall -Wpedantic $(CFLAGS_NOTIFY) $(CFLAGS_ZENITY)
11+
LDFLAGS_ALL=-lX11 $(LDFLAGS_NOTIFY)
12+
13+
SRC_DIR=src
14+
OBJ_DIR=obj
15+
BIN_DIR=bin
16+
17+
SRC=$(wildcard $(SRC_DIR)/*.c)
18+
OBJ=$(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
19+
20+
BIN=$(BIN_DIR)/evid
21+
22+
.PHONY: all clean cat
23+
all: $(BIN)
24+
25+
$(BIN): $(OBJ) | $(BIN_DIR)
26+
$(CC) $(LDFLAGS_ALL) $^ -o $@
27+
28+
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
29+
$(CC) $(CFLAGS_ALL) -c $^ -o $@
30+
31+
$(OBJ_DIR) $(BIN_DIR):
32+
mkdir -p $@
33+
34+
clean:
35+
rm -rf $(BIN_DIR) && rm -rf $(OBJ_DIR)
36+
37+
install: all
38+
mkdir -p $(PREFIX)$(BIN_DIR)
39+
cp -f $(BIN) $(PREFIX)$(BIN)
40+
chmod 755 $(PREFIX)$(BIN)
41+
42+
uninstall:
43+
rm -f $(PREFIX)$(BIN)

src/actions.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef ACTIONS_EVID_H
2+
#define ACTIONS_EVID_H
3+
4+
#include "X11/keysym.h"
5+
6+
#define ABORT 1 << 7
7+
#define SAVE 1 << 1
8+
#define COPY 1 << 0
9+
10+
#define ABORT_KEYSYM XK_Escape
11+
#define SAVE_KEYSYM XK_s
12+
#define COPY_KEYSYM XK_c
13+
14+
#define ABORT_MODFIELD 0
15+
#define SAVE_MODFIELD ControlMask
16+
#define COPY_MODFIELD ControlMask
17+
18+
#define ABORT_KEYCODE(dpy) XKeysymToKeycode(dpy, ABORT_KEYSYM)
19+
#define SAVE_KEYCODE(dpy) XKeysymToKeycode(dpy, SAVE_KEYSYM)
20+
#define COPY_KEYCODE(dpy) XKeysymToKeycode(dpy, COPY_KEYSYM)
21+
22+
#endif

0 commit comments

Comments
 (0)