config updates
This commit is contained in:
37
setup/arch/config.py
Normal file
37
setup/arch/config.py
Normal file
@@ -0,0 +1,37 @@
|
||||
DIRECTORIES = [
|
||||
'Documents',
|
||||
'Downloads',
|
||||
'Music',
|
||||
'Pictures',
|
||||
'Repos',
|
||||
'Videos',
|
||||
]
|
||||
|
||||
DIRECTORIES_TO_REMOVE = [
|
||||
'Templates',
|
||||
'Public',
|
||||
]
|
||||
|
||||
APPS = [
|
||||
'brave-bin',
|
||||
'element-desktop',
|
||||
'flatpak',
|
||||
'libreoffice-fresh',
|
||||
'neovim-git',
|
||||
'proton-mail-bin',
|
||||
'proton-vpn-gtk-app',
|
||||
'rtorrent',
|
||||
'steam',
|
||||
'stow',
|
||||
'tmux',
|
||||
'wl-clipboard',
|
||||
]
|
||||
|
||||
DOTFILES = [
|
||||
'alacritty',
|
||||
'fish',
|
||||
'nvim',
|
||||
'rtorrent',
|
||||
'tmux',
|
||||
'tmuxp',
|
||||
]
|
||||
54
setup/arch/install.py
Normal file
54
setup/arch/install.py
Normal file
@@ -0,0 +1,54 @@
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from arch import config
|
||||
|
||||
|
||||
def sym_link_dir():
|
||||
confirm_link = input("Do you want to link home directories to external storage?(Y/n): ")
|
||||
|
||||
if confirm_link.lower == "y" or confirm_link.lower == '':
|
||||
target_dir = input("Specify the full path to the external storage: ")
|
||||
|
||||
def home_dir_item(item):
|
||||
return Path(f"{Path.home()}/{item}")
|
||||
|
||||
for dir in config.DIRECTORIES:
|
||||
HOME_DIR_PATH = home_dir_item(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:
|
||||
HOME_DIR_PATH.rmdir()
|
||||
|
||||
if not IS_SYMLINK:
|
||||
HOME_DIR_PATH.symlink_to(TARGET_SYMLINK_DIR)
|
||||
|
||||
for dir in config.DIRECTORIES_TO_REMOVE:
|
||||
if home_dir_item(dir).is_dir():
|
||||
home_dir_item(dir).rmdir()
|
||||
|
||||
|
||||
def install_apps():
|
||||
for app in config.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():
|
||||
for dotfile in config.DOTFILES:
|
||||
subprocess.run(['stow', f"{dotfile}", '--adopt'])
|
||||
|
||||
subprocess.run(['git', 'checkout', '--', '.'])
|
||||
|
||||
|
||||
sym_link_dir()
|
||||
install_apps()
|
||||
stow_dot_files()
|
||||
Reference in New Issue
Block a user