Skip to content

Instantly share code, notes, and snippets.

@mattrose
Created September 17, 2020 18:06
Show Gist options
  • Save mattrose/ab689f450e3fee33fe286d49b3d78945 to your computer and use it in GitHub Desktop.
Save mattrose/ab689f450e3fee33fe286d49b3d78945 to your computer and use it in GitHub Desktop.
attempt at vte with background image
from gi.repository import Gtk, Gdk, GdkPixbuf,Vte,GLib
import cairo
win = Gtk.Window()
terminal = Vte.Terminal()
terminal.spawn_async(
Vte.PtyFlags.DEFAULT,
None,
["/bin/zsh"],
None,
GLib.SpawnFlags.DO_NOT_REAP_CHILD,
None,
None,
-1,
None,
None,
None,
)
pb = GdkPixbuf.Pixbuf.new_from_file("IMG_0001.JPG")
def on_draw(self,cr):
Gdk.cairo_set_source_pixbuf(cr, pb, 0, 0)
print(cr.get_source().get_surface())
cr.paint()
terminal.connect("draw",on_draw)
win.add(terminal)
win.show_all()
Gtk.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment