update install config
This commit is contained in:
@@ -14,10 +14,12 @@ DIRECTORIES_TO_REMOVE = [
|
|||||||
|
|
||||||
APPS = [
|
APPS = [
|
||||||
'element-desktop',
|
'element-desktop',
|
||||||
|
'fisher',
|
||||||
'flatpak',
|
'flatpak',
|
||||||
|
'freecad',
|
||||||
'libreoffice-fresh',
|
'libreoffice-fresh',
|
||||||
'librewolf-bin',
|
'librewolf-bin',
|
||||||
'neovim-git',
|
'neovim',
|
||||||
'proton-mail-bin',
|
'proton-mail-bin',
|
||||||
'proton-vpn-gtk-app',
|
'proton-vpn-gtk-app',
|
||||||
'rtorrent',
|
'rtorrent',
|
||||||
@@ -25,6 +27,8 @@ APPS = [
|
|||||||
'stow',
|
'stow',
|
||||||
'tmux',
|
'tmux',
|
||||||
'wl-clipboard',
|
'wl-clipboard',
|
||||||
|
'gimp',
|
||||||
|
'inkscape',
|
||||||
]
|
]
|
||||||
|
|
||||||
DOTFILES = [
|
DOTFILES = [
|
||||||
|
|||||||
+27
-21
@@ -6,32 +6,30 @@ from pathlib import Path
|
|||||||
def sym_link_dir():
|
def sym_link_dir():
|
||||||
confirm_link = input("Do you want to link home directories to external storage? (Y/n): ")
|
confirm_link = input("Do you want to link home directories to external storage? (Y/n): ")
|
||||||
|
|
||||||
if confirm_link.lower() == "y" or confirm_link.lower() == '':
|
if confirm_link.lower() in ("y", "yes", ""):
|
||||||
target_dir = input("Specify the full path to the external storage: ")
|
target_dir = input("Specify the full path to the external storage: ")
|
||||||
|
|
||||||
def home_dir_item(item):
|
if Path(target_dir).is_dir():
|
||||||
return Path(f"{Path.home()}/{item}")
|
|
||||||
|
|
||||||
for dir in config.DIRECTORIES:
|
for dir in config.DIRECTORIES:
|
||||||
HOME_DIR_PATH = home_dir_item(dir)
|
DIR_ITEM = Path(f"{Path.home()}/{dir}")
|
||||||
TARGET_SYMLINK_DIR = f"{target_dir}/{dir}"
|
|
||||||
HAS_HOME_DIR = HOME_DIR_PATH.is_dir()
|
|
||||||
IS_SYMLINK = HOME_DIR_PATH.is_symlink()
|
|
||||||
|
|
||||||
if HAS_HOME_DIR:
|
if not DIR_ITEM.is_symlink():
|
||||||
HOME_DIR_PATH.rmdir()
|
if DIR_ITEM.is_dir():
|
||||||
|
DIR_ITEM.rmdir()
|
||||||
if not IS_SYMLINK:
|
DIR_ITEM.symlink_to(f"{target_dir}/{dir}")
|
||||||
HOME_DIR_PATH.symlink_to(TARGET_SYMLINK_DIR)
|
|
||||||
|
|
||||||
for dir in config.DIRECTORIES_TO_REMOVE:
|
for dir in config.DIRECTORIES_TO_REMOVE:
|
||||||
if home_dir_item(dir).is_dir():
|
DIR_ITEM = Path(f"{Path.home()}/{dir}")
|
||||||
home_dir_item(dir).rmdir()
|
|
||||||
|
if DIR_ITEM.is_dir() and not DIR_ITEM.is_symlink():
|
||||||
|
DIR_ITEM.rmdir()
|
||||||
|
|
||||||
|
|
||||||
def install_apps():
|
def install_apps():
|
||||||
for app in config.APPS:
|
for app in config.APPS:
|
||||||
subprocess.run(['sudo', 'pacman', '-S', f"{app}", '--noconfirm'])
|
subprocess.run([
|
||||||
|
'sudo', 'pacman', '-S', f"{app}", '--noconfirm'
|
||||||
|
], check=True)
|
||||||
|
|
||||||
subprocess.run([
|
subprocess.run([
|
||||||
"fish", "-c", "fisher install jorgebucaran/nvm.fish"
|
"fish", "-c", "fisher install jorgebucaran/nvm.fish"
|
||||||
@@ -43,12 +41,20 @@ def install_apps():
|
|||||||
|
|
||||||
|
|
||||||
def stow_dot_files():
|
def stow_dot_files():
|
||||||
|
dotfiles_root = Path.home()/'.dotfiles'
|
||||||
for dotfile in config.DOTFILES:
|
for dotfile in config.DOTFILES:
|
||||||
subprocess.run(['stow', f"../../{dotfile}", '--adopt'])
|
subprocess.run([
|
||||||
|
'stow', '-d', str(dotfiles_root), dotfile, '--adopt'
|
||||||
|
], check=True)
|
||||||
|
|
||||||
subprocess.run(['git', 'checkout', '--', '.'])
|
subprocess.run(
|
||||||
|
['git', 'checkout', '--', *config.DOTFILES],
|
||||||
|
cwd=dotfiles_root,
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
sym_link_dir()
|
if __name__ == "__main__":
|
||||||
install_apps()
|
sym_link_dir()
|
||||||
stow_dot_files()
|
install_apps()
|
||||||
|
stow_dot_files()
|
||||||
|
|||||||
Reference in New Issue
Block a user