Skip to content

Instantly share code, notes, and snippets.

@noerw
Created October 14, 2018 23:06
Show Gist options
  • Save noerw/a8c85a8a04805c2b54d50280d0e80387 to your computer and use it in GitHub Desktop.
Save noerw/a8c85a8a04805c2b54d50280d0e80387 to your computer and use it in GitHub Desktop.
convert GLSL shader to gnome wallpaper slideshow
#!/usr/bin/env bash
shader=$1 # first argument is path to shader
renderstart=0 # seconds
renderend=20
resolutionx=1920
resolutiony=1080
wallduration=20 # seconds, minimum 1
target_dir=`basename $shader`_wallpaper
rm -r $target_dir
mkdir $target_dir
cd $target_dir
# build & install from https://github.com/patriciogonzalezvivo/glslViewer
glslViewer $shader --headless -w $resolutionx -h $resolutiony -e sequence,$renderstart,$renderend -e q
# build & install from https://github.com/almet/gnome-background-generator
gnome-background-generator -d $wallduration -t 0 ./
# set the new background, forcing a config change
dconf write /org/gnome/desktop/background/picture-uri "'/dev/null'"
dconf write /org/gnome/desktop/background/picture-uri "'file://`pwd`/dynamic-wallpaper.xml'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment