Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/add_admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

from gi.repository import Gtk, Gdk
import os
import pickle
from gbi_common import password_strength
from sys_handler import set_admin_user
Expand Down Expand Up @@ -29,7 +30,10 @@ def save_selection(self):
name = self.name.get_text()
up = self.password.get_text()
shell = self.sh
hf = f'/home/{uname}'
if os.path.isdir('/Users'):
hf = f'/Users/{uname}'
else:
hf = f'/home/{uname}'
hst = f'{uname}-ghostbsd'
ul = [uname, name, up, shell, hf, hst]
pickle.dump(ul, uf)
Expand Down Expand Up @@ -114,7 +118,10 @@ def __init__(self, button3):
self.repassword.connect("changed", self.password_verification, button3)
self.label5 = Gtk.Label(label="Shell")
shell = Gtk.ComboBoxText()
self.sh = '/usr/local/bin/fish'
if os.path.isdir('/Users'):
self.sh = '/usr/local/bin/zsh'
else:
self.sh = '/usr/local/bin/fish'
# Keeping this code for future project example.
shell.append_text('sh')
shell.append_text('csh')
Expand Down