Skip to content

Instantly share code, notes, and snippets.

@641i130
Created July 26, 2022 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 641i130/86a8c2847ff03486c2ed948afb50369d to your computer and use it in GitHub Desktop.
Save 641i130/86a8c2847ff03486c2ed948afb50369d to your computer and use it in GitHub Desktop.
Randomly choose a picture for setting wallpapers on linux
#!/bin/bash
# Note that /landscape/ contains any image file name png,jpg,jpeg and is a landscape image and vise versa for portrait
# This works in order of monitor ID (DP-0 -> DP-2) in that order
feh --bg-fill "$(find /landscape/ -regextype posix-extended -regex '.*\.(png|jpg|jpeg)$' -print0 |shuf -z -n 1)" "$(find /portrait/ -regextype posix-extended -regex '.*\.(png|jpg|jpeg)$' -print0 |shuf -z -n 1)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment