finished dotfiles copy
This commit is contained in:
@@ -63,7 +63,8 @@ def dnf_config():
|
|||||||
subprocess.check_call('sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm', shell=True)
|
subprocess.check_call('sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm', shell=True)
|
||||||
console.print('rpmfusion added to repos :heavy_check_mark:', style='ok')
|
console.print('rpmfusion added to repos :heavy_check_mark:', style='ok')
|
||||||
|
|
||||||
# install programs dnf
|
|
||||||
|
# install programs dnfmax list i can pass to dnf of programs to install
|
||||||
def install_programs_dnf():
|
def install_programs_dnf():
|
||||||
programs =[]
|
programs =[]
|
||||||
|
|
||||||
@@ -100,6 +101,7 @@ def pip_modules(modules):
|
|||||||
console.print("all modules are installed. :heavy_check_mark:", style='ok')
|
console.print("all modules are installed. :heavy_check_mark:", style='ok')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
## checks for sudo
|
## checks for sudo
|
||||||
def sudo_check():
|
def sudo_check():
|
||||||
user = os.getenv("SUDO_USER")
|
user = os.getenv("SUDO_USER")
|
||||||
@@ -147,9 +149,9 @@ def copy_dotfiles(setup):
|
|||||||
|
|
||||||
# list of relevant configs
|
# list of relevant configs
|
||||||
lis = list(next(os.walk('.'))[1])
|
lis = list(next(os.walk('.'))[1])
|
||||||
|
|
||||||
lis.append('picom.conf')
|
lis.append('picom.conf')
|
||||||
lis.remove('.git')
|
lis.remove('.git')
|
||||||
|
|
||||||
if ('desktop' in lis):
|
if ('desktop' in lis):
|
||||||
lis.remove('desktop')
|
lis.remove('desktop')
|
||||||
if ( '.git'in lis ):
|
if ( '.git'in lis ):
|
||||||
@@ -159,17 +161,35 @@ def copy_dotfiles(setup):
|
|||||||
if ('.zshrc' in lis) :
|
if ('.zshrc' in lis) :
|
||||||
lis.remove('.zshrc')
|
lis.remove('.zshrc')
|
||||||
|
|
||||||
|
|
||||||
dotfiles_dir = os.getcwd()
|
dotfiles_dir = os.getcwd()
|
||||||
destination = os.path.join(home,'.config')
|
destination = os.path.join(home,'.config')
|
||||||
|
|
||||||
|
subprocess.run(f"cp -r {os.path.join(dotfiles_dir,'.zshrc')} {home}", shell=True)
|
||||||
|
|
||||||
|
if (setup =='l'):
|
||||||
|
console.print("Setting up dotfiles for Laptop", style='ok')
|
||||||
|
# copying files recusrsively
|
||||||
|
for dir in lis:
|
||||||
|
print(subprocess.run(f'cp -r {dotfiles_dir} {destination}', shell=True))
|
||||||
|
|
||||||
|
elif (setup =='d'):
|
||||||
|
console.print("Setting up dotfiles for Desktop", style='ok')
|
||||||
|
|
||||||
|
if ('i3' in lis):
|
||||||
|
lis.remove('i3')
|
||||||
|
if ('polybar' in lis):
|
||||||
|
lis.remove('i3')
|
||||||
|
lis.append('desktop/i3', 'desktop/polybar')
|
||||||
|
|
||||||
# copying files recusrsively
|
# copying files recusrsively
|
||||||
for dir in lis:
|
for dir in lis:
|
||||||
print(subprocess.run(f'cp -r {dotfiles_dir} {destination}', shell=True))
|
print(subprocess.run(f'cp -r {dotfiles_dir} {destination}', shell=True))
|
||||||
|
|
||||||
|
|
||||||
def executable_scripts():
|
def executable_scripts():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
install_programs_dnf()
|
copy_dotfiles('d')
|
||||||
|
executable_scripts()
|
||||||
|
|||||||
Reference in New Issue
Block a user