From d5f39135b2d054af23c0af8594ee772b2a544669 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 1 Apr 2018 11:27:57 +1000 Subject: backend: Add random option --- pywal/colors.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pywal/colors.py') diff --git a/pywal/colors.py b/pywal/colors.py index 33b68d5..5472ef5 100644 --- a/pywal/colors.py +++ b/pywal/colors.py @@ -2,6 +2,7 @@ Generate a palette using various backends. """ import os +import random import re import sys @@ -94,6 +95,13 @@ def get(img, light=False, backend="wal", cache_dir=CACHE_DIR): else: print("wal: Generating a colorscheme...") + if backend == "random": + backends = list_backends() + random.shuffle(backends) + backend = backends[0] + + print("wal: Using", backend, "backend.") + # Dynamically import the backend we want to use. # This keeps the dependencies "optional". try: -- cgit v1.2.3