77import os
88
99def check_sddmk_complete (self ):
10- with open (fn .sddm_default_d2 , "r" , encoding = "utf-8" ) as f :
11- lines = f .readlines ()
12- f .close ()
13- flag_a = False
14- flag_s = False
15- flag_u = False
16- flag_t = False
17- flag_c = False
18- flag_ct = False
19- flag_f = False
20-
21- for line in lines :
22- if "[Autologin]" in line :
23- flag_a = True
24- if "Session=" in line :
25- flag_s = True
26- if "User=" in line :
27- flag_u = True
28- if "[Theme]" in line :
29- flag_t = True
30- if "Current=" in line :
31- flag_c = True
32- if "CursorTheme=" in line :
33- flag_ct = True
34- if "Font=" in line :
35- flag_f = True
36-
37- if flag_a and flag_s and flag_u and flag_t and flag_c and flag_ct and flag_f :
38- return True
39- else :
40- return False
10+ try :
11+ with open (fn .sddm_default_d2 , "r" , encoding = "utf-8" ) as f :
12+ lines = f .readlines ()
13+ f .close ()
14+ flag_a = False
15+ flag_s = False
16+ flag_u = False
17+ flag_t = False
18+ flag_c = False
19+ flag_ct = False
20+ flag_f = False
21+
22+ for line in lines :
23+ if "[Autologin]" in line :
24+ flag_a = True
25+ if "Session=" in line :
26+ flag_s = True
27+ if "User=" in line :
28+ flag_u = True
29+ if "[Theme]" in line :
30+ flag_t = True
31+ if "Current=" in line :
32+ flag_c = True
33+ if "CursorTheme=" in line :
34+ flag_ct = True
35+ if "Font=" in line :
36+ flag_f = True
37+
38+ if flag_a and flag_s and flag_u and flag_t and flag_c and flag_ct and flag_f :
39+ return True
40+ else :
41+ return False
42+ except Exception as FileNotFoundError :
43+ print ("---------------------------------------------------------------------------" )
44+ print ("Type 'fix-sddm-conf' in a terminal and restart ATT" )
45+ print ("---------------------------------------------------------------------------" )
4146
4247def check_sddmk_session (value ):
4348 with open (fn .sddm_default_d2 , "r" , encoding = "utf-8" ) as myfile :
@@ -252,4 +257,4 @@ def pop_login_managers_combo (self,combo):
252257 if fn .check_content ("lightdm" , "/etc/systemd/system/display-manager.service" ):
253258 self .login_managers_combo .set_active (1 )
254259 if fn .check_content ("lxdm" , "/etc/systemd/system/display-manager.service" ):
255- self .login_managers_combo .set_active (2 )
260+ self .login_managers_combo .set_active (2 )
0 commit comments