from pathlib import Path import subprocess def sym_link_folders() -> void: target_folder = input("Specify the path to the target folder (full path must be used): ") FOLDERS = [ 'Documents', 'Downloads', 'Music', 'Pictures', 'Repos', 'Videos', ] for folder in FOLDERS: if Path(f"{Path.home()}/{folder}").is_dir() and not Path(f"{Path.home()}/{folder}").is_symlink(): Path(f"{Path.home()}/{folder}").rmdir() Path(f"{Path.home()}/{folder}").symlink_to(f"{target_folder}/{folder}") if Path(f"{Path.home()}/Templates").is_dir(): Path(f"{Path.home()}/Templates").rmdir() if Path(f"{Path.home()}/Public").is_dir(): Path(f"{Path.home()}/Public").rmdir() def install_apps() -> void: APPS = [ 'brave-bin', 'element-desktop', 'flatpak' 'libreoffice-fresh', 'neovim-git', 'proton-mail-bin', 'proton-vpn-gtk-app', 'rtorrent', 'steam', 'stow', 'tmux', 'wl-clipboard', ] for app in APPS: subprocess.run(['sudo', 'pacman', '-S', f"{app}", '--noconfirm']) subprocess.run([ "fish", "-c", "fisher install jorgebucaran/nvm.fish" ], check=True) subprocess.run([ "fish", "-c", "nvm install lts" ], check=True) def stow_dot_files() -> void: DOTFILES = [ 'alacritty', 'fish', 'nvim', 'rtorrent', 'tmux', 'tmuxp', ] for dotfile in DOTFILES: subprocess.run(['stow', f"{dotfile}", '--adopt']) subprocess.run(['git', 'checkout', '--', '.']) sym_link_folders() install_apps() stow_dot_files()