Skip to content

Commit 86eedd3

Browse files
committed
Add support for detecting and doing the right thing for Gershwin users
1 parent 9cbd888 commit 86eedd3

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/add_users.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ def save_selection(self):
2626
name = self.name.get_text()
2727
up = self.password.get_text()
2828
shell = self.sh
29-
hf = '/home/%s' % self.user.get_text()
29+
try:
30+
open('/Users')
31+
hf = '/Users/%s' % self.user.get_text()
32+
except:
33+
hf = '/home/%s' % self.user.get_text()
3034
hst = self.host.get_text()
3135
ul = [uname, name, up, shell, hf]
3236

@@ -86,7 +90,13 @@ def __init__(self, button3):
8690
self.repassword.connect("changed", self.password_verification, button3)
8791
self.label5 = Gtk.Label("Shell")
8892
shell = Gtk.ComboBoxText()
89-
self.sh = '/usr/local/bin/fish'
93+
try:
94+
open('/Users')
95+
self.sh = '/usr/local/bin/zsh'
96+
shell_default = 7
97+
except:
98+
self.sh = '/usr/local/bin/fish'
99+
shell_default = 3
90100
shell.append_text('sh')
91101
shell.append_text('csh')
92102
shell.append_text('tcsh')
@@ -95,7 +105,7 @@ def __init__(self, button3):
95105
shell.append_text('rbash')
96106
shell.append_text('ksh')
97107
shell.append_text('zsh')
98-
shell.set_active(3)
108+
shell.set_active(shell_default)
99109
shell.connect("changed", self.on_shell)
100110
label = Gtk.Label('<b>Set Hostname</b>')
101111
label.set_use_markup(True)

0 commit comments

Comments
 (0)