mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
changed linux font directory to ~/.local/share/fonts/ #340
This commit is contained in:
parent
64c8b8345d
commit
65c45abe32
@ -6,13 +6,15 @@ from typing import Union
|
|||||||
|
|
||||||
class FontManager:
|
class FontManager:
|
||||||
|
|
||||||
|
linux_font_path = "~/.local/share/fonts/"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def init_font_manager(cls):
|
def init_font_manager(cls):
|
||||||
# Linux
|
# Linux
|
||||||
if sys.platform.startswith("linux"):
|
if sys.platform.startswith("linux"):
|
||||||
try:
|
try:
|
||||||
if not os.path.isdir(os.path.expanduser('~/.fonts/')):
|
if not os.path.isdir(os.path.expanduser(cls.linux_font_path)):
|
||||||
os.mkdir(os.path.expanduser('~/.fonts/'))
|
os.mkdir(os.path.expanduser(cls.linux_font_path))
|
||||||
return True
|
return True
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
sys.stderr.write("FontManager error: " + str(err) + "\n")
|
sys.stderr.write("FontManager error: " + str(err) + "\n")
|
||||||
@ -53,7 +55,7 @@ class FontManager:
|
|||||||
# Linux
|
# Linux
|
||||||
elif sys.platform.startswith("linux"):
|
elif sys.platform.startswith("linux"):
|
||||||
try:
|
try:
|
||||||
shutil.copy(font_path, os.path.expanduser("~/.fonts/"))
|
shutil.copy(font_path, os.path.expanduser(cls.linux_font_path))
|
||||||
return True
|
return True
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
sys.stderr.write("FontManager error: " + str(err) + "\n")
|
sys.stderr.write("FontManager error: " + str(err) + "\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user