Repository navigation
Expand file tree
/
Copy pathGUI.py
More file actions
370 lines (313 loc) ยท 11.8 KB
/
Copy pathGUI.py
File metadata and controls
370 lines (313 loc) ยท 11.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
import subprocess
import customtkinter
import tkinter.messagebox as messagebox # for popups
import scripts.compinfo
import scripts.mouse
import scripts.brightness
import scripts.startup
import scripts.virtualmemory
import scripts.visualfx
import scripts.settings
customtkinter.set_appearance_mode("dark")
customtkinter.set_default_color_theme("blue")
customtkinter.deactivate_automatic_dpi_awareness()
COLORS = {
"primary": "#3b82f6",
"primary_hover": "#2563eb",
"primary_dark": "#1d4ed8",
"secondary": "#8b5cf6",
"success": "#10b981",
"warning": "#f59e0b",
"danger": "#ef4444",
"dark": "#1a1a1a",
"darker": "#0f0f0f",
"card": "gray20",
"card_hover": "gray25",
"text_primary": "white",
"text_secondary": "gray70"
}
PADDING = 20
class App(customtkinter.CTk):
def __init__(self):
super().__init__()
self.title("Windows Optimizer")
self.geometry("1000x650")
self.brightness_text = customtkinter.StringVar()
header_frame = customtkinter.CTkFrame(
self,
corner_radius=10,
fg_color=COLORS['primary'],
height=100
)
header_frame.pack(padx=0, pady=0, fill="x")
header_frame.pack_propagate(False)
title_label = customtkinter.CTkLabel(
header_frame,
text="โก Windows Optimizer",
font=("Bahnschrift", 28, "bold"),
text_color="white"
)
title_label.pack(side="left", padx=30, pady=15)
# Subtitle
subtitle_label = customtkinter.CTkLabel(
header_frame,
text="Optimize and manage your Windows system",
font=("Segoe UI", 12),
text_color="gray90"
)
subtitle_label.place(x=30, y=70)
# ---- TabView ----
self.tab_view = customtkinter.CTkTabview(
master=self,
corner_radius=15,
segmented_button_fg_color="gray15",
segmented_button_selected_color=COLORS["primary"],
segmented_button_unselected_color="gray20",
text_color=COLORS["text_primary"],
segmented_button_unselected_hover_color="gray25"
)
self.tab_view.pack(padx=20, pady=(0, 20), fill="both", expand=True)
self.tab_view.add("๐ป Computer Information")
self.tab_view.add("โจ Visual FX")
self.tab_view.add("๐พ Virtual Memory")
self.tab_view.add("๐ Startup Apps")
self.tab_view.add("๐ฑ๏ธMouse")
self.tab_view.add("โ๏ธ Windows Brightness")
self.tab_view.add("๐ ๏ธ Extra Settings")
# ---- Tabs ----
self.setup_computer_info_tab()
self.setup_visual_fx_tab()
self.setup_virtual_memory_tab()
self.setup_startup_tab()
self.setup_mouse_tab()
self.setup_brightness_tab()
self.setup_extrasettings_tab()
# ---------------- TAB SETUP ----------------
def setup_computer_info_tab(self):
tab = self.tab_view.tab("๐ป Computer Information")
computer_label = customtkinter.CTkLabel(
tab,
text="Learn about your computer information",
font=("Segoe UI", 12),
text_color="gray90"
)
computer_label.place(x=20, y=10)
self.textbox = customtkinter.CTkTextbox(tab, height=200)
self.textbox.pack(padx=25, pady=40, fill="both", expand=True)
button_1 = customtkinter.CTkButton(
tab,
text="Click me computer info",
command=self.show_computer_info
)
button_1.pack(pady=10)
def setup_visual_fx_tab(self):
tab = self.tab_view.tab("โจ Visual FX")
self.fx_label = customtkinter.CTkLabel(
tab,
text="Visual FX Settings",
font=("Segoe UI", 14, "bold")
)
self.fx_label.pack(padx=20, pady=(20, 5), anchor="w")
self.textbox1 = customtkinter.CTkTextbox(tab, height=200)
self.textbox1.pack(padx=25, pady=40, fill="both", expand=True)
self.fx_button = customtkinter.CTkButton(
tab,
text="Check out Virtual FX Settings",
command=self.apply_virtual_fx
)
self.fx_button.pack( pady=20)
def setup_virtual_memory_tab(self):
tab = self.tab_view.tab("๐พ Virtual Memory")
info_frame = customtkinter.CTkFrame(tab, corner_radius=10)
info_frame.pack(padx=PADDING, pady=PADDING, fill="x")
info_label = customtkinter.CTkLabel(
info_frame,
text="๐ฟ Check your virtual memory (page file) settings",
text_color=COLORS["text_secondary"]
)
info_label.pack(padx=15, pady=12, anchor="w")
self.memory_textbox = customtkinter.CTkTextbox(tab, height=300)
self.memory_textbox.pack(padx=PADDING, pady=10, fill="both", expand=True)
# Button to check virtual memory
self.button_vmem = customtkinter.CTkButton(
tab,
text="๐ Check Virtual Memory",
command=self.show_memory_info
)
self.button_vmem.pack(pady=10)
def setup_startup_tab(self):
tab = self.tab_view.tab("๐ Startup Apps")
startup_label = customtkinter.CTkLabel(
tab,
text="Open up Task Manager and access startup apps",
font=("Segoe UI", 12),
text_color="gray90"
)
startup_label.place(x=20, y=10)
self.button_startup = customtkinter.CTkButton(
tab,
text="Open Task Manager",
command=self.open_startup_app
)
self.button_startup.pack(padx=20, pady=45, fill="x")
def setup_mouse_tab(self):
tab = self.tab_view.tab("๐ฑ๏ธMouse")
self.mouse_label = customtkinter.CTkLabel(
tab,
text="Mouse Acceleration Mode",
font=("Segoe UI", 14, "bold")
)
self.mouse_label.pack(padx=20, pady=(20, 5), anchor="w")
self.mouse_button = customtkinter.CTkButton(
tab,
text = "Open Mouse Properties",
command=self.on_mouse_option
)
self.mouse_button.pack(padx=20, pady=5, fill="x")
def setup_brightness_tab(self):
tab = self.tab_view.tab("โ๏ธ Windows Brightness")
self.brightness_label = customtkinter.CTkLabel(
tab,
textvariable=self.brightness_text,
font=("Segoe UI", 14, "bold")
)
self.brightness_label.pack(padx=20, pady=(20, 10), anchor="w")
self.brightness_slider = customtkinter.CTkSlider(
tab,
from_=0,
to=100,
command=self.on_brightness_change
)
self.brightness_slider.pack(padx=20, pady=10, fill="x")
self.show_brightness()
def setup_extrasettings_tab(self):
tab = self.tab_view.tab("๐ ๏ธ Extra Settings")
title_label = customtkinter.CTkLabel(
tab,
text="System Management Tools",
font=("Segoe UI", 18, "bold")
)
title_label.grid(row=0, column=0, columnspan=2, padx=20, pady=(20, 10), sticky="w")
# Configure grid weights for responsive layout
tab.grid_columnconfigure(0, weight=1)
tab.grid_columnconfigure(1, weight=1)
# Row 1
btn1 = customtkinter.CTkButton(
tab,
text="๐ฅ๏ธ Device Manager",
width=40,
height=50,
command=lambda: scripts.settings.MMC.DEVICE_MANAGER.open()
)
btn1.grid(row=1, column=0, padx=10, pady=10, sticky="ew")
btn2 = customtkinter.CTkButton(
tab,
text="โ๏ธ Services",
width=40,
height=50,
command=lambda: scripts.settings.MMC.SERVICES.open()
)
btn2.grid(row=1, column=1, padx=10, pady=10, sticky="ew")
# Row 2
btn3 = customtkinter.CTkButton(
tab,
text="๐ Task Manager",
width=40,
height=50,
command=lambda: scripts.settings.WinSystemTools.Utilities.TASK_MANAGER.open()
)
btn3.grid(row=2, column=0, padx=10, pady=10, sticky="ew")
btn4 = customtkinter.CTkButton(
tab,
text="๐พ Disk Management",
width=40,
height=50,
command=lambda: scripts.settings.MMC.DISK_MANAGEMENT.open()
)
btn4.grid(row=2, column=1, padx=10, pady=10, sticky="ew")
btn5 = customtkinter.CTkButton(
tab,
text="๐พ About System",
width=40,
height=50,
command=lambda: scripts.settings.WinSettings.System.ABOUT.open()
)
btn5.grid(row=3, column=0, padx=10, pady=10, sticky="ew")
btn6 = customtkinter.CTkButton(
tab,
text="๐ฎ Game Bar Settings",
width=40,
height=50,
command=lambda: scripts.settings.WinSettings.Gaming.GAME_BAR.open()
)
btn6.grid(row=3, column=1, padx=10, pady=10, sticky="ew")
btn7 = customtkinter.CTkButton(
tab,
text="๐ Sound Settings",
width=40,
height=50,
command=lambda: scripts.settings.WinControlPanel.Hardware.SOUND.open()
)
btn7.grid(row=4, column=0, padx=10, pady=10, sticky="ew")
btn8 = customtkinter.CTkButton(
tab,
text="๐ Power Options",
width=40,
height=50,
command=lambda: scripts.settings.WinControlPanel.System.POWER_OPTIONS.open()
)
btn8.grid(row=4, column=1, padx=10, pady=10, sticky="ew")
btn9 = customtkinter.CTkButton(
tab,
text="๐ฅ๏ธ Display Settings",
width=40,
height=50,
command=lambda: scripts.settings.WinSettings.System.DISPLAY.open()
)
btn9.grid(row=5, column=0, padx=10, pady=10, sticky="ew")
btn10 = customtkinter.CTkButton(
tab,
text="๐ท Camera Privacy",
width=40,
height=50,
command=lambda: scripts.settings.WinSettings.Privacy.CAMERA.open()
)
btn10.grid(row=5, column=1, padx=10, pady=10, sticky="ew")
# ---------------- METHODS ----------------
def show_computer_info(self):
self.textbox.delete("1.0", "end")
for line in scripts.compinfo.get_computer_info():
self.textbox.insert("end", line + "\n")
def apply_virtual_fx(self):
self.textbox1.delete("1.0", "end")
for key, value in scripts.visualfx.getall_visual_fx().items():
self.textbox1.insert("end", f"{key}: {value}" + "\n")
def on_mouse_option(self):
scripts.mouse.open_mouse_settings()
def show_memory_info(self):
self.memory_textbox.delete("1.0", "end")
info = scripts.virtualmemory.get_vmem()
# Display all info
for k, v in info.items():
if k != "needs_attention":
self.memory_textbox.insert("end", f"{k}: {v}\n")
# Prompt if virtual memory usage is zero
if info.get("needs_attention"):
response = messagebox.askyesno(
title="Paging file",
message="Paging file usage is 0. Do you want to open virtual memory settings?"
)
if response:
scripts.virtualmemory.open_virtual_memory_settings()
def open_startup_app(self):
scripts.startup.open_task_manager_startup()
def show_brightness(self):
value = scripts.brightness.get_brightness()
self.brightness_text.set(f"Brightness: {value}%")
def on_brightness_change(self, value):
brightness_value = int(value)
scripts.brightness.set_brightness(brightness_value)
self.brightness_text.set(f"Brightness: {brightness_value}%")
if __name__ == "__main__":
app = App()
app.mainloop()