From 8b5ed549ef4c1b59a056a221aac302b7252b6204 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 14 Sep 2021 21:55:28 +0200 Subject: Gradient over time background --- i3/scripts/i3/wallpaper.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'i3/scripts') diff --git a/i3/scripts/i3/wallpaper.sh b/i3/scripts/i3/wallpaper.sh index adff385..9bf88d4 100755 --- a/i3/scripts/i3/wallpaper.sh +++ b/i3/scripts/i3/wallpaper.sh @@ -18,7 +18,7 @@ image=$1 # -addd "#ffffff00" 90 \ # -gradient 0 -if [ -z ${VNCDESKTOP} ]; then +if [ -z "${VNCDESKTOP}" ]; then hsetroot \ -fill "${image}" \ -add "#ffffff77" \ @@ -27,5 +27,19 @@ if [ -z ${VNCDESKTOP} ]; then -addd "#ffffff00" 90 \ -gradient 0 else - xsetroot -solid grey -end + #dominant=$(hexdump -n 3 -e '"%06X" 1 "\n"' /dev/urandom) + + # Traverse the chromatic circle in 5 hours + cutoff=18000 + + dominant=$(python3 -c "import colorsys ; import datetime ; now = datetime.datetime.now() ; min = datetime.datetime.min ; sec = (now - min).seconds % $cutoff ; print(''.join('%02x' % int(i*255) for i in colorsys.hsv_to_rgb(sec/$cutoff, 0.35, 1)))") + hsetroot \ + -solid "#${dominant}" \ + -add "#d8dee9ff" \ + -addd "#d8dee9ff" 5 \ + -addd "#ffffff77" 40 \ + -addd "#ffffff77" 90 \ + -addd "#F0F0F0FF" 40 \ + -addd "#F0F0F0" 5 \ + -gradient 0 +fi -- cgit v1.2.3