From db25ff4a5dc8a8d8b4c9f5f6a82798e3c6b23753 Mon Sep 17 00:00:00 2001 From: acidburn Date: Sat, 29 Apr 2023 20:35:25 -0400 Subject: [PATCH] cleaned files --- adder.py | 41 ----------------------------------------- chmod.py | 16 ---------------- copy_dotfiles.py | 28 ---------------------------- dnf.py | 14 -------------- misic.py | 29 ----------------------------- note | 5 ++--- main.py => rice-cook.py | 2 +- 7 files changed, 3 insertions(+), 132 deletions(-) delete mode 100644 adder.py delete mode 100644 chmod.py delete mode 100644 copy_dotfiles.py delete mode 100644 dnf.py delete mode 100644 misic.py rename main.py => rice-cook.py (99%) diff --git a/adder.py b/adder.py deleted file mode 100644 index 947ce90..0000000 --- a/adder.py +++ /dev/null @@ -1,41 +0,0 @@ -import subprocess -programs =[] - -with open("data.txt", 'r') as file: - for line in file: - programs.append(line.strip()) - print(programs) - -try: - subprocess.check_call(['dnf', 'install', *programs]) -except: - print(Exception()) - - - - - - - - - - - -''' -def programs_installed_check(programs): - missing_programs = [] - for program in programs: - result = os.system(f"which {program} > /dev/null 2>&1") - if result != 0: - missing_programs.append(program) - if missing_programs: - print(f"The following programs are missing: {', '.join(missing_programs)}") - return False - else: - print("All programs are installed.") - return True - - -programs_to_check = ["awk", "sed", "grffffep"] -programs_installed_check(programs_to_check) -''' diff --git a/chmod.py b/chmod.py deleted file mode 100644 index beb926e..0000000 --- a/chmod.py +++ /dev/null @@ -1,16 +0,0 @@ -import os -import subprocess - -this_dir = os.getcwd() - - -for root ,b,files in os.walk(os.path.join(this_dir,'dotfiles')): - for element in files: - if '.sh' in element or '.py' in element: - try: - subprocess.run(f"chmod +x {os.path.join(root,element)}", shell=True) - except Exception(): - print(Exception()) - - - print(os.path.join(root,element)) diff --git a/copy_dotfiles.py b/copy_dotfiles.py deleted file mode 100644 index 9bd930d..0000000 --- a/copy_dotfiles.py +++ /dev/null @@ -1,28 +0,0 @@ -import os -import subprocess - -home = os.path.expanduser("~") -this = os.getcwd() - -# list of relevant configs -lis = list(next(os.walk('.'))[1]) -lis.append('picom.conf') -lis.remove('.git') - -if ('desktop' in lis): - lis.remove('desktop') -if ( '.git'in lis ): - lis.remove('.git') -if ('.bachrc' in lis): - lis.remove('.bashrc') -if ('.zshrc' in lis) : - lis.remove('.zshrc') - -destination = os.path.join(home,'.config') - -# copying files recusrsively -for dir in lis: - source = os.path.join(home, 'repos/dotfiles', dir) - print(subprocess.run(f'cp -r {this} {destination}', shell=True)) - - diff --git a/dnf.py b/dnf.py deleted file mode 100644 index 2a9843e..0000000 --- a/dnf.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -def dnf(): - - programs = [] - - with open('data.txt', 'r+') as f: - for line in f: - programs.append(line.strip()) - - print(programs) - - -print(os.getcwd()) diff --git a/misic.py b/misic.py deleted file mode 100644 index b4f0964..0000000 --- a/misic.py +++ /dev/null @@ -1,29 +0,0 @@ -import os -import gdown -import subprocess -import requests - -current_dir = os.getcwd() -try : - os.mkdir('misic') - os.mkdir(os.path.join(home,'.fonts')) -except FileExistsError: - pass - -os.chdir(os.path.join(current_dir,'misic')) - -#### Fonts -# https://drive.google.com/drive/folders/1BciF4x3_K3T8p1Y17lHn_xWXnSAZpvDE -fonts_url = 'https://drive.google.com/uc?id=1-3g_CjiJHKhRrJNjjZeAYu9KIGIAAAhC' -output ='fonts-c.zip' -gdown.download(fonts_url,output, quiet=False) -subprocess.run(f"unzip {output} {os.path.join(home,'.fonts')}",stdout=subprocess.DEVNULL ,shell=True) -subprocess.run("fc-cache -f",stdout=subprocess.DEVNULL ,shell=True) - -#### i3 autotiling -autotiling_url = 'https://raw.githubusercontent.com/nwg-piotr/autotiling/master/autotiling/main.py' -tiler = requests.get(autotiling_url, allow_redirects=True) -open('autotiling', 'wb').write(tiler.content) -subprocess.run('chmod +x autotiling', shell=True, stdout=subprocess.DEVNULL) -subprocess.run('cp autotiling /bin', shell=True, stdout=subprocess.DEVNULL) - diff --git a/note b/note index 5a94ead..fb32a4b 100644 --- a/note +++ b/note @@ -1,3 +1,2 @@ -add popen themes -may need to move ohmy zsh -send keyboard command ro restart i3 \ No newline at end of file +send keyboard command ro restart i3 +add info logs diff --git a/main.py b/rice-cook.py similarity index 99% rename from main.py rename to rice-cook.py index 02b8caa..9d0672a 100755 --- a/main.py +++ b/rice-cook.py @@ -296,5 +296,5 @@ def msic_configs(): if __name__ == '__main__': - logger.info(main()) + main()