Skip to content

Commit

Permalink
v2.0 - Font customisation
Browse files Browse the repository at this point in the history
  • Loading branch information
1337kid committed Dec 20, 2023
1 parent 29bcdfb commit c440518
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion NoiceGRUB.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
preset = get_preset(preset_dict[choice])
table = preset_info_table(preset)
console.print(table)
font_file = preset[1]['font_family']
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()
Expand All @@ -42,7 +46,7 @@
elif preset[0]=='Mountains': NgMountainsTemplate(preset).export_theme()
elif preset[0]=='Nico': NgNicoTemplate(preset).export_theme()

richprint(f'\n[cyan bold]Generated theme has been placed in {os.getcwd()}/export/ [/cyan bold]')
richprint('\n[cyan bold]Generated theme has been placed in ./export/ [/cyan bold]')
choice = Confirm.ask("[yellow bold]Would you like to install the theme ?[/yellow bold]")
if choice:
richprint('\n[green bold]Executing scripts/install.sh ... [/green bold]')
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NoiceGRUB
#### NoiceGRUB is a collection of linear gradient based GRUB2 themes that can be customised. By default NoiceGRUB comes with 4 templates and 8 presets.
#### NoiceGRUB is a collection of linear gradient based GRUB2 themes that can be customised. By default NoiceGRUB comes with 5 templates and 10 presets.
# Contents
* [**Installation**][1]
* [**Presets**][2]
Expand All @@ -18,7 +18,8 @@ python3 NoiceGRUB.py
```
## [Presets][2]
### [Create Your Own Preset][3]
NoiceGRUB preset files have the syntax of TOML and ends with `.toml` extension. Your own preset shall be placed in `presets` folder. It will be shown in the preset menu when you execute `NoiceGRUB.py`
NoiceGRUB preset files have the syntax of TOML and ends with `.toml` extension. Your own preset shall be placed in `presets` folder. It will be shown in the preset menu when you execute `NoiceGRUB.py` <br/><br/>
Fonts are placed in `fonts` folder. User defined fonts should be place in this folder to be recognised by NoiceGRUB
#### File format
```toml
template='template name here'
Expand All @@ -30,6 +31,8 @@ secondary="secondary gradient colour"
header_font_colour = "header font colour or 'BOOTMENU' text colour"
footer_font_colour = "footer font colour or GRUB keymap text colour"
selection_bg_colour = "backgound colour of selection highlighter"
selection_font = "font size in pixels (integer)"
font_family = ".ttf or .otf font filename"

# This section defines theme.txt file and is mandatory too
[theme]
Expand Down
Binary file modified img/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c440518

Please sign in to comment.