modified: .gitignore
modified: data.conf modified: rice-cook.py
This commit is contained in:
+2
-1
@@ -2,4 +2,5 @@ project_vnv
|
||||
build
|
||||
dist
|
||||
rice-cook.spec
|
||||
|
||||
__pycache__
|
||||
test.py
|
||||
|
||||
@@ -8,9 +8,9 @@ hyprpaper
|
||||
hyprpicker
|
||||
hyprutils
|
||||
xdg-desktop-portal-hyprland
|
||||
qt6ct
|
||||
waybar
|
||||
wl-copy
|
||||
alacritty
|
||||
pip
|
||||
flatpak
|
||||
neovim
|
||||
@@ -31,10 +31,10 @@ qt6-qtwayland
|
||||
|
||||
[Programs]
|
||||
gnome-font-viewer
|
||||
alacritty
|
||||
gnome-software
|
||||
kitty
|
||||
ranger
|
||||
gnome-software
|
||||
nemo
|
||||
|
||||
[Flatpak]
|
||||
|
||||
+72
-35
@@ -28,8 +28,7 @@ f_handler.setFormatter(formatter)
|
||||
logger.addHandler(f_handler)
|
||||
|
||||
logging.basicConfig(
|
||||
format="%(asctime)s | %(levelno)s | %(funcName)s| %(message)s ",
|
||||
filename='logg.log', level=logging.WARNING
|
||||
format="%(asctime)s | %(levelno)s | %(funcName)s| %(message)s ", filename='logg.log', level=logging.WARNING
|
||||
)
|
||||
|
||||
ap_theme = Theme({'ok': 'green', 'error': 'red', 'checked': 'bold cyan', 'rule': 'orange1'})
|
||||
@@ -40,22 +39,12 @@ home = os.path.join('/home',user)
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
setup = ''
|
||||
# confirm_user =''
|
||||
local_user = user
|
||||
|
||||
sudo_check()
|
||||
|
||||
console.print(f"Setting up for user {local_user} ", style='rule')
|
||||
# while(True):
|
||||
# confirm_user = input(" y/n ")
|
||||
# if (confirm_user.lower() == 'n'):
|
||||
# user := input('Type username : ')
|
||||
# continue
|
||||
# elif (confirm_user.lower() == 'y'):
|
||||
# break
|
||||
|
||||
|
||||
console.print('optimizing dnf.conf', style='ok')
|
||||
dnf_config()
|
||||
@@ -66,7 +55,7 @@ def main():
|
||||
|
||||
# This should not need sudo
|
||||
# Pass D or L to copy_dotfiles function
|
||||
while (True):
|
||||
while True:
|
||||
console.print('Set up dotfiles for Desktop (D) or Laptop (L) ?', style='rule')
|
||||
setup = input('>').lower()
|
||||
if setup == 'l' or setup == 'd':
|
||||
@@ -80,11 +69,11 @@ def main():
|
||||
subprocess.run(f"chown -R {user}:{user} {home}", shell=True, stdout=subprocess.DEVNULL)
|
||||
|
||||
|
||||
|
||||
################
|
||||
# END OF MAIN #
|
||||
################
|
||||
|
||||
|
||||
def dnf_config():
|
||||
console.rule("Configuring dnf", style='checked')
|
||||
|
||||
@@ -100,8 +89,16 @@ def dnf_config():
|
||||
else:
|
||||
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/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/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,
|
||||
)
|
||||
console.print('rpmfusion added to repos :heavy_check_mark:', style='ok')
|
||||
logger.info('rpmfusion added to repos')
|
||||
|
||||
@@ -111,7 +108,6 @@ def dnf_config():
|
||||
|
||||
|
||||
def hyprland():
|
||||
|
||||
console.rule("Configuring hyprland", style='checked')
|
||||
if not os.path.exists(home + '/.local/bin'):
|
||||
os.mkdir(home + '/.local/bin')
|
||||
@@ -161,7 +157,6 @@ def install_programs_dnf():
|
||||
flatpaks = parser.get('Flatpak')
|
||||
copr = parser.get('Copr')
|
||||
|
||||
|
||||
# try to add repos
|
||||
if repos:
|
||||
for url in repos:
|
||||
@@ -208,6 +203,7 @@ def sudo_check():
|
||||
else:
|
||||
console.print('ok :heavy_check_mark:', style='ok')
|
||||
|
||||
|
||||
# Oh my zsh setup + flathub
|
||||
def zsh_fonts():
|
||||
console.rule("Installing Zsh fonts", style='checked')
|
||||
@@ -235,11 +231,17 @@ def zsh_fonts():
|
||||
|
||||
console.print("installing oh my zsh auto suggestions ", style='ok')
|
||||
# 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')
|
||||
# powerlevel 10k
|
||||
subprocess.run(f"git clone --depth=1 https://github.com/romkatv/powerlevel10k.git {home}/.oh-my-zsh/custom/themes/powerlevel10k", shell=True)
|
||||
subprocess.run(
|
||||
f"git clone --depth=1 https://github.com/romkatv/powerlevel10k.git {home}/.oh-my-zsh/custom/themes/powerlevel10k",
|
||||
shell=True,
|
||||
)
|
||||
logger.info('Installed Oh_my_zsh , powerlevel10k , autosuggestions')
|
||||
|
||||
except Exception as e:
|
||||
@@ -248,17 +250,36 @@ def zsh_fonts():
|
||||
|
||||
console.print("installing flathub", style='ok')
|
||||
# flathub
|
||||
subprocess.run('flatpak remote-add --if-not-exists flathub https://flatInstalled programs in data.txthub.org/repo/flathub.flatpakrepo', shell=True, stdout=subprocess.DEVNULL)
|
||||
subprocess.run(
|
||||
'flatpak remote-add --if-not-exists flathub https://flatInstalled programs in data.txthub.org/repo/flathub.flatpakrepo',
|
||||
shell=True,
|
||||
stdout=subprocess.DEVNULL,
|
||||
)
|
||||
logger.info('Installed Flathub')
|
||||
|
||||
|
||||
# copy and override dotfiles
|
||||
def copy_dotfiles(setup):
|
||||
console.rule("Copying Dotfiles", style='checked')
|
||||
|
||||
# list of relevant configs
|
||||
lis = os.listdir()
|
||||
exceptions = ['.git', '.bashrc','.zshrc','retired','data.conf','wrappedhl','Hyprland','install.sh',
|
||||
'logg.log','README.md','.gitignore','rice-cook.py','Laptop-configs','.ideavimrc']
|
||||
exceptions = [
|
||||
'.git',
|
||||
'.bashrc',
|
||||
'.zshrc',
|
||||
'retired',
|
||||
'data.conf',
|
||||
'wrappedhl',
|
||||
'Hyprland',
|
||||
'install.sh',
|
||||
'logg.log',
|
||||
'README.md',
|
||||
'.gitignore',
|
||||
'rice-cook.py',
|
||||
'Laptop-configs',
|
||||
'.ideavimrc',
|
||||
]
|
||||
|
||||
for z in exceptions:
|
||||
if z in lis:
|
||||
@@ -271,13 +292,13 @@ def copy_dotfiles(setup):
|
||||
shutil.copy2('.vimrc', home)
|
||||
shutil.copy2('.ideavimrc', home)
|
||||
|
||||
if (setup =='l'):
|
||||
if setup == 'l':
|
||||
console.print("Setting up dotfiles for Laptop", style='ok')
|
||||
# copying files recursively
|
||||
for dir in lis:
|
||||
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')
|
||||
|
||||
# copying files recursively
|
||||
@@ -301,6 +322,7 @@ def executable_scripts():
|
||||
console.print("Job done :heavy_check_mark:", style='ok')
|
||||
logger.info('Made scripts in .config executable')
|
||||
|
||||
|
||||
# need sudo
|
||||
def msic_configs():
|
||||
console.rule('Setting up final configs', style='checked')
|
||||
@@ -328,13 +350,21 @@ def msic_configs():
|
||||
logger.info('Fonts downloaded ')
|
||||
|
||||
# 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,
|
||||
)
|
||||
console.print("Icons have been downloaded :heavy_check_mark:", style='ok')
|
||||
logger.info('candy-icons downloaded')
|
||||
|
||||
try:
|
||||
themes_urls =['https://drive.google.com/uc?id=1KkqC5vaBjePSHxjBI_8PWfm3jNW5gO7k','https://drive.google.com/uc?id=1-qq3wmuQhkKHpW_8OrRNS92AHD9LE4un'
|
||||
,'https://drive.google.com/uc?id=1mxkN9b4Ws7CeqF_KaTlA3dA5e75UUa4y','https://drive.google.com/uc?id=1cYLRsxmWeQJMOS7QEGEgJenRPKxgwN7X']
|
||||
themes_urls = [
|
||||
'https://drive.google.com/uc?id=1KkqC5vaBjePSHxjBI_8PWfm3jNW5gO7k',
|
||||
'https://drive.google.com/uc?id=1-qq3wmuQhkKHpW_8OrRNS92AHD9LE4un',
|
||||
'https://drive.google.com/uc?id=1mxkN9b4Ws7CeqF_KaTlA3dA5e75UUa4y',
|
||||
'https://drive.google.com/uc?id=1cYLRsxmWeQJMOS7QEGEgJenRPKxgwN7X',
|
||||
]
|
||||
|
||||
for index, file in enumerate(themes_urls):
|
||||
output = str(index) + '.zip'
|
||||
@@ -349,7 +379,9 @@ def msic_configs():
|
||||
|
||||
## Set themes Gtk
|
||||
subprocess.run("gsettings set org.gnome.desktop.interface icon-theme 'candy-icons'", shell=True)
|
||||
subprocess.run("gsettings set org.gnome.desktop.interface gtk-theme 'Catppuccin-Macchiato-Standard-Blue-Dark'", shell=True)
|
||||
subprocess.run(
|
||||
"gsettings set org.gnome.desktop.interface gtk-theme 'Catppuccin-Macchiato-Standard-Blue-Dark'", shell=True
|
||||
)
|
||||
subprocess.run("gsettings set org.gnome.desktop.interface font-name 'Roboto-Regular'", shell=True)
|
||||
|
||||
# Flatpak force theme
|
||||
@@ -365,7 +397,10 @@ def msic_configs():
|
||||
# codec and multimedia
|
||||
try:
|
||||
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,
|
||||
)
|
||||
subprocess.run('dnf update @sound-and-video', shell=True)
|
||||
|
||||
console.print("ffmpeg non free installed + all codecs :heavy_check_mark:", style='ok')
|
||||
@@ -376,12 +411,16 @@ def msic_configs():
|
||||
console.print("Something failed with new codecs :X:", style='error')
|
||||
|
||||
|
||||
|
||||
def systemd():
|
||||
console.rule('Enabling user services', style='checked')
|
||||
|
||||
user_services = ['gnome-keyring.service', 'ssh-agent.service', 'polkit-gnome-authentication-agent.service',
|
||||
'hypridle.service','gnome-keyring-daemon.service']
|
||||
user_services = [
|
||||
'gnome-keyring.service',
|
||||
'ssh-agent.service',
|
||||
'polkit-gnome-authentication-agent.service',
|
||||
'hypridle.service',
|
||||
'gnome-keyring-daemon.service',
|
||||
]
|
||||
|
||||
try:
|
||||
for services in user_services:
|
||||
@@ -391,7 +430,5 @@ def systemd():
|
||||
console.print("Error starting some services :X:", style='error')
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user