Files
kinto/references/gui/vte.py
Ryan Reaves 437a2141ff - Install changes, debug fixes, refinements
- Added setup fixes for gui

- Fixed debug issues & updated copyright

- Uninstaller update, init setup improvements, added open kinto to tray

- Fixed order of operations for args parsing

- Fixed initial radio value of keyboard type in main gui app, removed comments, fixed sys tray default for DE

- File cleanup, relocations and faster setup file

- Do not clobber initkb if it already exists
2020-10-20 23:35:42 -05:00

54 lines
1.8 KiB
Python
Executable File

#!/usr/bin/env python3
from gi.repository import Gtk,GObject, Vte
from gi.repository import GLib
import os
class TheWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="inherited cell renderer")
self.set_default_size(600, 300)
global terminal
terminal = Vte.Terminal()
terminal.spawn_sync(
Vte.PtyFlags.DEFAULT,
os.environ['HOME'],
["/bin/bash"],
[],
GLib.SpawnFlags.DO_NOT_REAP_CHILD,
None,
None,
)
self.button = Gtk.Button("Do The Command")
self.button2 = Gtk.Button("End Command")
self.command = "journalctl -f --unit=xkeysnail.service -b\n"
self.command2 = "send \003; echo 'hello'\n"
# expect -c "send \003;"
self.cmdbytes = str.encode(self.command)
self.cmdbytes2 = str.encode(self.command2)
command = Gtk.Label("The command: "+self.command)
self.button.connect("clicked", self.InputToTerm, self.cmdbytes)
self.button2.connect("clicked", self.InputToTerm, self.cmdbytes2)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(self.button, False, True, 0)
box.pack_start(self.button2, False, True, 0)
box.pack_start(command, False, True, 1)
scroller = Gtk.ScrolledWindow()
scroller.set_hexpand(True)
scroller.set_vexpand(True)
scroller.add(terminal)
box.pack_start(scroller, False, True, 2)
self.add(box)
def InputToTerm(self, clicker, cmd):
terminal.feed_child_binary(cmd)
print(Vte.get_minor_version())
win = TheWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()