Live Backgrounds DWM is a lightweight program designed to animate live backgrounds for the DWM window manager on Linux systems. The program uses video or GIF conversions to run as animated backgrounds with low CPU usage and optimized performance.
- FPS Control: Fine-tune the frame rate to reduce CPU consumption.
- Frame Amount Control: Manage the number of frames to display.
- Low CPU Usage: Optimized to run smoothly even on older CPUs.
- Efficient Conversion: Convert videos or GIFs into live background formats with clear, sharp results.
-
FFmpeg with the
openh264library installed.On Gentoo Linux, add
openh264to the use flags and re-emerge ffmpeg:sudo emerge --newuse ffmpeg
-
Clone the repository:
git clone https://github.com/radiopushka/LiveBackground cd LiveBackground -
Build the program:
make
-
Run the video conversion script to convert an MP4 or GIF file:
./videconv.sh <video_file>
The script will generate a directory with the
.outputsuffix, containing the converted frames. -
You can now copy the
livebgbinary to any location of your choice:cp livebg /usr/local/bin/
-
Optionally, copy the conversion scripts to easily convert videos in the future:
cp gifcon.sh videconv.sh /usr/local/bin/
After converting an MP4 or GIF to a live background directory, you can run the program using the following syntax:
livebg :0 ./directory.output 20 0:0is the X11 display ID../directory.outputis the output folder generated by the conversion script.20is the frame rate (FPS).0is the frame skip modulus.
- you can run the videoconv.sh script with
ofollowing the filename like for examplevideoconv.sh sample.mp4 o - this will optimize the output for better CPU performorance while still keeping the image relatively sharp.
- It will reduce render CPU usage by half but it will make the image ever so slightly grainy. This could be worth it to get better FPS.
- you can also edit the imagio/imagio.h header file and change the color rendering threshold, this can make things wack so do this at your own risk.
On an Intel i7 8th generation, both X11 and the program will consume approximately 1.9-2.5% of one CPU core at 20 FPS. For higher frame rates (e.g., 24 FPS on an i5), CPU usage could increase to 4-5%, with animation-heavy renders like "The Drive."
The MP4 conversion via the shell script provides a sharp and clear background.
If you'd like to contribute to this project, feel free to contact me at 87.7fmradiopushka@gmail.com.
This project is licensed under the Public Domain.
Readme formated by ChatGPT