Compare commits
12 Commits
516d99bb34
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f0193f173 | ||
|
|
dae7e51cc4 | ||
|
|
978845ea74 | ||
|
|
0937aa4e6e | ||
|
|
b1ad5187f4 | ||
|
|
d1419177d0 | ||
|
|
940604658b | ||
|
|
65e62cc887 | ||
|
|
b96a80b4f7 | ||
|
|
9a088dae4b | ||
|
|
502905b023 | ||
|
|
0e269f8ba4 |
45
config.py
Normal file
45
config.py
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
DIRECTORIES = [
|
||||||
|
'Documents',
|
||||||
|
'Downloads',
|
||||||
|
'Music',
|
||||||
|
'Pictures',
|
||||||
|
'Repos',
|
||||||
|
'Videos',
|
||||||
|
]
|
||||||
|
|
||||||
|
DIRECTORIES_TO_REMOVE = [
|
||||||
|
'Public',
|
||||||
|
'Templates',
|
||||||
|
]
|
||||||
|
|
||||||
|
APPS = [
|
||||||
|
'electrum',
|
||||||
|
'element-desktop',
|
||||||
|
'flatpak',
|
||||||
|
'fprintd',
|
||||||
|
'freecad',
|
||||||
|
'libreoffice-fresh',
|
||||||
|
'librewolf-bin',
|
||||||
|
'neovim-git',
|
||||||
|
'rtorrent',
|
||||||
|
'steam',
|
||||||
|
'stow',
|
||||||
|
'tmux',
|
||||||
|
'torbrowser-launcher',
|
||||||
|
'vlc',
|
||||||
|
'wl-clipboard',
|
||||||
|
]
|
||||||
|
|
||||||
|
FLATPAK_APPS = [
|
||||||
|
'it.mijorus.gearlever',
|
||||||
|
'me.proton.Mail',
|
||||||
|
'com.protonvpn.www',
|
||||||
|
]
|
||||||
|
|
||||||
|
DOTFILES = [
|
||||||
|
'alacritty',
|
||||||
|
'fish',
|
||||||
|
'nvim',
|
||||||
|
'rtorrent',
|
||||||
|
'tmux',
|
||||||
|
]
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
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()
|
|
||||||
60
install.py
Normal file
60
install.py
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import subprocess
|
||||||
|
import config
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
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 install_flatpak_apps():
|
||||||
|
for app in config.FLATPAK_APPS:
|
||||||
|
subprocess.run(['flatpak', 'install', f"{app}"])
|
||||||
|
|
||||||
|
|
||||||
|
def stow_dot_files():
|
||||||
|
for dotfile in config.DOTFILES:
|
||||||
|
subprocess.run(['stow', f"{dotfile}", '--adopt'])
|
||||||
|
|
||||||
|
subprocess.run(['git', 'checkout', '--', '.'])
|
||||||
|
|
||||||
|
|
||||||
|
sym_link_dir()
|
||||||
|
install_apps()
|
||||||
|
install_flatpak_apps()
|
||||||
|
stow_dot_files()
|
||||||
@@ -6,6 +6,7 @@ require('mason-lspconfig').setup({
|
|||||||
'html',
|
'html',
|
||||||
'cssls',
|
'cssls',
|
||||||
'jsonls',
|
'jsonls',
|
||||||
|
'pylsp',
|
||||||
},
|
},
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user