+
+def mkdir(dir):
+ try:
+ os.makedirs(dir)
+ except FileExistsError:
+ pass
+
+
+if os.geteuid() == 0:
+ mkdir("/etc/lightcards/")
+ shutil.copyfile("./config.py", "/etc/lightcards/config.py")
+else:
+ xdg = os.environ.get("XDG_CONFIG_HOME")
+ xdg_dest = f"{xdg}/lightcards/config.py"
+
+ home = os.path.expanduser("~")
+ home_dest = f"{home}/.config/lightcards/config.py"
+
+ if xdg and not os.path.exists(xdg_dest):
+ mkdir(f"{xdg}/lightcards")
+ shutil.copyfile("./config.py", xdg_dest)
+ elif not os.path.exists(home_dest):
+ mkdir(f"{home}/.config/lightcards")
+ shutil.copyfile("./config.py", home_dest)
+
+