Skip to content

Commit

Permalink
Merge pull request #13 from 1337kid/dev
Browse files Browse the repository at this point in the history
v2.1
  • Loading branch information
1337kid committed May 17, 2024
2 parents e07ecfc + 821f259 commit 1ec66cf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
8 changes: 0 additions & 8 deletions NoiceGRUB.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@
if not os.path.exists(f'./fonts/{font_file}'):
richprint(f'[red bold][Error] {font_file} is not present in ./fonts/ [/red bold]')
exit()
choice = Confirm.ask("[yellow bold]Would you like to customise the font ?[/yellow bold]")
if choice:
table,fonts = font_table()
console.print(table)
font_choice = IntPrompt.ask("[yellow]Choice[/yellow]",choices=[str(i) for i in range(1,len(fonts)+1)])
preset[1]['font_family'] = fonts[font_choice]
font_size = IntPrompt.ask("[yellow]Font size in pixels (integer) [/yellow]")
preset[1]['selection_font'] = font_size

if preset[0]=='Kewl': NgCommonProps(preset).export_theme()
elif preset[0]=='Noice': NgNoiceTemplate(preset).export_theme()
Expand Down
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.2 :::::::\n'''
:::::::: @1337kid ::::::::::::::::::8 :::::::: v2.1 :::::::::\n'''
6 changes: 5 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ install() {
sed -i 's/.*GRUB_FONT=.*//' /etc/default/grub
echo "GRUB_FONT=$THEME_PATH/$font_name" >> /etc/default/grub #font location

#========= GRUB config disable console
if [[ $(grep "^GRUB_TERMINAL" /etc/default/grub) ]];then
printf "\033[92m[+] \033[94mDisabling GRUB_TERMINAL=console (to enable graphical GRUB menu)\n"
sudo sed -i 's/GRUB_TERMINAL/#GRUB_TERMINAL/' /etc/default/grub
fi
#========= GRUB update
#
printf "\033[92m[+] \033[94mUpdating GRUB config\n\033[92m"
update_grub_func
}
Expand Down
19 changes: 17 additions & 2 deletions scripts/remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,23 @@ THEME_PATH=$GRUB_PATH"themes/noicegrub"
printf "\033[92m[+] \033[94mRemoving NoiceGRUB theme\n\033[92m"
rm -rf $THEME_PATH 2>/dev/null
#===== grub config
sed -i 's/.*GRUB_THEME=.*//' /etc/default/grub
sed -i 's/.*GRUB_FONT=.*//' /etc/default/grub
printf "\033[92m[+] \033[94mRestoring GRUB config\n\033[92m"
printf "\033[92m[+] \033[94mChecking for backup (/etc/default/grub.bak)\n\033[92m"
if [[ -f /etc/default/grub.bak ]]; then
rm /etc/default/grub
mv /etc/default/grub.bak /etc/default/grub
else
printf "\033[92m[+] \033[94mChecking for default config (/usr/share/grub/default/grub)\n\033[92m"
if [[ -f /usr/share/grub/default ]]; then
rm /etc/default/grub
mv /usr/share/grub/default/grub /etc/default/grub
else
printf "\033[91mError: Could not find backup config\n"
printf "\033[92m[+] \033[94mModifyng present config\n\033[92m"
sed -i 's/.*GRUB_THEME=.*//' /etc/default/grub
sed -i 's/.*GRUB_FONT=.*//' /etc/default/grub
fi
fi
#=====
printf "\033[92m[+] \033[94mUpdating GRUB config\n\033[92m"
update_grub_func

0 comments on commit 1ec66cf

Please sign in to comment.