mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-10-02 16:17:53 +00:00
Implement backup functional for gtk.css
This commit is contained in:
parent
fc76ddbe78
commit
8f56bfd2fd
1 changed files with 9 additions and 0 deletions
|
@ -556,6 +556,15 @@ class GradienceApplication(Adw.Application):
|
|||
if not os.path.exists(gtk4_dir):
|
||||
os.makedirs(gtk4_dir)
|
||||
gtk4_css = self.generate_gtk_css("gtk4")
|
||||
contents = ""
|
||||
with open(
|
||||
os.path.join(gtk4_dir, "gtk.css"), "r", encoding="utf-8"
|
||||
) as file:
|
||||
contents = file.read()
|
||||
with open(
|
||||
os.path.join(gtk4_dir, "gtk.css.bak"), "w", encoding="utf-8"
|
||||
) as file:
|
||||
file.write(contents)
|
||||
with open(
|
||||
os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8"
|
||||
) as file:
|
||||
|
|
Loading…
Reference in a new issue