No description
  • C 95.9%
  • Shell 2.2%
  • Python 1%
  • Makefile 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
charlotte d7c503258e Initial commit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 22:45:48 +02:00
fonts Initial commit 2026-10-08 22:45:48 +02:00
src Initial commit 2026-10-08 22:45:48 +02:00
tests Initial commit 2026-10-08 22:45:48 +02:00
tools Initial commit 2026-10-08 22:45:48 +02:00
vendor/include Initial commit 2026-10-08 22:45:48 +02:00
.gitignore Initial commit 2026-10-08 22:45:48 +02:00
charplayer.desktop.in Initial commit 2026-10-08 22:45:48 +02:00
charplayer.svg Initial commit 2026-10-08 22:45:48 +02:00
charviewer.desktop.in Initial commit 2026-10-08 22:45:48 +02:00
charviewer.svg Initial commit 2026-10-08 22:45:48 +02:00
desktop.sh Initial commit 2026-10-08 22:45:48 +02:00
Makefile Initial commit 2026-10-08 22:45:48 +02:00
README.md Initial commit 2026-10-08 22:45:48 +02:00

charmedia

charviewer (image viewer) and charplayer (video player): small C apps on SDL3 with a gruvbox dark theme.

Features

  • charviewer opens PNG, JPEG, BMP, TGA, GIF (first frame), WebP, AVIF, HEIC/HEIF, JPEG XL and TIFF
  • Rotate, flip, crop, save and save as, with 20 levels of undo
  • charplayer plays video through libmpv with GPU decoding, remembers where you stopped, and lists recent videos
  • Press ? in either app for its keys, F10 for the menus
  • Writes only inside the project directory: at startup each app points HOME and XDG_* at .data/ and uses Landlock to refuse writes elsewhere

Dependencies

To build: cc, make. Headers are vendored in vendor/include.

To run, the apps link against shared libraries kept in lib/ (not in git). tools/bundle.sh fills lib/ from the libraries installed on your system, so you need these installed first:

  • SDL3, libmpv, FreeType, libpng, libjpeg-turbo (turbojpeg), libheif
  • FFmpeg 6 (libavformat 60, libavcodec 60, libavutil 58, libswscale 7)
  • Wayland client libraries, libxkbcommon, D-Bus, X11 libraries (used by SDL)
  • python3 and ldd
  • A GPU driver with OpenGL/EGL, and the C library; these always come from the system

The bundle script looks for /usr/lib/<name>.so.<version> with the versions above (written for Void Linux), so on other distributions you may need to adjust the library names in tools/bundle.sh.

Build

tools/bundle.sh   # once: copy the libraries into lib/
make

This produces charviewer and charplayer in the project root.

Run

./charviewer [image-or-folder]
./charplayer [video]

With no argument, drop a file or folder onto the window. CHARMEDIA_DEBUG=1 ./charplayer video.mp4 prints mpv warnings and decoder info.

Install

Nothing needs installing; run the binaries from this directory. For launcher entries:

./desktop.sh          # writes charviewer.desktop and charplayer.desktop here
./desktop.sh --link   # also symlinks them into ~/.local/share/applications

Tests

make test

Checks the write lock and the save helper, and round-trips an image through every format charviewer can save.

Layout

src/common/    shared code: containment, OpenGL drawing, UI, image I/O, utilities
src/viewer/    charviewer
src/player/    charplayer
tests/         make test
tools/         bundle.sh, origin.py (library bundling)
vendor/        headers to build against
fonts/         Noto Sans and Noto Serif (SIL OFL)