Windows terminal settings

This commit is contained in:
John Doty 2020-02-18 07:21:42 -08:00
parent 70026238c3
commit 2e5208be18
2 changed files with 73 additions and 2 deletions

View file

@ -8,6 +8,7 @@ ignore = {
"readme.md",
".git",
"vscode",
"terminal",
".DS_Store",
}
@ -21,7 +22,7 @@ def link_helper(source, dst):
other_src = os.readlink(dst)
other_src = os.path.join(os.path.dirname(dst), other_src)
other_src = os.path.abspath(other_src)
if other_src != source:
if not os.path.samefile(other_src, source):
print(source)
print(
"WARNING: {} is symlink but not into "
@ -33,7 +34,8 @@ def link_helper(source, dst):
print("Linking: {} -> {}".format(source, dst))
os.symlink(source, dst)
# Set up the vast majority of the files here: most things in *this* directory
# go into the home directory directly. (Directly directory?)
home = os.path.expanduser("~")
source_files = [file for file in os.listdir(os.getcwd()) if file not in ignore]
for source in source_files:
@ -66,3 +68,19 @@ else:
possible_vscode_roots
)
)
# Also these dumb terminal settings go somewhere else yikes.
terminal_source = os.path.abspath("terminal")
terminal_root = os.path.join(os.getenv("LOCALAPPDATA"), "packages", "Microsoft.WindowsTerminal_8wekyb3d8bbwe", "LocalState")
if os.path.exists(terminal_root):
source_files = [file for file in os.listdir(terminal_source) if file not in ignore]
for source in source_files:
source = os.path.join(terminal_source, source)
dst = os.path.join(terminal_root, os.path.split(source)[1])
link_helper(source, dst)
else:
print(
"WARNING: No viable root for windows terminal config (tried {})".format(
terminal_root
)
)