feat: add screenshot and ocr functionality with web interface

build: update makefile with new dependencies for tesseract and libpng
chore: reorganize example files into examples directory
This commit is contained in:
2026-01-24 15:17:47 +00:00
parent ff2e183e0d
commit 507b20a39b
42 changed files with 9207 additions and 79 deletions
+21 -5
View File
@@ -5,7 +5,7 @@
CC = gcc
CFLAGS = -Wall -Wextra -Wpedantic -Wshadow -O2 -I./include
CFLAGS += -fstack-protector-strong -D_FORTIFY_SOURCE=2
LDFLAGS = -lX11 -lXext -lXinerama -lXrandr -lXft -lfontconfig -ldbus-1 -lcurl -lm -lpthread
LDFLAGS = -lX11 -lXext -lXinerama -lXrandr -lXft -lfontconfig -ldbus-1 -lcurl -lm -lpthread -lXtst
# Directories
SRC_DIR = src
@@ -28,8 +28,8 @@ DATADIR = $(PREFIX)/share
SYSCONFDIR = /etc
# Get pkg-config flags (with error handling)
PKG_CFLAGS := $(shell pkg-config --cflags x11 xext xinerama xrandr xft fontconfig dbus-1 2>/dev/null)
PKG_LIBS := $(shell pkg-config --libs x11 xext xinerama xrandr xft fontconfig dbus-1 2>/dev/null)
PKG_CFLAGS := $(shell pkg-config --cflags x11 xext xinerama xrandr xft fontconfig dbus-1 xtst libpng tesseract lept 2>/dev/null)
PKG_LIBS := $(shell pkg-config --libs x11 xext xinerama xrandr xft fontconfig dbus-1 xtst libpng tesseract lept 2>/dev/null)
# Use pkg-config if available
ifneq ($(PKG_LIBS),)
@@ -128,7 +128,7 @@ $(BIN_DIR):
install: $(TARGET)
@echo "Installing DWN..."
@install -Dm755 $(TARGET) $(DESTDIR)$(BINDIR)/dwn
@install -Dm644 scripts/dwn.desktop $(DESTDIR)$(DATADIR)/xsessions/dwn.desktop
@install -Dm644 examples/dwn.desktop $(DESTDIR)$(DATADIR)/xsessions/dwn.desktop
@mkdir -p $(DESTDIR)$(SYSCONFDIR)/dwn
@install -Dm644 config/config.example $(DESTDIR)$(SYSCONFDIR)/dwn/config.example
@echo ""
@@ -204,9 +204,15 @@ deps:
libxinerama-dev \
libxrandr-dev \
libxft-dev \
libxtst-dev \
libfontconfig1-dev \
libdbus-1-dev \
libcurl4-openssl-dev \
libpng-dev \
libtesseract-dev \
libleptonica-dev \
tesseract-ocr \
tesseract-ocr-eng \
xserver-xephyr \
dmenu; \
echo ""; \
@@ -220,8 +226,13 @@ deps:
libXext-devel \
libXinerama-devel \
libXrandr-devel \
libXtst-devel \
dbus-devel \
libcurl-devel \
libpng-devel \
tesseract-devel \
leptonica-devel \
tesseract-langpack-eng \
xorg-x11-server-Xephyr \
dmenu; \
echo ""; \
@@ -235,8 +246,13 @@ deps:
libxext \
libxinerama \
libxrandr \
libxtst \
dbus \
curl \
libpng \
tesseract \
tesseract-data-eng \
leptonica \
xorg-server-xephyr \
dmenu; \
echo ""; \
@@ -247,7 +263,7 @@ deps:
echo "Please install these packages manually:"; \
echo " - GCC and Make"; \
echo " - pkg-config"; \
echo " - X11, Xext, Xinerama, Xrandr development libraries"; \
echo " - X11, Xext, Xinerama, Xrandr, Xtst development libraries"; \
echo " - D-Bus development library"; \
echo " - libcurl development library"; \
echo " - Xephyr (for testing)"; \