diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-14 21:55:28 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-14 21:55:28 +0200 |
commit | 8b5ed549ef4c1b59a056a221aac302b7252b6204 (patch) | |
tree | f044d4c8c42c6a6935d101c9fd7f138a174cbc3b /i3 | |
parent | 1fa228f8d3695a0b6af4d98769fe479b802ad381 (diff) |
Gradient over time background
Diffstat (limited to 'i3')
-rwxr-xr-x | i3/scripts/i3/wallpaper.sh | 20 |
1 files changed, 17 insertions, 3 deletions
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 |