DevXcodeCpp/ascii-wallpaper
Tentang
Live ASCII wallpapers for Linux with hardware-accelerated video decoding, real-time rendering and low CPU usage.
Desain dan mediaYang dapat Anda lakukan
- Sources: video file, image, camera, built-in demo.
- Live desktop layer. A separate X11 "DESKTOP"-type window sits behind all other windows. DING icons remain on top and clickable, and mouse clicks pass through the wallpaper.
- All settings in the GUI: resolution, font, character set, output brightness, contrast and gamma, symbol exposure, color, dithering, effects, and more. Changes are applied on the fly, without restarting.
- Flexible desktop caption: the status line is rendered both in the preview and on live wallpaper. The template supports more than 70 placeholders and all setting fields.
Pertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- Mengumpulkan riwayat
- dalam 15 hari
- Mengumpulkan riwayat
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliLANGUAGE
🇬🇧 English | 🇷🇺 Русский
ASCII Wallpaper
Live, colorful ASCII wallpaper for Linux: turn video, images, a camera feed, or a demo into an animated character canvas right on your desktop.
Fullscreen preview: dense ASCII rendering of a sunset over the mountains.
Main window: live preview, sources, grid, symbols and output settings.
Application settings: interface language, autostart and battery mode.
Русская версия интерфейса и скриншоты — в README.ru.md.
Features
- Sources: video file, image, camera, built-in demo.
- Live desktop layer. A separate X11 "DESKTOP"-type window sits behind all other windows. DING icons remain on top and clickable, and mouse clicks pass through the wallpaper.
- All settings in the GUI: resolution, font, character set, output brightness, contrast and gamma, symbol exposure, color, dithering, effects, and more. Changes are applied on the fly, without restarting.
- Flexible desktop caption: the status line is rendered both in the preview and on live wallpaper. The template supports more than 70 placeholders and all setting fields.
- Russian and English UI. The language is selected in application settings; English is used by default, and Russian or automatic locale detection can be enabled there.
- Application settings: language, autostart, battery mode, pause when covered, and dependency check live in a separate window (gear icon in the header or
Ctrl+,). - Presets: "Winter Night", "Green Terminal", "Neon", "Matrix", "Newspaper", "Dots", "No Effects". Custom presets can be saved.
- Export: a video segment to ".mp4", ".webm", ".gif", or a PNG sequence; save individual frames.
- Resource efficiency: VAAPI hardware decoding with software fallback, "-filter_threads 1", frame rate limiting, and rendering stops when the wallpaper is covered by a window.
- Battery mode: when running on battery, the canvas is automatically reduced to 1280×720, the frame rate is limited to 12 fps, and expensive effects (sparks, bloom, grain) are disabled. No restrictions apply when plugged in. User settings are not modified — once power is restored, everything returns to full quality.
Requirements
- Linux with X11 (tested on GNOME 48 / Mutter / DING).
- Python 3.10+.
- GTK 4 and PyGObject — system packages, not installed via pip.
ffmpegandffprobeinPATH.- Python dependencies:
numpy,Pillow.
Example installation of system packages (Debian/Ubuntu):
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-4.0 ffmpeg
pip install -r requirements.txt
On Fedora:
sudo dnf install python3-gobject gtk4 ffmpeg. On Arch:sudo pacman -S python-gobject gtk4 ffmpeg.
Running
git clone https://github.com/devxcodecpp/ascii-wallpaper.git
cd ascii-wallpaper
pip install -r requirements.txt
./run.sh
Check that everything is present (GTK4, ffmpeg, numpy):
python3 -m ascii_wall --check
Install as a package with the ascii-wall command:
pip install -e .
ascii-wall --check
Add the application to the GNOME application menu:
./install.sh
Prebuilt packages
Release assets include .deb, .rpm, a Flatpak bundle and an Arch
(AUR) package:
sudo apt install ./ascii-wallpaper_*_all.deb # Debian / Ubuntu
sudo dnf install ./ascii-wallpaper-*.noarch.rpm # Fedora
flatpak install --user ascii-wallpaper.flatpak # Flatpak
Build them yourself — see packaging/README.md.
An "ASCII Wallpaper" entry will appear, with a separate "Start wallpaper layer (X11)" action. Remove the launcher (settings and presets will remain):
./uninstall.sh
Usage
- Click "Open" and select a video or image, or drag and drop a file into the window. The "Demo" button launches the built-in scene.
- Adjust the resolution, font, characters, and color using the panel on the right.
- In the "Wallpaper" menu, enable "Enable live wallpaper". A layer will appear on the desktop behind other windows. Change settings and click "Update wallpaper" to apply them immediately. When the settings window is closed, the wallpaper layer continues running in the background.
- F11 or the "Screen" button opens fullscreen preview. Press Esc to return to the settings.
Keyboard shortcuts: Ctrl+O — open, Ctrl+, — settings,
Ctrl+E — export, Ctrl+S — save frame,
Ctrl+F / F11 — fullscreen, Space — pause, Ctrl+Q — quit.
Caption on the desktop
The "Show status line" switch in the Caption section enables the
caption everywhere: in the settings preview and on the live wallpaper.
The template is a regular str.format string; expand "All caption
parameters" in the panel to browse the full list.
Most useful placeholders:
| Placeholder | Meaning |
|---|---|
{title}, {preset} |
Title and current preset |
{clock}, {date}, {weekday} |
Current time, date and weekday |
{time}, {duration}, {frame} |
Position, length and frame number |
{cols}, {rows}, {cells} |
Character grid size |
{fps}, {render_fps} |
Target and actual frame rate |
{out_w}, {out_h} |
Finished image size in pixels |
{source_name}, {source_kind}, {filename} |
Source information |
{color_mode}, {charset}, {font}, {font_size} |
Look of the picture |
{output_brightness}, {output_contrast}, {output_gamma} |
Output tone |
{version} |
Application version |
Every field of the settings model is also available by its name, for
example {scanlines}, {bloom}, {output_brightness} or {speed}.
Unknown placeholders are left as-is instead of breaking the caption.
Autostart and background operation
The "Start wallpaper on login" option in the "Wallpaper" menu creates a file at "~/.config/autostart/ascii-wall.desktop", which launches the regular X11 wallpaper layer ("--desktop-proto") without opening the fullscreen settings window.
The live wallpaper layer runs as a separate process: closing the settings window does not stop it. When you reopen the application, you can update the wallpaper using the "Update wallpaper" button (settings are applied immediately, without restarting), or stop the layer using "Stop live wallpaper".
Battery power
Power status is detected via /sys/class/power_supply/AC*.
| Parameter | On battery | Plugged in |
|---|---|---|
| Resolution | up to 1280×720 | unlimited |
| FPS | up to 12 fps | unlimited |
| Effects | sparks, bloom, and grain disabled | as configured |
These limits are applied to a working copy of the settings; your values remain unchanged in the configuration file and interface. The current mode is displayed in the "Wallpaper" menu, which also includes a separate "Battery optimization" option. It can be disabled to run the application at full quality even on battery power.
ASCII_WALL_NO_POWER_LIMIT=1 ./run.sh
Command line
python3 -m ascii_wall video.mp4 # GUI with video
python3 -m ascii_wall demo # demo-scene
python3 -m ascii_wall video.mp4 --live # fullscreen immediately
python3 -m ascii_wall video.mp4 --desktop-proto # wallpaper layer (X11)
python3 -m ascii_wall --desktop-proto --no-status # wallpaper without caption
python3 -m ascii_wall video.mp4 --export out.mp4 # offline-render
python3 -m ascii_wall video.mp4 --terminal # ASCII in terminal
Useful flags: --fps, --canvas 1920x1080, --font-size,
--preset "Neon", --start, --end, --config path/to/config.json.
How it works
- Frames are read by
ffmpeg, using VAAPI (/dev/dri/renderD*) when available, with fallback to software decoding. - The
fpsandscalefilters run in a single thread: at 12–15 fps, this is significantly cheaper than using all CPU cores. - The source provides frames at a resolution suited to the character grid, rather than full 1080p/4K resolution — excess pixels would be averaged into character cells anyway.
AsciiEnginedownsamples the frame to the character grid, calculates the brightness and color of each cell, selects a glyph, and assembles the final image.- The wallpaper window is a regular frameless GTK4 window. X11 properties
_NET_WM_WINDOW_TYPE_DESKTOP,STICKY,SKIP_TASKBAR,SKIP_PAGER, and an empty input shape are applied to it. This means it does not steal focus or interfere with desktop clicks. - Its position and size are adjusted to fit
_NET_WORKAREA, so it does not extend underneath the panel or dock. - Rendering stops when the wallpaper is fully covered by a maximized or fullscreen window.
The wallpaper does not modify GNOME settings or touch your actual wallpaper files: it is a separate layer that can be disabled at any time. The layer runs in a separate process, so closing the settings window does not stop it. The PID is stored in the application's cache so the GUI can locate and stop the wallpaper layer again.
Performance
Measurements on a 6-core machine, 1920×1080 H.264 source at 15 fps, canvas resolution 1280×720:
| Decoding mode | ffmpeg | Python-render | Total |
|---|---|---|---|
VAAPI + -filter_threads 1 |
~9 % of core | ~9 % of core | ~18 % of one core |
Software, -threads 2 |
~24 % of core | ~9 % of core | ~33 % of one core |
~18–33% of one core is approximately 1.5–3% of the total CPU load on a 12-core CPU. If hardware decoding is unavailable or fails, the application automatically switches to software decoding. To force-disable VAAPI:
ASCII_WALL_NO_HW=1 ./run.sh
If your system has multiple GPUs, you can explicitly select the VAAPI device and increase the frame read timeout for very slow sources:
ASCII_WALL_RENDER_NODE=/dev/dri/renderD129 ./run.sh
ASCII_WALL_READ_TIMEOUT=8 ./run.sh
Limitations
- The live wallpaper layer relies on X11 window properties. It is not available on Wayland, although the GUI and preview still work.
- Three- and four-finger gestures in GNOME on Xorg are not supported by the desktop environment itself — this is unrelated to the application.
- A desktop context-menu entry for launching the wallpaper has not yet been implemented.
Project structure
ascii_wall/
engine.py render ASCII-canvas
pipeline.py frame pipeline, pacing, settings switching
sources.py video/camera/image/demo via ffmpeg
caption.py status-line placeholders and formatting
i18n.py Russian and English UI strings
power.py battery power limits
live.py background wallpaper: PID, reload, autostart
desktop_backend.py X11/Wayland backend selection
x11desk.py X11 layer: desktop window, click-through, work area
ui/ GTK4 interface, preview, dialogs
tests/ unit tests
packaging/ deb, rpm, Flatpak and AUR builds
Tests
python3 -m unittest discover -s tests -q
License
MIT License — see LICENSE for details.
Jelajahi proyek terkait
Memuat…