7 # FIXME: figure out why we don't get a PID here.
8 def exited_cb(terminal):
11 def nuke(button, (box, terminal)):
13 box.pack_start(terminal)
15 if __name__ == '__main__':
21 # Let the user override them.
22 (shorts, longs) = getopt.getopt(sys.argv[1:], "c:t:f:", ["command=", "terminal=", "font="])
23 for argpair in (shorts + longs):
24 if ((argpair[0] == '-c') or (argpair[0] == '--command')):
25 print "Running command `" + argpair[1] + "'."
27 if ((argpair[0] == '-f') or (argpair[0] == '--font')):
28 print "Setting font to `" + argpair[1] + "'."
30 if ((argpair[0] == '-t') or (argpair[0] == '--terminal')):
31 print "Setting terminal type to `" + argpair[1] + "'."
32 emulation = argpair[1]
34 terminal = vte.Terminal()
35 terminal.set_emulation(emulation)
36 terminal.set_font_from_string(font)
37 terminal.connect("child-exited", exited_cb)
39 # Start up the specified command.
40 child_pid = terminal.fork_command(command)
42 # Start up the default command, the user's shell.
43 child_pid = terminal.fork_command()
45 box.pack_start(terminal)
46 button = gtk.Button("remove")
47 button.connect("pressed", nuke, (box, terminal))
48 box.pack_start(button)