Skip to content

Commit

Permalink
v2.0.2
Browse files Browse the repository at this point in the history
v2.0.2
  • Loading branch information
1337kid committed May 13, 2024
2 parents d35fcac + c32c4df commit e07ecfc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion noicegrub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def gen_font_name(font_name,size):
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 :::::::: v2.0.1 :::::::\n'''
:::::::: @1337kid ::::::::::::::::::8 :::::::: v2.0.2 :::::::\n'''
6 changes: 4 additions & 2 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ check_uid() {
}

update_grub_func() {
if [[ $(which dnf) != "" ]];then
if [[ $(which dnf 2>/dev/null) != "" ]];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
elif [[ $(which grub-mkconfig 2>/dev/null) != "" ]];then
grub-mkconfig -o /boot/grub/grub.cfg
else
update-grub
fi
Expand All @@ -29,4 +31,4 @@ get_path() {
elif [[ -d "/boot/efi/EFI/fedora" ]]; then
GRUB_PATH='/boot/efi/EFI/fedora/'
fi
}
}
10 changes: 9 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ makefont() {
font=$(ls ./export | grep -E '.ttf|.otf')
size=$(echo $font | awk -F '.' '{print $2}')
name="$(echo $font | awk -F '.' '{print $1}').pf2"
if [[ $(which grub2-mkfont) != "" ]];then
if [[ $(which grub2-mkfont 2>/dev/null) != "" ]];then
grub2-mkfont -s $size -o $THEME_PATH/$name ./export/$font 2>/dev/null
else
grub-mkfont -s $size -o $THEME_PATH/$name ./export/$font 2>/dev/null
Expand All @@ -25,6 +25,10 @@ install() {
cp ./export/* $THEME_PATH

#======== /etc/default/grub config file
if [[ $(grep "noicegrub" /etc/default/grub) == "" ]];then
printf "\033[92m[+] \033[94mBacking up GRUB config (/etc/default/grub.bak)\n"
cp /etc/default/grub /etc/default/grub.bak
fi
sed -i 's/.*GRUB_THEME=.*//' /etc/default/grub
echo "GRUB_THEME=$THEME_PATH/theme.txt" >> /etc/default/grub #theme location
font_name=$(makefont)
Expand All @@ -50,6 +54,10 @@ cat <<EOF
EOF

check_uid
if [[ ! -f /etc/default/grub ]]; then
printf "\033[91mError: /etc/default/grub file not found. Make sure GRUB is installed.\n"
exit
fi
get_path
THEME_PATH=$GRUB_PATH"themes/noicegrub"
printf "\033[1m\033[93m"
Expand Down

0 comments on commit e07ecfc

Please sign in to comment.