-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.py
More file actions
executable file
·31 lines (26 loc) · 861 Bytes
/
update.py
File metadata and controls
executable file
·31 lines (26 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
import os
import shutil
from pathlib import Path
path_map_src_dst = {
"~/.config/hypr": ".config/hypr",
"~/.config/my": ".config/my",
"~/.config/waybar": ".config/waybar",
"~/.config/zed": ".config/zed",
"~/.config/rofi": ".config/rofi",
"~/.local/share/rofi/themes": ".config/rofi/themes",
"~/.config/dunst": ".config/dunst",
"~/.config/fish": ".config/fish",
"~/.config/doom": ".config/doom",
"~/bin": "bin",
}
def hardlink(src: Path, dst: Path):
if dst.exists():
print(f"shutil.rmtree({dst})")
shutil.rmtree(dst)
print(f"shutil.copytree({src}, {dst}, copy_function=os.link)")
shutil.copytree(src, dst, copy_function=os.link)
for src, dst in path_map_src_dst.items():
src_path = Path(src).expanduser()
dst_path = Path(dst)
hardlink(src_path, dst_path)