-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproje.py
executable file
·137 lines (107 loc) · 4.04 KB
/
proje.py
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gi
import os
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
#project_folder = "/home/pardus/Masaüstü/proje"
img_folder = "/home/pardus/Masaüstü/proje/wallpaper/macOS-BS2.jpg"
theme_folder = "/home/pardus/Masaüstü/proje/theme/WhiteSur-light/metacity-1/metacity-theme-1.xml"
icon_folder = "/home/pardus/Masaüstü/proje/icon/adwaita-icon-theme/src/cursors/adwaita.svg"
font_folder = "/home/pardus/Masaüstü/proje/font/lucida-grande/LucidaGrande.ttf"
consolefont_folder= "/usr/share/consolefonts/UbuntuMono-R-8x16.psf"
class Handler:
def onQuit(self, main_window):
Gtk.main_quit()
#WALLPAPER
def onWallpaperClicked(self, change_wallpaper_btn):
print("Wallpaper button clicked")
os.system("/home/pardus/Masaüstü/proje/changew.sh /home/pardus/Masaüstü/proje/wallpaper/macOS-BS2.jpg")
try:
f = open(img_folder)
print("Image has already exist")
f.close()
except (FileNotFoundError, IOError):
print("Image not found !")
md1.run()
md1.hide()
#THEME
def onThemeClicked(self, change_theme_btn):
print("Theme button clicked")
#os.system("xfconf-query -c xsettings -p /Net/ThemeName -s 'WhiteSur'")
os.system("xfconf-query -c xsettings -p /Net/ThemeName -s 'WhiteSur-light'")
try:
f = open(theme_folder)
print("Theme has already exist")
f.close()
except (FileNotFoundError, IOError):
print("Theme is not found !")
md2.run()
md2.hide()
#ICON
def onIconClicked(self, change_icon_btn):
print("Icon button clicked")
#os.system("gsettings set org.gnome.desktop.interface icon-theme 'Os-Catalina'")
#os.system("gsettings set org.gnome.desktop.interface icon-theme 'Adwaita'")
os.system("gsettings set org.gnome.desktop.interface icon-theme 'WhiteSur-dark'")
#os.system("gsettings set org.gnome.desktop.interface icon-theme 'McMojave Cursors'")
#os.system("gsettings set org.gnome.desktop.interface icon-theme 'file///home/pardus/Masaüstü/proje/icon/Os-Catalina'")
try:
f = open(icon_folder)
print("Icon has already exist")
f.close()
except (FileNotFoundError, IOError):
print("Icon is not found !")
md3.run()
md3.hide()
#FONT
def onFontClicked(self, change_font_btn):
print("Font button clicked")
#os.system("setfont home/pardus/Masaüstü/proje/font/SanFranciscoDisplay-Light.otf")
os.system("/home/pardus/Masaüstü/proje/font.sh /home/pardus/Masaüstü/proje/font/lucida-grande/LucidaGrande.ttf")
#os.system("setfont home/pardus/.fonts/lucida-grande/LucidaGrande.ttf")
try:
f = open(font_folder)
print("Font has already exist !")
f.close()
except (FileNotFoundError, IOError):
print("Font is not found !")
md4.run()
md4.hide()
#TERMINAL FONT
def onConsoleClicked(self, change_console_btn):
print("Console button clicked")
print("\n")
ch = input("Change console fonts [Y/N] : ")
print("\n\n")
if ((ch=='Y') or (ch=='N')):
os.system("ls /usr/share/consolefonts")
#os.system("setfont /usr/share/consolefonts/UbuntuMono-R-8x16.psf")
else:
print(" Console fonts did not change. ")
print("\n\n")
try:
f = open(consolefont_folder)
print("Console fonts are here !")
f.close()
except (FileNotFoundError, IOError):
print("Console fonts are not here !")
builder = Gtk.Builder()
builder.add_from_file("/home/pardus/Masaüstü/proje/proje.glade")
builder.connect_signals(Handler())
main_window = builder.get_object("main_window")
change_wallpaper_btn = builder.get_object("wallpaper_btn")
change_theme_btn = builder.get_object("theme_btn")
change_icon_btn = builder.get_object("icon_btn")
change_font_btn = builder.get_object("font_btn")
change_console_btn = builder.get_object("console_font_btn")
md1 = builder.get_object("dialog1")
md2 = builder.get_object("dialog2")
md3 = builder.get_object("dialog3")
md4 = builder.get_object("dialog4")
def start():
print("start function")
start()
main_window.show_all()
print("Show all function...")
Gtk.main()