Thornton 2 dot Com
1K411

Set a Fractal Plasma Effect As Your Wallpaper

This is part of how I made useful and decorative minimalist desktops for my home and work computers.

Table of Contents

Later on in this series, I'm going to pick a file at random from a list and try to set it as the wallpaper. If anything goes wrong with that, I want to have a fallback where I set a pattern as my wallpaper without a source image. A random fractal plasma effect is a pleasing way to do that.

plasma-wallpaper.sh

I use a personal bin directory for my shellscripts, which means I save plasma-wallpaper.sh to ~/bin/. If you want to use a personal bin directory, don't forget to add $HOME:/bin to the end of the PATH definition in your shell's rc file.

Don't forget to change the geom value in the script below to your actual screen dimensions.

Throughout this series, I'm saving generated wallpaper image and overlay images to ~/pictures/desktop/ to keep everything together.

#!/bin/sh

# Change this to match your screen resolution
# If you don't know it, use one of these commands:
# xwininfo -root | grep geometry
# xdpyinfo | grep -e display -e screen -e dimensions
#
geom="1920x1080"

# Desktop directory where wallpaper lives
#
desktop="${HOME}/pictures/desktop"

# Wallpaper filename
#
wallpaper="${desktop}/wallpaper.png"

# Set a random fractal plasma generation as the current wallpaper.
#
# Usage:
#
#       plasma-wallpaper.sh
#

# Wallpaper functions

plasma() {
  # Create an HD color plasma image, different each time.
  convert -size "${geom}" plasma:fractal "${wallpaper}"
}

# Actually make a wallpaper image
#
plasma