From 55c3b7d59cba1a3934f58e68d92edac8b1062ef6 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Thu, 27 Sep 2012 14:56:42 +0200 Subject: [PATCH] Create default groupnames, selected from the Greek alphabet (Alpha, Beta, etc) --- terminatorlib/titlebar.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/terminatorlib/titlebar.py b/terminatorlib/titlebar.py index 7f2e23fb..9150f9b0 100755 --- a/terminatorlib/titlebar.py +++ b/terminatorlib/titlebar.py @@ -5,6 +5,7 @@ import gtk import gobject +import random from version import APP_NAME from util import dbg @@ -233,6 +234,15 @@ class Titlebar(gtk.EventBox): def create_group(self): """Create a new group""" + defaultgroups=set(['Alpha','Beta','Gamma','Delta','Epsilon','Zeta','Eta', + 'Theta','Iota','Kappa','Lambda','Mu','Nu','Xi', + 'Omnicron','Pi','Rho','Sigma','Tau','Upsilon','Phi', + 'Chi','Psi','Omega']) + currentgroups=set(self.terminator.groups) + freegroups = list(defaultgroups-currentgroups) + random.shuffle(freegroups) + if self.groupentry.get_text()=='' and freegroups: + self.groupentry.set_text(freegroups.pop()) self.groupentry.show() self.groupentry.grab_focus() self.update_visibility()