import os
import socket
from tkinter import *

splash_root = Tk()
splash_root.geometry("900x900")
splash_label = Label(splash_root, text='Please Wait, BIOS is loading......')
splash_label.pack(pady=20)
splash_root.title('Loading BIOS...')
def nb():
    splash_root.destroy()

splash_root.after(3000, nb)


mainloop()
login_pass = open('user/password.txt')
login_name = open('user/username.txt')
l_p = login_pass.read()
l_n = login_name.read()
print("""
$$$$$   $$$$$$  $$$$$$  $$$$$$
$    $     $    $    $  $
$$$$$      $    $    $  $$$$$$
$    $     $    $    $       $
$$$$$   $$$$$$  $$$$$$  $$$$$$
""")
b_login = input(str("Please Enter The Password, " + l_n + " to open the BIOS: "))
if b_login == l_p:
    print("BIOS Unlocked!")
    host_name = socket.gethostname()
    host_ip = socket.gethostbyname(host_name)
    print("[1]Username: " + l_n)
    print("[2]Password: " + l_p)
    print("Host Name: ",host_name)
    print("Host IP: " + host_ip)
    edit_b = input("Enter [?] to change settings: ")
    if edit_b == '1':
        new_name = input("New username: ")
        with open('user/username.txt', 'w') as f:
            f.writelines(new_name)
        print("Username changed to " + new_name)
        input("Done!")
    if edit_b == '2':
        print("WARNING THIS WILL CHANGE THE PASSWORD FOR SEB OS")
        new_pas = input("New Password: ")
        with open('user/password.txt', 'w') as f:
            f.writelines(new_pas)
        print("Password Changed to " + new_pas)
        input("Done!")
