Created
September 17, 2020 18:06
-
-
Save mattrose/ab689f450e3fee33fe286d49b3d78945 to your computer and use it in GitHub Desktop.
attempt at vte with background image
This file contains 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
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