From 87228eca79e4755357d266461c917a3186d226cd Mon Sep 17 00:00:00 2001 From: Emmanuel Bretelle Date: Sat, 24 May 2008 15:39:12 +0100 Subject: [PATCH] checking if DISPLAY is set before instanciating Terminator --- terminator | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/terminator b/terminator index 7ba5e91b..d51646b2 100755 --- a/terminator +++ b/terminator @@ -844,7 +844,6 @@ class Terminator: pass self.conf = config.TerminatorConfig (stores) - self.window = gtk.Window () self.window.set_title (APP_NAME.capitalize()) @@ -1426,7 +1425,6 @@ class Terminator: term.reconfigure_vte () if __name__ == '__main__': - def execute_cb (option, opt, value, parser): assert value is None value = [] @@ -1460,7 +1458,12 @@ if __name__ == '__main__': command.append (options.command) if (options.execute): command = options.execute - + + if gtk.gdk.display_get_default() == None: + print >> sys.stderr, _("You need to run terminator in an X environment. " \ + "Make sure DISPLAY is properly set") + sys.exit(1) + term = Terminator (options.profile, command, options.fullscreen, options.maximise, options.borderless) gtk.main ()