changed linux font directory to ~/.local/share/fonts/ #340

This commit is contained in:
TomSchimansky 2022-09-15 12:31:43 +02:00
parent 64c8b8345d
commit 65c45abe32

View File

@ -6,13 +6,15 @@ from typing import Union
class FontManager:
linux_font_path = "~/.local/share/fonts/"
@classmethod
def init_font_manager(cls):
# Linux
if sys.platform.startswith("linux"):
try:
if not os.path.isdir(os.path.expanduser('~/.fonts/')):
os.mkdir(os.path.expanduser('~/.fonts/'))
if not os.path.isdir(os.path.expanduser(cls.linux_font_path)):
os.mkdir(os.path.expanduser(cls.linux_font_path))
return True
except Exception as err:
sys.stderr.write("FontManager error: " + str(err) + "\n")
@ -53,7 +55,7 @@ class FontManager:
# Linux
elif sys.platform.startswith("linux"):
try:
shutil.copy(font_path, os.path.expanduser("~/.fonts/"))
shutil.copy(font_path, os.path.expanduser(cls.linux_font_path))
return True
except Exception as err:
sys.stderr.write("FontManager error: " + str(err) + "\n")