- C 95.9%
- Shell 2.2%
- Python 1%
- Makefile 0.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| fonts | ||
| src | ||
| tests | ||
| tools | ||
| vendor/include | ||
| .gitignore | ||
| charplayer.desktop.in | ||
| charplayer.svg | ||
| charviewer.desktop.in | ||
| charviewer.svg | ||
| desktop.sh | ||
| Makefile | ||
| README.md | ||
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
HOMEandXDG_*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)
python3andldd- 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)