-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added new font flag #23
base: master
Are you sure you want to change the base?
Conversation
referencing issue #18 |
This seems as exactly what I expected! But the fonts folder should be outside Regarding your questions:
|
Is this a high priority issue? Because I probably won't be able to work on it until weekend... I'm sorry |
supported_fonts=(poiret-one karla pattaya) | ||
|
||
# Set the chosen font | ||
if [[ ! " ${FONT} " == " " ]] && [[ " ${supported_fonts[@] " =~ " ${FONT} " ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${supported_fonts[@]}
right curly brace is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, will fix it in the next commit
@@ -18,6 +18,11 @@ case $key in | |||
shift # past argument | |||
shift # past value | |||
;; | |||
-f|--font) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess since this is written in a case switch so we cannot have both the options -p
and -f
working together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually fine. If you want to know why i suggest you to read the documentation for shift command here :). What is happening in this while loop is that it checks for all flags attached to the command and processes them one by one.
# Set the chosen font | ||
if [[ ! " ${FONT} " == " " ]] && [[ " ${supported_fonts[@] " =~ " ${FONT} " ]]; then | ||
echo -e "Setting font to ${FONT}" | ||
grub-mkfont "./Matter/fonts/${FONT}/${FONT}-regular.ttf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to supply an output path like grub-mkfont -s 20 -o /Matter/${FONT}.pf2 "./Matter/fonts/${FONT}/${FONT}-regular.ttf"
But even if we do so, and change the contents of theme.txt
by sed
(as is done for palette colors), still the generated pf2
font file will remain in the current directory (not copied to the /boot/grub/themes/Matter
dir) because the Matter
dir is being copied to the /boot/grub/themes/Matter
dir even before the palette colors are changed. It is being changed directly into the theme.txt
which is present in the /boot/grub/themes/Matter
dir by sed
.
What I have done so far (because I don't know how to do it) is to manually copy the generated pf2
file after the Matter dir has been copied to /boot/grub/themes/
dir and replaced the font in theme.txt
manually. This works on my system but it should really be incorporated into this script.
Therefore, the things to be done may include -
- adding support for both
-p
and-f
options - for -f option, generate and copy the
pf2
file to the/boot/grub/themes/Matter
dir - change font in
theme.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be solved by moving the # Copy theme
just above # Set theme
and options like -p
and -f
should modify the local Matter
folder before moving it to /boot/grub/themes
so far, this is what I've done:
To be honest, I'm kinda lost...
I'm not sure if this is what you are looking for or if I'm on the right track. I'm looking for some input/feedback.
Also I have some questions:
If there is something you'd like to ask, let me know.
Thank you!