Created
October 10, 2015 16:51
-
-
Save pschwede/04d77ebf5fbcae9c9ada to your computer and use it in GitHub Desktop.
Freqently modifies XFCE4 Terminal config to present a different cursor color.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Freqently modifies XFCE4 Terminal config to present a different cursor | |
color.""" | |
from colorsys import hsv_to_rgb | |
import ConfigParser | |
import time | |
def colorgenerator(): | |
"""Generates rgb color triplets while cycling around hue. | |
:return: RGB color | |
:rtype: triple of float | |
""" | |
while True: | |
for i in range(255): | |
i = 3. * i / 255 | |
yield tuple([255*x for x in hsv_to_rgb(i, 1., 1.)]) | |
if __name__ == "__main__": | |
CP = ConfigParser.ConfigParser() | |
CP.optionxform = str | |
CP.read('/home/peter/.config/xfce4/terminal/terminalrc') | |
for color in colorgenerator(): | |
CP.set('Configuration', 'ColorCursor', '#%02x%02x%02x' % color) | |
with open('/home/peter/.config/xfce4/terminal/terminalrc', 'w') as fp: | |
CP.write(fp) | |
time.sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment