Custom foreground color for cursor (GUI not implemented yet)

This commit is contained in:
Vulcalien 2021-08-14 15:14:02 +02:00
parent bc3b64570e
commit ee823a9cc9
2 changed files with 13 additions and 7 deletions

View File

@ -215,8 +215,9 @@ DEFAULTS = {
'color_scheme' : 'grey_on_black',
'cursor_blink' : True,
'cursor_shape' : 'block',
'cursor_color' : '',
'cursor_color_fg' : True,
'cursor_fg_color' : '#000000',
'cursor_bg_color' : '#ffffff',
'cursor_color_default' : True,
'term' : 'xterm-256color',
'colorterm' : 'truecolor',
'font' : 'Mono 10',
@ -844,4 +845,3 @@ class ConfigBase(Borg):
def set_layout(self, layout, tree):
"""Set a layout"""
self.layouts[layout] = tree

View File

@ -837,12 +837,18 @@ class Terminal(Gtk.VBox):
def set_cursor_color(self):
"""Set the cursor color appropriately"""
if self.config['cursor_color_fg']:
if self.config['cursor_color_default']:
self.vte.set_color_cursor(None)
self.vte.set_color_cursor_foreground(None)
else:
cursor_color = Gdk.RGBA()
cursor_color.parse(self.config['cursor_color'])
self.vte.set_color_cursor(cursor_color)
# foreground
cursor_fg_color = Gdk.RGBA()
cursor_fg_color.parse(self.config['cursor_fg_color'])
self.vte.set_color_cursor_foreground(cursor_fg_color)
# background
cursor_bg_color = Gdk.RGBA()
cursor_bg_color.parse(self.config['cursor_bg_color'])
self.vte.set_color_cursor(cursor_bg_color)
def get_window_title(self):
"""Return the window title"""