fixed extra repos + cspell

This commit is contained in:
acidburnmonkey
2025-05-26 11:46:14 -04:00
parent 96dfc94592
commit 6b460f045a
2 changed files with 26 additions and 27 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
sudo dnf check-update sudo dnf check-update
# DNF reqs # DNF reqs
sudo dnf install -y python3-tkinter python3-devel python3-pip uv sudo dnf install -y python3-devel python3-pip uv
#pip #pip
python3 -m pip3 install --upgrade pip python3 -m pip3 install --upgrade pip
+25 -26
View File
@@ -1,6 +1,6 @@
#!/bin/python3 #!/bin/python3
# Program Shoud run with sudo -HE # Program Should run with sudo -HE
# https://github.com/acidburnmonkey # https://github.com/acidburnmonkey
# #
@@ -15,7 +15,6 @@ from git import Repo
from rich.console import Console from rich.console import Console
from rich.theme import Theme from rich.theme import Theme
from slimParser import SlimParser from slimParser import SlimParser
import slimParser
# pylint: disable=subprocess-run-check # pylint: disable=subprocess-run-check
# pylint: disable=broad-exception-caught # pylint: disable=broad-exception-caught
@@ -23,9 +22,9 @@ import slimParser
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
formater = logging.Formatter("%(asctime)s | %(levelno)s | %(funcName)s| %(message)s") formatter = logging.Formatter("%(asctime)s | %(levelno)s | %(funcName)s| %(message)s")
f_handler = logging.FileHandler('logg.log') f_handler = logging.FileHandler('logg.log')
f_handler.setFormatter(formater) f_handler.setFormatter(formatter)
logger.addHandler(f_handler) logger.addHandler(f_handler)
logging.basicConfig( logging.basicConfig(
@@ -33,7 +32,7 @@ logging.basicConfig(
filename='logg.log', level=logging.WARNING filename='logg.log', level=logging.WARNING
) )
ap_theme = Theme({'ok':'green', 'error':'red', 'checkt':'bold cyan','promp':'orange1'}) ap_theme = Theme({'ok':'green', 'error':'red', 'checked':'bold cyan','rule':'orange1'})
console = Console(theme=ap_theme) console = Console(theme=ap_theme)
user = os.getlogin() user = os.getlogin()
@@ -48,7 +47,7 @@ def main():
sudo_check() sudo_check()
console.print(f"Setting up for user {local_user} ", style='promp') console.print(f"Setting up for user {local_user} ", style='rule')
# while(True): # while(True):
# confirm_user = input(" y/n ") # confirm_user = input(" y/n ")
# if (confirm_user.lower() == 'n'): # if (confirm_user.lower() == 'n'):
@@ -68,7 +67,7 @@ def main():
#This should not need sudo #This should not need sudo
# Pass D or L to copy_dotfiles function # Pass D or L to copy_dotfiles function
while (True): while (True):
console.print('Set up dotfiles for Desktop (D) or Laptop (L) ?', style='promp') console.print('Set up dotfiles for Desktop (D) or Laptop (L) ?', style='rule')
setup = input('>').lower() setup = input('>').lower()
if setup == 'l' or setup == 'd': if setup == 'l' or setup == 'd':
copy_dotfiles(setup) copy_dotfiles(setup)
@@ -87,7 +86,7 @@ def main():
################ ################
def dnf_config(): def dnf_config():
console.rule("Configuring dnf", style='checkt') console.rule("Configuring dnf", style='checked')
# dnf conf # dnf conf
with open('/etc/dnf/dnf.conf' , 'r+') as f: with open('/etc/dnf/dnf.conf' , 'r+') as f:
@@ -99,7 +98,7 @@ def dnf_config():
console.print(' changes made to dnf_config :heavy_check_mark:', style='ok') console.print(' changes made to dnf_config :heavy_check_mark:', style='ok')
logger.info('changes made to dnf_config') logger.info('changes made to dnf_config')
else: else:
console.print(' dnf.conf already optimized :heavy_check_mark:', style='checkt') console.print(' dnf.conf already optimized :heavy_check_mark:', style='checked')
subprocess.check_call('sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm',stdout=subprocess.DEVNULL, shell=True) subprocess.check_call('sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm',stdout=subprocess.DEVNULL, shell=True)
subprocess.check_call('sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm',stdout=subprocess.DEVNULL, shell=True) subprocess.check_call('sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm',stdout=subprocess.DEVNULL, shell=True)
@@ -113,7 +112,7 @@ def dnf_config():
def hyprland(): def hyprland():
console.rule("Configuring hyprland", style='checkt') console.rule("Configuring hyprland", style='checked')
if not os.path.exists(home +'/.local/bin'): if not os.path.exists(home +'/.local/bin'):
os.mkdir(home +'/.local/bin') os.mkdir(home +'/.local/bin')
@@ -151,7 +150,7 @@ Type=Application ''')
# install programs dnf # install programs dnf
def install_programs_dnf(): def install_programs_dnf():
console.rule("Installing All Programs DNF ", style='checkt') console.rule("Installing All Programs DNF ", style='checked')
parser = SlimParser('data.conf') parser = SlimParser('data.conf')
parser.cleanAll() parser.cleanAll()
@@ -167,7 +166,7 @@ def install_programs_dnf():
if repos: if repos:
for url in repos: for url in repos:
try: try:
subprocess.run(f'dnf config-manager addrepo --from-repofile={url}') subprocess.run(f'sudo dnf config-manager addrepo --from-repofile={url}', shell=True)
except Exception as e: except Exception as e:
console.print(Exception(),":x:" , style='error') console.print(Exception(),":x:" , style='error')
logging.critical(f"Error adding extra repos: {str(e)}") logging.critical(f"Error adding extra repos: {str(e)}")
@@ -175,7 +174,7 @@ def install_programs_dnf():
if copr: if copr:
for id in copr: for id in copr:
try: try:
subprocess.run(f'sudo dnf copr enable {id}') subprocess.run(f'sudo dnf copr enable -y {id}',shell=True)
except Exception as e: except Exception as e:
console.print(Exception(),":x:" , style='error') console.print(Exception(),":x:" , style='error')
logging.critical(f"Err adding Copr: {str(e)}") logging.critical(f"Err adding Copr: {str(e)}")
@@ -211,7 +210,7 @@ def sudo_check():
# Oh my zsh setup + flathub # Oh my zsh setup + flathub
def zsh_fonts(): def zsh_fonts():
console.rule("Installing Zsh fonts", style='checkt') console.rule("Installing Zsh fonts", style='checked')
try: try:
console.print("installing oh my zsh ", style='ok') console.print("installing oh my zsh ", style='ok')
@@ -234,8 +233,8 @@ def zsh_fonts():
subprocess.run('chmod +x install.sh ', stdout=subprocess.DEVNULL, shell=True, check=True) subprocess.run('chmod +x install.sh ', stdout=subprocess.DEVNULL, shell=True, check=True)
subprocess.run(f'sudo -u {user} ./install.sh', shell=True, check=True) subprocess.run(f'sudo -u {user} ./install.sh', shell=True, check=True)
console.print("installing oh my zsh auto sugestions ", style='ok') console.print("installing oh my zsh auto suggestions ", style='ok')
# zsh auto sugestions # zsh auto suggestions
subprocess.run(f'git clone https://github.com/zsh-users/zsh-autosuggestions {home}/.oh-my-zsh/custom/plugins/zsh-autosuggestions', shell=True) subprocess.run(f'git clone https://github.com/zsh-users/zsh-autosuggestions {home}/.oh-my-zsh/custom/plugins/zsh-autosuggestions', shell=True)
console.print("installing powerlevel10k ", style='ok') console.print("installing powerlevel10k ", style='ok')
@@ -254,14 +253,14 @@ def zsh_fonts():
# copy and override dotfiles # copy and override dotfiles
def copy_dotfiles(setup): def copy_dotfiles(setup):
console.rule("Copying Dotfiles", style='checkt') console.rule("Copying Dotfiles", style='checked')
# list of relevant configs # list of relevant configs
lis = os.listdir() lis = os.listdir()
exeptions = ['.git', '.bashrc','.zshrc','retired','data.config','wrappedhl','Hyprland','install.sh', exceptions = ['.git', '.bashrc','.zshrc','retired','data.conf','wrappedhl','Hyprland','install.sh',
'logg.log','README.md','.gitignore','rice-cook.py','Laptop-configs','.ideavimrc'] 'logg.log','README.md','.gitignore','rice-cook.py','Laptop-configs','.ideavimrc']
for z in exeptions: for z in exceptions:
if z in lis: if z in lis:
lis.remove(z) lis.remove(z)
@@ -274,14 +273,14 @@ def copy_dotfiles(setup):
if (setup =='l'): if (setup =='l'):
console.print("Setting up dotfiles for Laptop", style='ok') console.print("Setting up dotfiles for Laptop", style='ok')
# copying files recusrsively # copying files recursively
for dir in lis: for dir in lis:
print(subprocess.run(f'cp -r {dir} {destination}', shell=True)) print(subprocess.run(f'cp -r {dir} {destination}', shell=True))
elif (setup =='d'): elif (setup =='d'):
console.print("Setting up dotfiles for Desktop", style='ok') console.print("Setting up dotfiles for Desktop", style='ok')
# copying files recusrsively # copying files recursively
for dir in lis: for dir in lis:
print(subprocess.run(f'cp -r {dir} {destination}', shell=True)) print(subprocess.run(f'cp -r {dir} {destination}', shell=True))
@@ -290,7 +289,7 @@ def copy_dotfiles(setup):
def executable_scripts(): def executable_scripts():
console.rule('Making scripts executable', style='checkt') console.rule('Making scripts executable', style='checked')
for root ,_,files in os.walk(os.path.join(home,'.config')): for root ,_,files in os.walk(os.path.join(home,'.config')):
for element in files: for element in files:
@@ -304,7 +303,7 @@ def executable_scripts():
#need sudo #need sudo
def msic_configs(): def msic_configs():
console.rule('Setting up final configs', style='checkt') console.rule('Setting up final configs', style='checked')
current_dir = os.getcwd() current_dir = os.getcwd()
try : try :
@@ -326,7 +325,7 @@ def msic_configs():
shutil.copytree(home+"/.fonts",'/usr/share/fonts/', dirs_exist_ok=True) shutil.copytree(home+"/.fonts",'/usr/share/fonts/', dirs_exist_ok=True)
console.print("Fonts downloaded :heavy_check_mark:", style='ok') console.print("Fonts downloaded :heavy_check_mark:", style='ok')
logger.info('Fonts donwloaded ') logger.info('Fonts downloaded ')
#Icons #Icons
subprocess.run('git clone --depth 1 https://github.com/EliverLara/candy-icons.git /usr/share/icons/candy-icons', shell=True, stdout=subprocess.DEVNULL) subprocess.run('git clone --depth 1 https://github.com/EliverLara/candy-icons.git /usr/share/icons/candy-icons', shell=True, stdout=subprocess.DEVNULL)
@@ -363,7 +362,7 @@ def msic_configs():
logging.critical(f"Could not get themes :{str(e)}") logging.critical(f"Could not get themes :{str(e)}")
console.print("Error with Themes :X:", style='error') console.print("Error with Themes :X:", style='error')
# codec and multmedia # codec and multimedia
try: try:
subprocess.run('dnf swap ffmpeg-free ffmpeg --allowerasing', shell=True) subprocess.run('dnf swap ffmpeg-free ffmpeg --allowerasing', shell=True)
subprocess.run('dnf update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin', shell=True) subprocess.run('dnf update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin', shell=True)
@@ -379,7 +378,7 @@ def msic_configs():
def systemd(): def systemd():
console.rule('Enabling user services', style='checkt') console.rule('Enabling user services', style='checked')
user_services = ['gnome-keyring.service', 'ssh-agent.service', 'polkit-gnome-authentication-agent.service', user_services = ['gnome-keyring.service', 'ssh-agent.service', 'polkit-gnome-authentication-agent.service',
'hypridle.service','gnome-keyring-daemon.service'] 'hypridle.service','gnome-keyring-daemon.service']