parallax-wallpaper
parallax-wallpaper copied to clipboard
Multi-platform parallax wallpaper engine
trafficstars
Parallax WallPaper
This allows you to create multi-layered parallax wallpapers.
Each layer moves with Your mouse cursor, creating this beautiful effect.
Installation • Configuration • Creating Wallpapers
https://user-images.githubusercontent.com/38699473/220888934-09788a6b-873c-469b-b147-b345e8a8949a.mp4
Installation
Linux
Installation steps
- Install
SDL2using Your package manager - If You are using
Wayland, You also must installXWayland - Download
.tar.gzpackage from releases - Extract the content to
/:
sudo tar -o -xvf [archive name].tar.gz --directory /
- Test Layered WallPaper by running
lwp - Setting
reload_rootwindow=1in config file may be necessary on some distributions for Layered WallPaper to work properly (see configuration) - To make Layered WallPaper run on startup, add
lwp &command to Your desktop enviroment.rcfile
Build from source instead
- Install
SDL2using Your package manager. On some distributionsSDL2doesn't contain development files, so it may be also necessary to install development version ofSDL2 - If You are using
Wayland, You also must installXWayland - Install
CMake - Clone the repository and prepare a
builddirectory:
git clone https://github.com/jankozik/parallax-wallpaper
cd lwp
mkdir build
cd build
- Compile the project and generate a
.tar.gzpackage
cmake ../
cmake --build .
cpack
- Extract
.tar.gzpackage
sudo tar -o -xvf [archive name].tar.gz --directory /
- Test Layered WallPaper by running
lwp - Setting
reload_rootwindow=1in config file may be necessary on some distributions for Layered WallPaper to work properly (see configuration) - To make Layered WallPaper run on startup, add
lwp &command to Your desktop enviroment.rcfile
macOS
Installation steps
- Download and run the installer from releases
- Drag and drop Layered_WallPaper into Applications
- To make Layered WallPaper run on startup, run Toggle_Autorun.command
- To stop running Layered WallPaper on startup, run it again
Build from source instead
- Install
SDL2(homebrew:brew install sdl2) - To build this project, You need to install
cmake(homebrew:brew install cmake) - Clone the repository:
git clone https://github.com/jankozik/parallax-wallpaper cd lwp - Compile and generate installer
mkdir build cd build cmake ../ cmake --build . cpack -G DragNDrop - DMG installer should appear, open it and drag Layered_WallPaper into Applications
- To make Layered WallPaper run on startup, run Toggle_Autorun.command
- To stop running Layered WallPaper on startup, run it again
Windows
Installation steps
- Download and run the installer from releases
- Layered WallPaper should run immediately after the installation
Build from source instead
- Layered WallPaper is built using cmake, so You must install it.
- This project supports
MinGWandMSVCcompilers. Using different one could lead to unpredicted behavior. If You want to useMSVC, it should be installed with Visual Studio. - Download
SDL2andSDL2-develpackage for Your compiler from SDL2 releases and extract them somewhere. - You also must install NSIS. It's required to build the installer, which is needed to correctly set the registry keys, that will make Layered WallPaper run on OS startup etc.
- Clone the repository and create
builddirectory
git clone https://github.com/jszczerbinsky/lwp
cd lwp
mkdir -p build
cd build
- Type the following commands, replace square brackets elements with paths to extracted
SDL2packages, that You've downloaded:
For MSVC:
cmake -G "Visual Studio 17" -DSDL2_DIR=[PATH TO SDL2-MSVC-DEVEL DIRECTORY]\cmake -DSDL2_RUNTIME_DIR=[PATH TO SDL2 RUNTIME DIRECTORY] ../
cmake --build . --config Release
cpack
For MinGW:
cmake -G "MinGW Makefiles" -DSDL2_DIR=[PATH TO SDL2-MINGW-DEVEL DIRECTORY]\cmake -DSDL2_RUNTIME_DIR=[PATH TO SDL2 RUNTIME DIRECTORY] -DCMAKE_BUILD_TYPE=Release ../
cmake --build .
cpack
- The installer should appear in
builddirectory, that You've created earlier. After completing the installation Layered WallPaper should run immediately.
Configuration
Create a configuration file
Linux
- Copy default config file to
.config/lwp/lwp.cfg:
mkdir ~/.config/lwp
cp /etc/lwp.cfg ~/.config/lwp/lwp.cfg
macOS
- Copy default config file to
~/.config/lwp/lwp.cfg:mkdir -p ~/.config/lwp cp /opt/lwp/lwp.cfg ~/.config/lwp/
Windows
- Press ⊞ Win + R
- Type
%appdata%and pressOk - Create new directory and name it
lwp - Copy file
C:\Program Files\lwp\defaultWin.cfgto directory created in the previous step and rename it tolwp.cfg - Open
lwp.cfgin notepad
Using config file
- Do not put spaces between
=and values - Do not leave trailing spaces
- Comments start with
# - Do not put strings in quotation marks
Available options:
| Type | Name | Description |
|---|---|---|
| int | reload_rootwindow | Set this to 1 if You are using a compositor (linux only) |
| float | smooth | Smooth movement multipler |
| int | monitors | Monitors count |
| int | monitor[n]_x | Position of nth monitor in X axis |
| int | monitor[n]_y | Position of nth monitor in Y axis |
| int | monitor[n]_w | Width of nth monitor |
| int | monitor[n]_h | Height of nth monitor |
| string | monitor[n]_wallpaper | Absolute path to the wallpaper directory |
| int | monitor[n]_wallpaper_x | Position of the wallpaper relative to the monitor |
| int | monitor[n]_wallpaper_y | Position of the wallpaper relative to the monitor |
| int | monitor[n]_wallpaper_w | Wallpaper resolution |
| int | monitor[n]_wallpaper_h | Wallpaper resolution |
| int | target_fps | How many times per second should the wallpaper render (imprecise, hence "target") |
Creating Wallpapers
Parallax wallpapers are not popular. Because of this if You want some cool parallax wallpaper, You have to either find a parallax game background on the internet and use it as a wallpaper or cut some real wallpaper into layers using Gimp or Photoshop.
How to create a wallpaper for Layered WallPaper
- Create a directory for Your wallpaper
- Save each layer to this directory as
.bmpfile and name them1.bmp,2.bmp... (1.bmpis bottom most layer) - Create a wallpaper config file and name it
wallpaper.cfg(You can make a copy fromC:\Program Files\lwp\wallpapers\default-fullhd\wallpaper.cfg)
Example:
File structure:
C:
└ MyCoolWallpaperDirectory
└ wallpaper.cfg
└ 1.bmp
└ 2.bmp
└ 3.bmp
Config file:
| Type | Name | Description |
|---|---|---|
| int | count | Wallpaper layers count |
| float | movement_x | Mouse sensitivity in X axis |
| float | movement_y | Mouse sensitivity in Y axis |
| float | movement[n]_x | Mouse sensitivity in X axis for nth layer (optional) |
| float | movement[n]_y | Mouse sensitivity in Y axis for nth layer (optional) |
| int | repeat_x | Repeat the wallpaper in X axis |
| int | repeat_y | Repeat the wallpaper in Y axis |