Skip to content

Commit 9116c01

Browse files
AdWMGUI 1.8
1 parent ebbfd21 commit 9116c01

File tree

12 files changed

+850
-132
lines changed

12 files changed

+850
-132
lines changed

AdWMFuncLib/About/about.py

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,46 @@
66
A Copy of This Software is published on GitHub To view: https://github.com/LinuxUsersLinuxMint/AdWMGUI """
77

88
from AdWMGUILang.lang import *
9+
from Theme.theme import *
910

10-
def AboutMsgBox():
11-
about = Tk()
12-
about.title(about_title)
13-
about.geometry("500x500")
14-
about.resizable(FALSE,FALSE)
15-
about_label = Label(about, text=app_information_title, font=("Arial", 12, "bold"), anchor="w", justify=LEFT)
11+
resx = config['About']['xsupportforresizability']
12+
resy = config['About']['ysupportforresizability']
13+
14+
def close(event=None):
15+
window.destroy()
16+
17+
def About():
18+
global window
19+
window = Tk()
20+
window.title(about_title)
21+
window.geometry("500x500")
22+
window.resizable(resx,resy)
23+
window.configure(bg=window_bg)
24+
about_label = Label(window, text=app_information_title, font=("Arial", 12, "bold"), anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
1625
about_label.pack(fill="x", anchor="w")
17-
app_name = Label(about, text=app_name_txt, anchor="w", justify=LEFT)
26+
app_name = Label(window, text=app_name_txt, anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
1827
app_name.pack(fill="x", anchor="w")
19-
app_version = Label(about, text=app_version_txt, anchor="w", justify=LEFT)
28+
app_version = Label(window, text=app_version_txt, anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
2029
app_version.pack(fill="x", anchor="w")
21-
version_type = Label(about, text=app_version_type_txt, anchor="w", justify=LEFT)
30+
version_type = Label(window, text=app_version_type_txt, anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
2231
version_type.pack(fill="x", anchor="w")
23-
licence_information = Label(about, text=licence_information_title, font=("Arial",12,"bold"),anchor="w",justify=LEFT)
32+
licence_information = Label(window, text=licence_information_title, font=("Arial",12,"bold"),anchor="w",justify=LEFT, bg=label_bg, fg=label_fg)
2433
licence_information.pack(fill="x", anchor="w")
25-
licence_name = Label(about, text=licence_name_txt, anchor="w", justify=LEFT)
34+
licence_name = Label(window, text=licence_name_txt, anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
2635
licence_name.pack(fill="x", anchor="w")
27-
licence_version = Label(about, text=licence_version_txt, anchor="w", justify=LEFT)
36+
licence_version = Label(window, text=licence_version_txt, anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
2837
licence_version.pack(fill="x", anchor="w")
29-
full_licence_name = Label(about, text=full_licence_name_txt, anchor="w", justify=LEFT)
38+
full_licence_name = Label(window, text=full_licence_name_txt, anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
3039
full_licence_name.pack(fill="x", anchor="w")
31-
creator_information = Label(about, text=manufacturer_information_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT)
40+
creator_information = Label(window, text=manufacturer_information_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
3241
creator_information.pack(fill="x", anchor="w")
33-
creator_name = Label(about, text=manufacturer_name_txt, anchor="w", justify=LEFT)
42+
creator_name = Label(window, text=manufacturer_name_txt, anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
3443
creator_name.pack(fill="x", anchor="w")
35-
organization = Label(about, text=organization_txt, anchor="w", justify=LEFT)
44+
organization = Label(window, text=organization_txt, anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
3645
organization.pack(fill="x", anchor="w")
37-
website_information = Label(about, text=website_information_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT)
46+
website_information = Label(window, text=website_information_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
3847
website_information.pack(fill="x", anchor="w")
39-
organization_website = Label(about, text=organization_website_txt, anchor="w", justify=LEFT)
48+
organization_website = Label(window, text=organization_website_txt, anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
4049
organization_website.pack(fill="x", anchor="w")
41-
about.mainloop()
50+
window.bind('<Control-w>', close)
51+
window.mainloop()

AdWMFuncLib/ShutdownPC/shutdownpc.py

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,86 @@
55
Bu Yazılımın Bir Kopyası GitHub da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/AdWMGUI
66
A Copy of This Software is published on GitHub To view: https://github.com/LinuxUsersLinuxMint/AdWMGUI """
77

8+
import os
89
from tkinter import messagebox
910
from AdWMFuncLib.Systemrepair import *
1011
from AdWMFuncLib.Systemclean import *
1112
from tkinter import font
13+
from Theme.theme import *
1214

1315
def get_input():
1416
user_input = str(private_time_input.get("1.0", "end-1c"))
15-
print(user_input)
16-
os.system("cmd.exe /c shutdown -s -t {0}". format(user_input))
17+
shutdownpc(user_input)
1718

1819
def shutdownpc(second):
1920
os.system("cmd.exe /c shutdown -s -t {0}". format(second))
20-
print(second)
21+
22+
resx = config['ShutdownPC']['xsupportforresizability']
23+
resy = config['ShutdownPC']['ysupportforresizability']
24+
25+
def close(event=None):
26+
window.destroy()
2127

2228
def ShutdownPC():
29+
global window
2330
global private_time_input
2431
if messagebox.askyesno(adwmgui_txt_title, shutdownpc_askyesno_txt_title) == True:
2532
window = Tk()
2633
window.title(shutdownpc_title)
2734
window.geometry("500x500")
28-
window.resizable(FALSE,FALSE)
29-
quick_access = Label(window, text=quick_access_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT)
35+
window.resizable(resx,resy)
36+
window.configure(bg=window_bg)
37+
quick_access = Label(window, text=quick_access_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
3038
quick_access.pack(fill="x", anchor="w")
31-
zero_second = Button(window, text="0", width=10, command=lambda: shutdownpc(0))
39+
zero_second = Button(window, text="0", width=10, command=lambda: shutdownpc(0), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
3240
zero_second.place(x=5, y=35)
33-
five_second = Button(window, text="5", width=10, command=lambda: shutdownpc(5))
41+
five_second = Button(window, text="5", width=10, command=lambda: shutdownpc(5), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
3442
five_second.place(x=85, y=35)
35-
ten_second = Button(window, text="10", width=10, command=lambda: shutdownpc(10))
43+
ten_second = Button(window, text="10", width=10, command=lambda: shutdownpc(10), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
3644
ten_second.place(x=165, y=35)
37-
fifteen_second = Button(window, text="15", width=10, command=lambda: shutdownpc(15))
45+
fifteen_second = Button(window, text="15", width=10, command=lambda: shutdownpc(15), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
3846
fifteen_second.place(x=245, y=35)
39-
twenty_second = Button(window, text="20", width=10, command=lambda: shutdownpc(20))
47+
twenty_second = Button(window, text="20", width=10, command=lambda: shutdownpc(20), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
4048
twenty_second.place(x=325, y=35)
41-
twentyfive_second = Button(window, text="25", width=10, command=lambda: shutdownpc(25))
49+
twentyfive_second = Button(window, text="25", width=10, command=lambda: shutdownpc(25), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
4250
twentyfive_second.place(x=405, y=35)
43-
thirty_second = Button(window, text="30", width=10, command=lambda: shutdownpc(30))
51+
thirty_second = Button(window, text="30", width=10, command=lambda: shutdownpc(30), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
4452
thirty_second.place(x=5, y=70)
45-
thirtyfive_second = Button(window, text="35", width=10, command=lambda: shutdownpc(35))
53+
thirtyfive_second = Button(window, text="35", width=10, command=lambda: shutdownpc(35), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
4654
thirtyfive_second.place(x=85, y=70)
47-
fourty_second = Button(window, text="40", width=10, command=lambda: shutdownpc(40))
55+
fourty_second = Button(window, text="40", width=10, command=lambda: shutdownpc(40), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
4856
fourty_second.place(x=165, y=70)
49-
fourtyfive_second = Button(window, text="45", width=10, command=lambda: shutdownpc(45))
57+
fourtyfive_second = Button(window, text="45", width=10, command=lambda: shutdownpc(45), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
5058
fourtyfive_second.place(x=245, y=70)
51-
fifty_second = Button(window, text="50", width=10, command=lambda: shutdownpc(50))
59+
fifty_second = Button(window, text="50", width=10, command=lambda: shutdownpc(50), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
5260
fifty_second.place(x=325, y=70)
53-
fiftyfive_second = Button(window, text="55", width=10, command=lambda: shutdownpc(55))
61+
fiftyfive_second = Button(window, text="55", width=10, command=lambda: shutdownpc(55), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
5462
fiftyfive_second.place(x=405, y=70)
55-
sixty_second = Button(window, text="60", width=10, command=lambda: shutdownpc(60))
63+
sixty_second = Button(window, text="60", width=10, command=lambda: shutdownpc(60), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
5664
sixty_second.place(x=5, y=105)
57-
private_time = Label(window, text=private_time_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT)
65+
private_time = Label(window, text=private_time_title, font=("Arial",12,"bold"), bg=label_bg, fg=label_fg)
5866
private_time.place(y=140)
59-
private_time_input = Text(window, width=15, height=1)
67+
private_time_input = Entry(window, width=20, font=("Arial",12,"bold"), bg=entry_bg, fg=entry_fg, insertbackground=entry_instert_bg)
6068
private_time_input.place(x=5, y=170)
61-
private_time_button = Button(window, text=private_time_button_title, width=13, command=get_input)
62-
private_time_button.place(x=135, y=170)
63-
all_operations_shutdownpc = Label(window, text=all_operations_shutdownpc_title_, font=("Arial",12,"bold"), anchor="w", justify=LEFT)
69+
private_time_button = Button(window, text=private_time_button_title, width=13, command=get_input, bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
70+
private_time_button.place(x=195, y=170)
71+
all_operations_shutdownpc = Label(window, text=all_operations_shutdownpc_title_, font=("Arial",12,"bold"), bg=label_bg, fg=label_fg)
6472
all_operations_shutdownpc.place(y=200)
65-
all_operations_shutdownpc_button = Button(window, text=all_operations_shutdownpc_title, command=all_operations_ShutdownPC)
73+
all_operations_shutdownpc_button = Button(window, text=all_operations_shutdownpc_title, command=all_operations_ShutdownPC, bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
6674
all_operations_shutdownpc_button.place(x=5, y=230)
75+
window.bind('<Control-w>', close)
6776
window.mainloop()
6877
else:
6978
print(shutdownpc_askyesno_cancel_txt_title)
7079

7180
def all_operations_ShutdownPC():
7281
if messagebox.askyesno(adwmgui_txt_title, shutdownpc_askyesno_txt_title) == True:
7382
time(0.5)
74-
OpenCleanmgr()
83+
Cleanmgr()
7584
time(0.5)
76-
AdvancedCleanup()
85+
DISMClean(mode="auto")
7786
time(0.5)
78-
RepairSystem()
87+
RepairSystem(mode="auto")
7988
time(0.5)
8089
shutdownpc(0)
8190
else:

AdWMFuncLib/Systemclean.py

Lines changed: 79 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,89 @@
55
Bu Yazılımın Bir Kopyası GitHub da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/AdWMGUI
66
A Copy of This Software is published on GitHub To view: https://github.com/LinuxUsersLinuxMint/AdWMGUI """
77

8-
import os
8+
import subprocess, threading
99
from tkinter import *
1010
from tkinter import messagebox
1111
from AdWMGUILang.lang import *
1212
from PyAppDevKit.pyappdevkit import *
13+
from Theme.theme import *
1314

14-
def OpenCleanmgr():
15-
os.system("cleanmgr.exe")
15+
def Cleanmgr():
16+
try:
17+
threading.Thread(target=lambda: subprocess.run(["cleanmgr.exe","/autoclean"])).start()
18+
messagebox.showinfo("AdWMGUI", cleanmgr_success_title)
19+
except subprocess.CalledProcessError:
20+
messagebox.showerror("AdWMGUI", cleanmgr_fail_title)
1621

17-
def AdvancedCleanup():
18-
if messagebox.askyesno(adwmgui_txt_title, show_msg_ask_title) == True:
19-
messagebox.showinfo(adv_cleanup_title, adv_clnp_txt_title)
20-
time(2)
21-
messagebox.showinfo(adv_cleanup_title, adv_cleanup_step_one_txt_title)
22-
os.system("DISM.exe /Online /Cleanup-Image /AnalyzeComponentStore")
23-
time(2)
24-
messagebox.showinfo(adv_cleanup_title, adv_cleanup_step_two_txt_title)
25-
os.system("DISM.exe /Online /Cleanup-Image /StartComponentCleanup")
26-
time(2)
22+
def DISMClean(mode):
23+
if mode == "auto":
24+
threading.Thread(target=lambda: subprocess.run("DISM.exe /Online /Cleanup-Image /AnalyzeComponentStore", shell=True)).start()
25+
threading.Thread(target=lambda: subprocess.run("DISM.exe /Online /Cleanup-Image /StartComponentCleanup", shell=True)).start()
2726
messagebox.showinfo(adv_cleanup_title, adv_clnp_done_title)
28-
else:
29-
os.system("DISM.exe /Online /Cleanup-Image /AnalyzeComponentStore")
30-
time(2)
31-
os.system("DISM.exe /Online /Cleanup-Image /StartComponentCleanup")
27+
elif mode == "manual":
28+
if messagebox.askyesno(adwmgui_txt_title, show_msg_ask_title) == True:
29+
messagebox.showinfo(adv_cleanup_title, adv_clnp_txt_title)
30+
time(2)
31+
messagebox.showinfo(adv_cleanup_title, adv_cleanup_step_one_txt_title)
32+
threading.Thread(target=lambda: subprocess.run("DISM.exe /Online /Cleanup-Image /AnalyzeComponentStore", shell=True)).start()
33+
messagebox.showinfo(adv_cleanup_title, adv_cleanup_step_two_txt_title)
34+
threading.Thread(target=lambda: subprocess.run("DISM.exe /Online /Cleanup-Image /StartComponentCleanup", shell=True)).start()
35+
messagebox.showinfo(adv_cleanup_title, adv_clnp_done_title)
36+
else:
37+
threading.Thread(target=lambda: subprocess.run("DISM.exe /Online /Cleanup-Image /AnalyzeComponentStore", shell=True)).start()
38+
threading.Thread(target=lambda: subprocess.run("DISM.exe /Online /Cleanup-Image /StartComponentCleanup", shell=True)).start()
39+
messagebox.showinfo(adv_cleanup_title, adv_clnp_done_title)
40+
41+
resx = config['SystemClean']['xsupportforresizability']
42+
resy = config['SystemClean']['ysupportforresizability']
43+
44+
def AdvancedCleanup():
45+
advanced_cleanup = [
46+
f'del "{os.environ["WINDIR"]}\\Temp\\*.*" /s /q /f',
47+
f'for /d %p in ("{os.environ["WINDIR"]}\\Temp\\*.*") do rmdir "%p" /s /q',
48+
49+
f'del "{os.environ["TMP"]}\\*.*" /s /q /f',
50+
f'for /d %p in ("{os.environ["TMP"]}\\*.*") do rmdir "%p" /s /q',
51+
52+
f'del "{os.environ["WINDIR"]}\\Prefetch\\*.*" /s /q /f',
53+
f'for /d %p in ("{os.environ["WINDIR"]}\\Prefetch\\*.*") do rmdir "%p" /s /q',
54+
55+
f'del "{os.environ["USERPROFILE"]}\\AppData\\Local\\Temp\\*.*" /s /q /f',
56+
f'for /d %p in ("{os.environ["USERPROFILE"]}\\AppData\\Local\\Temp\\*.*") do rmdir "%p" /s /q',
57+
58+
f'del "{os.environ["WINDIR"]}\\SoftwareDistribution\\Download\\*.*" /s /q /f',
59+
f'for /d %p in ("{os.environ["WINDIR"]}\\SoftwareDistribution\\Download\\*.*") do rmdir "%p" /s /q'
60+
]
61+
threads = []
62+
for clean in advanced_cleanup:
63+
t = threading.Thread(target=lambda: subprocess.run(clean, shell=True))
64+
t.start()
65+
threads.append(t)
66+
67+
for t in threads:
68+
t.join()
69+
70+
messagebox.showinfo(adv_cleanup_title, adv_clnp_done_title)
71+
72+
def close(event=None):
73+
window.destroy()
74+
75+
def SystemClean():
76+
global window
77+
window = Tk()
78+
window.title(system_clean_title)
79+
window.geometry("500x300")
80+
window.resizable(resx,resy)
81+
window.configure(bg=window_bg)
82+
quick_clean_label = Label(window, text=quick_clean_title, font=("Arial",12,"bold"), anchor="w", justify=LEFT, bg=label_bg, fg=label_fg)
83+
quick_clean_label.pack(fill="x", anchor="w")
84+
quick_clean = Button(window, text=sysclean_tray_title, command=Cleanmgr, bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
85+
quick_clean.place(x=5, y=35)
86+
advanced_clean_label = Label(window, text=adv_clean_title, font=("Arial",12,"bold"), bg=label_bg, fg=label_fg)
87+
advanced_clean_label.place(y=70)
88+
advanced_clean = Button(window, text=sysclean_advanced_clean_title, command=AdvancedCleanup, bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
89+
advanced_clean.place(x=5, y=100)
90+
advancedsystemclean = Button(window, text=advanced_system_clean_title, command=lambda: DISMClean(mode="manual"), bg=button_bg, fg=button_fg, activebackground=button_active_bg, activeforeground=button_active_fg)
91+
advancedsystemclean.place(x=105, y=100)
92+
window.bind('<Control-w>', close)
93+
window.mainloop()

0 commit comments

Comments
 (0)