grassleaff/Xoverdraw
Draw on screen with Xoverdraw, a SDL2 lightweight X11 screen annotation overlay written in C. It runs as a borderless, always-on-top, transparent window that lets you draw directly over whatever is on your screen.
annotation-tool
c
desktop-tool
draw
drawing
drawing-tool
graphics
i3
i3wm
linux
on-screen-drawing
overlay
screen-annotation
screen-overlay
screen-utility
screenwriting
sdl2
teaching
teaching-tool
x11
xfce
xorg
| assets | Updating README.md with logo and some other changes | |
| src | ADD: Implementing shape mode ("F" bind key) | |
| .gitignore | FIX: Fix binary name + Installing assets/ system-wide on /usr/share/Xoverdraw/ to fix eraser circle cursor | |
| LICENSE | Initial commit | |
| Makefile | FIX: Fix binary name + Installing assets/ system-wide on /usr/share/Xoverdraw/ to fix eraser circle cursor | |
| README.md | ADD: Implementing shape mode ("F" bind key) | |
accessibility text
A SDL2 lightweight X11 screen annotation overlay written in C. It runs as a borderless, always-on-top, transparent window that lets you draw directly over whatever is on your screen.
Dependencies
On Debian/Ubuntu:
sudo apt install build-essential pkg-config libsdl2-dev libsdl2-image-dev \
libx11-dev libxrender-dev
Build & Run
make
./Xoverdraw
Controls
| Input | Action |
|---|---|
| Left mouse button | Draw with brush |
| Right mouse button | Erase while held |
F |
Toggle shape mode |
Tab |
Cycle shape: rectangle, ellipse, line, arrow |
Shift + Tab |
Cycle shape backwards |
1 – 5 |
Select color from palette |
[ / ] or scroll wheel |
Decrease / increase held tool size |
Shift + size adjustment |
Fine-tune size in increments of 1 |
Z |
Undo last stroke or shape |
C |
Clear canvas |
O |
Toggle window opacity |
Esc or Q |
Quit |
Configuration
All user-tweakable options live in src/include/config.h.
After editing, rebuild with:
make clean && make
The following settings are available:
| Constant | Description |
|---|---|
XOVERDRAW_INITIAL_BRUSH_SIZE |
Starting brush radius (default: 5) |
XOVERDRAW_INITIAL_ERASER_SIZE |
Starting eraser radius (default: 50) |
XOVERDRAW_MIN_TOOL_SIZE / MAX |
Allowed size range (default: 2 – 120) |
XOVERDRAW_TOOL_SIZE_STEP |
Size increment per keypress/scroll (default: 2) |
XOVERDRAW_DEFAULT_BRUSH_COLOR_INDEX |
Index into the palette for the initial color |
XOVERDRAW_PALETTE |
Five RGBA colors: red, green, blue, yellow, white |
XOVERDRAW_WINDOW_OPACITY |
Normal window opacity (default: 1.0) |
XOVERDRAW_DIMMED_WINDOW_OPACITY |
Dimmed opacity toggled with O (default: 0.42) |
XOVERDRAW_CURSOR_* |
Brush cursor appearance (color, shadow, crosshair geometry) |
XOVERDRAW_SHAPE_CURSOR_* |
Shape cursor dimensions |
XOVERDRAW_ERASER_CURSOR_* |
Eraser cursor appearance (color, shadow, thickness, smoothing) |
XOVERDRAW_ERASER_CURSOR_IMAGE |
Path to the PNG used as the eraser cursor overlay |
X11 Transparency
Real window transparency on X11 requires two things:
- A 32-bit ARGB visual, which Xoverdraw selects automatically via
SDL_HINT_VIDEO_X11_WINDOW_VISUALID. - An active compositor such as
picom,mutter,kwin, or the XFCE compositor.
Without a compositor, ARGB windows typically render as solid black. Xoverdraw prints a warning to stderr when it detects this situation.
License
MIT License — Copyright (c) 2026 grassleaff.