Skip to content

Commit

Permalink
Merge pull request #7 from 1337kid/dev
Browse files Browse the repository at this point in the history
v1.8.3
  • Loading branch information
1337kid committed Nov 27, 2023
2 parents a94a81e + 07ec454 commit bf84fe2
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 20 deletions.
8 changes: 3 additions & 5 deletions NoiceGRUB.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
elif preset[0]=='Mountains': NgMountainsTemplate(preset).export_theme()
elif preset[0]=='Nico': NgNicoTemplate(preset).export_theme()

if Confirm.ask('[yellow bold]Do you want to place the generated theme in /boot/grub/themes/[/yellow bold]'):
richprint('\n[green bold]Executing scripts/install.sh ... [/green bold]')
os.system('chmod +x ./scripts/install.sh')
os.system('sudo ./scripts/install.sh')
richprint('[green bold]Done')
richprint('\n[green bold]Executing scripts/install.sh ... [/green bold]')
os.system('chmod +x ./scripts/install.sh')
os.system('sudo ./scripts/install.sh')
richprint('[green bold]Thankyou for using NoiceGRUB[/green bold]')
2 changes: 1 addition & 1 deletion noicegrub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def preset_table():
8 `b8 8 8 8 8 . 8. 8 8 8 8 8 8 8 8
8 `8 `YooP' 8 `YooP' `Yooo' `YooP8 8 8 `YooP' 8oooP'
..:::..:.....::..:.....::.....::....8 :..:::..:.....::......:
:::::::: @1337kid ::::::::::::::::::8 ::::::: v1.8.2 :::::::::\n'''
:::::::: @1337kid ::::::::::::::::::8 ::::::: v1.8.3 ::::::::\n'''
50 changes: 36 additions & 14 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
#!/bin/bash

GRUB_PATH=''
THEMES_PATH=''

#==========================
get_path() {
if [[ -d "/boot/grub2" ]]; then
THEMES_PATH='/boot/grub2/themes/noicegrub'
GRUB_PATH='/boot/grub2/'
elif [[ -d "/boot/grub" ]]; then
THEMES_PATH='/boot/grub/themes/noicegrub'
GRUB_PATH='/boot/grub/'
elif [[ -d "/boot/efi/EFI/fedora" ]]; then
THEMES_PATH='/boot/efi/EFI/fedora/themes/noicegrub'
GRUB_PATH='/boot/efi/EFI/fedora/'
fi
}

get_path

install() {
printf "\033[92m[+] \033[94mCreating $THEME_PATH\n"
mkdir -p $THEME_PATH
printf "\033[92m[+] \033[94mCopying files\n"
cp ./export/* $THEME_PATH
sed -i 's/.*GRUB_THEME=.*//' /etc/default/grub
echo "GRUB_THEME=$THEME_PATH/theme.txt" >> /etc/default/grub
#
#========= GRUB update
#
printf "\033[92m[+] \033[94mUpdating GRUB config\n\033[92m"
if [[ $(which dnf) != "" ]];then
fedora_version=$(cat /etc/fedora-release | awk '{print $3}')
if [[ fedora_version -gt 34 ]];then
grub2-mkconfig -o /boot/grub2/grub.cfg
else
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
fi
else
update-grub
fi
}
#=========================

printf "\033[94m\033[1m"
Expand All @@ -23,7 +45,7 @@ cat <<EOF
| | . | | _| -_| . | _| | | . | | | . | . | _|
|_|_|___|_|___|___|_ |_| |___|___|___| _|___|_|
|___| |_|
NoiceGRUB Theme Installer v1.3
NoiceGRUB Theme Installer
EOF

Expand All @@ -33,11 +55,11 @@ then
exit
fi

printf "\033[92m[+] \033[94mCreating $THEMES_PATH\n"
mkdir -p $THEMES_PATH
printf "\033[92m[+] \033[94mCopying files\n"
cp ./export/* $THEMES_PATH
sed -i 's/.*GRUB_THEME=.*//' /etc/default/grub
echo "GRUB_THEME=$THEMES_PATH/theme.txt" >> /etc/default/grub
printf "\033[92m[+] \033[94mRunning update-grub\n\033[92m"
update-grub
get_path
THEME_PATH=$GRUB_PATH"themes/noicegrub"
printf "\033[1m\033[93m"
read -p "Do you want to place the generated theme in $GRUB_PATH [y/n] " inst
case $inst in
[Yy]* ) install;;
* ) exit;;
esac

0 comments on commit bf84fe2

Please sign in to comment.