Skip to content

Commit 8e88da1

Browse files
committed
cursors sddm
1 parent 503d719 commit 8e88da1

File tree

3 files changed

+41
-23
lines changed

3 files changed

+41
-23
lines changed

usr/share/archlinux-tweak-tool/Login_GUI.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ def GUI(self, Gtk, GdkPixbuf, vboxStack22, sddm, lightdm, os, Functions):
133133
hbox15 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=10)
134134
hbox15_lbl = Gtk.Label(xalign=0)
135135
hbox15_lbl.set_text("Cursor theme")
136-
self.entry_cursor_name = Gtk.Entry()
136+
self.cbt_cursor_themes = Gtk.ComboBoxText()
137+
sddm.pop_cursor_box(self, self.cbt_cursor_themes)
137138
hbox15.pack_start(hbox15_lbl, False, False, 10)
138-
hbox15.pack_start(self.entry_cursor_name, True, True, 10)
139+
hbox15.pack_start(self.cbt_cursor_themes, True, True, 10)
139140

140141
#reset_sddm = Gtk.Button(label="Apply your backup of sddm.conf")
141142
#reset_sddm.connect("clicked", self.on_click_sddm_reset)

usr/share/archlinux-tweak-tool/archlinux-tweak-tool.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,6 @@ def __init__(self):
635635
else:
636636
self.autologin_sddm.set_active(True)
637637
self.sessions_sddm.set_sensitive(True)
638-
if Functions.os.path.isfile(Functions.sddm_default_d2):
639-
read_cursor_name=sddm.check_sddm(sddm.get_sddm_lines(Functions.sddm_default_d2),"CursorTheme=").split("=")[1]
640-
self.entry_cursor_name.set_text(read_cursor_name)
641638
except Exception as e:
642639
print(e)
643640
print("Run 'fix-sddm-conf' in a terminal")
@@ -2312,7 +2309,7 @@ def on_click_sddm_apply(self, widget):
23122309
self.sessions_sddm.get_active_text(),
23132310
self.autologin_sddm.get_active(),
23142311
self.theme_sddm.get_active_text(),
2315-
self.entry_cursor_name.get_text()))
2312+
self.cbt_cursor_themes.get_active_text()))
23162313
t1.daemon = True
23172314
t1.start()
23182315

@@ -2446,6 +2443,7 @@ def on_click_install_bibata_cursor(self,widget):
24462443
print("We installed the Bibata cursors")
24472444
GLib.idle_add(Functions.show_in_app_notification, self, "Bibata cursors have been installed")
24482445
sddm.pop_theme_box(self, self.theme_sddm)
2446+
sddm.pop_cursor_box(self, self.cbt_cursor_themes)
24492447
else:
24502448
print("Activate the ArcoLinux repos")
24512449
GLib.idle_add(Functions.show_in_app_notification, self, "Activate the ArcoLinux repos")
@@ -2462,6 +2460,7 @@ def on_click_remove_bibata_cursor(self,widget):
24622460
print("We removed the Bibata cursors")
24632461
GLib.idle_add(Functions.show_in_app_notification, self, "Bibata cursoars have been removed")
24642462
sddm.pop_theme_box(self, self.theme_sddm)
2463+
sddm.pop_cursor_box(self, self.cbt_cursor_themes)
24652464

24662465
#if no sddm - press 1
24672466
def on_click_att_sddm_clicked(self, desktop):

usr/share/archlinux-tweak-tool/sddm.py

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,6 @@ def set_sddm_value(self, lists, value, session, state, theme,cursor):
9393
print(e)
9494
Functions.MessageBox(self, "Failed!!", "There seems to have been a problem in \"set_sddm_value\"")
9595

96-
def set_sddm_cursor(self, lists, cursor):
97-
try:
98-
99-
pos_theme = Functions._get_position(lists, "CursorTheme=")
100-
lists[pos_theme] = "CursorTheme=" + cursor + "\n"
101-
102-
with open(Functions.sddm_default_d2, "w") as f:
103-
f.writelines(lists)
104-
f.close()
105-
106-
GLib.idle_add(Functions.show_in_app_notification, self, "Settings Saved Successfully")
107-
108-
except Exception as e:
109-
print(e)
110-
Functions.MessageBox(self, "Failed!!", "There seems to have been a problem in \"set_sddm_value\"")
111-
112-
11396
def get_sddm_lines(files):
11497
if Functions.os.path.isfile(files):
11598
with open(files, "r", encoding="utf-8") as f:
@@ -161,3 +144,38 @@ def pop_theme_box(self, combo):
161144
combo.append_text(coms[i])
162145
if name.lower() == coms[i].lower():
163146
combo.set_active(i)
147+
148+
def pop_cursor_box(self, combo):
149+
coms = []
150+
com1 = []
151+
com2 = []
152+
combo.get_model().clear()
153+
154+
if Functions.check_package_installed("bibata-cursor-theme-bin"):
155+
com1 = ["Bibata-Modern-Amber",
156+
"Bibata-Modern-Classic",
157+
"Bibata-Modern-Ice",
158+
"Bibata-Original-Amber",
159+
"Bibata-Original-Classic",
160+
"Bibata-Original-Ice"]
161+
coms = com1
162+
163+
if Functions.check_package_installed("breeze-icons"):
164+
com2 = ["Breeze-Snow","breeze_cursors"]
165+
coms = coms + com2
166+
167+
if Functions.check_package_installed("sweet-cursor-theme-git"):
168+
com3 = ["Sweet-cursors"]
169+
coms = coms + com3
170+
171+
lines = get_sddm_lines(Functions.sddm_default_d2)
172+
173+
name = check_sddm(lines, "CursorTheme=").split("=")[1]
174+
175+
coms.sort()
176+
for i in range(len(coms)):
177+
#excludes = ['maya', 'maldives', 'elarun', '']
178+
#if not coms[i] in excludes:
179+
combo.append_text(coms[i])
180+
if name.lower() == coms[i].lower():
181+
combo.set_active(i)

0 commit comments

Comments
 (0)