diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-02-22 09:16:12 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-02-22 09:16:12 +0100 |
commit | 33da6f7c86708e12ee12a554ee897620f73ead1c (patch) | |
tree | 492f1e2e6083644e041ef4312934e89871cd73f7 /i3/scripts | |
parent | dc73e8ff0ca58e3b2bd8b61d6a2deacb06016963 (diff) |
Update config to vnc
Diffstat (limited to 'i3/scripts')
-rw-r--r-- | i3/scripts/i3/negate_color.py | 25 | ||||
-rwxr-xr-x | i3/scripts/i3/wallpaper.sh | 7 |
2 files changed, 31 insertions, 1 deletions
diff --git a/i3/scripts/i3/negate_color.py b/i3/scripts/i3/negate_color.py new file mode 100644 index 0000000..a7f985c --- /dev/null +++ b/i3/scripts/i3/negate_color.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys + +def RGBToHTMLColor(rgb_tuple): + """ convert an (R, G, B) tuple to #RRGGBB """ + hexcolor = '#%02x%02x%02x' % rgb_tuple + # that's it! '%02x' means zero-padded, 2-digit hex values + return hexcolor + +def HTMLColorToRGB(colorstring): + """ convert #RRGGBB to an (R, G, B) tuple """ + colorstring = colorstring.strip() + if colorstring[0] == '#': colorstring = colorstring[1:] + if len(colorstring) != 6: + raise ValueError, "input #%s is not in #RRGGBB format" % colorstring + r, g, b = colorstring[:2], colorstring[2:4], colorstring[4:] + r, g, b = [int(n, 16) for n in (r, g, b)] + return (r, g, b) + + +if __name__ == "__main__": + r, g, b = HTMLColorToRGB(sys.argv[1]) + print RGBToHTMLColor((255 -r, 255-g, 255-b)) diff --git a/i3/scripts/i3/wallpaper.sh b/i3/scripts/i3/wallpaper.sh index 20ef0c9..adff385 100755 --- a/i3/scripts/i3/wallpaper.sh +++ b/i3/scripts/i3/wallpaper.sh @@ -17,10 +17,15 @@ image=$1 # -addd "#ffffff00" 10 \ # -addd "#ffffff00" 90 \ # -gradient 0 -hsetroot \ + +if [ -z ${VNCDESKTOP} ]; then + hsetroot \ -fill "${image}" \ -add "#ffffff77" \ -addd "#ffffff77" 2 \ -addd "#ffffff00" 0 \ -addd "#ffffff00" 90 \ -gradient 0 +else + xsetroot -solid grey +end |