I am creating a simple terminal in python using vte.Terminal. I want to have a certain level of transparency against the background of the terminal, but set_opacity does not work. but it works in terminators and other terminals.
window.set_opacity makes the whole window transparent, but I do not want the title bit to be transparent. here is the code.
import vte
import gtk
import pango
import os
import signal
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.connect('destroy', lambda w: gtk.main_quit())
window.resize(640, 480)
terminal = vte.Terminal()
terminal.connect("child-exited", lambda w: gtk.main_quit())
terminal.set_scrollback_lines(5000)
terminal.set_encoding("UTF-8")
terminal.set_cursor_blinks(False)
terminal.set_opacity (45000)
font = pango.FontDescription()
font.set_family("Ubuntu Mono")
font.set_size(11 * pango.SCALE)
font.set_weight(pango.WEIGHT_NORMAL)
font.set_stretch(pango.STRETCH_NORMAL)
terminal.set_font_full(font, True)
child_pid = terminal.fork_command()
scroll = gtk.ScrolledWindow()
scroll.set_policy(0,1)
scroll.add_with_viewport(terminal)
window.add(scroll)
window.show_all()
terminal.set_size(500,0)
try:
gtk.main()
except KeyboardInterrupt:
pass
source
share