mateosss / matter

Customizable GRUB theme inspired by Material Design
Boost Software License 1.0
868 stars 50 forks source link

Improve Fedora Support #41

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi, i downloaded matter and try to run the script. I'm on Fedora. I have this error:

I] [MATTER GRUB THEME] [I] Argument -i required. Which icons go to which grub entries?. [I] Your grub entries are: Traceback (most recent call last): File "./matter.py", line 715, in do_preinstall_hint() File "./matter.py", line 470, in do_preinstall_hint do_list_grub_cfg_entries() File "./matter.py", line 517, in do_list_grub_cfg_entries with open(GRUB_CFG_PATH, "r", newline="") as f: FileNotFoundError: [Errno 2] No such file or directory: '/boot/grub/grub.cfg'

mateosss commented 4 years ago

Unfortunately I did not test the theme on distros that were not ubuntu derivatives hoping that issues like this one will appear to know which distros people are using Matter with. Fedora is one of the distros I did not try Matter on :sweat_smile:. I will be trying to adapt matter to it as soon as I can. Thanks for your report.

ghost commented 4 years ago

I found out that there is no folder grub. There is only a folder called grub2. Can i use this folder to put the Matter inside? The Grub 2 Folder has a folder called themes.

mateosss commented 4 years ago

While you could drop the ./Matter folder that is generated by matter.py (if it is being generated properly even with the error you get), you will only get the font and colors and not the icons.

In https://github.com/mateosss/matter/#what-does-matter-do-to-my-system-files it is explained what files matter needs to touch, in theory, if every file has the same structure as an ubuntu derivative, it should be a matter (pun intended as always) of replacing some paths. If you feel comfortable with grub config files you could try it out, if not I will eventually install fedora in a vm and try to make it work.

ghost commented 4 years ago

Okay, here is what i did so far:

  1. I put the Matter folder that's inside the zip file under /boot/grub2/themes That's the folder with the theme.txt not with the example.theme file! I think that this is the generated one...
  2. I saved the grub configuration sudo /etc/default/grub /etc/default/grub.bak
  3. I changed the configuration sudo gedit /etc/default/grub
  4. I wrote the line: GRUB_THEME="/boot/grub2/themes/Matter/theme.txt"
  5. I took the line out: #GRUB_TERMINAL_OUTPUT="console"
  6. I change the resolution to GRUB_GFXMODE=3840x2160
  7. i did a sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg -> That's grub-update for Fedora
  8. The theme was found.

I only have the colors now. The font is not applying and the resolution isn't too. The folder structure is different. So i have to fix:

  1. Resolution
  2. Applying the Google Fonts
  3. Make Icons work

;)

mateosss commented 4 years ago

Great! It helps me as well.

  1. For the resolution, see this paragraph to see which ones your grub supports.
  2. For the font, you need to set its correct name in Matter/theme.txt properties boot_menu -> item_font and label -> font. To see the name of the font that is being loaded, follow this one
  3. For the icons, that is trickier and my previous answer applies.
mateosss commented 4 years ago

Finally I got some time to work on this. So Fedora conforms to what is called The Boot Loader Specification. Unfortunately Matter does not, and expects regular grub files (as it was made to work primarily on Ubuntu). However from Fedora you can easily disable this and revert to regular grub configurations. Also some changes were made on Matter for grub2-* like commands which Fedora uses and Ubuntu don't.

For it to work, you should: (tested on a Fedora 32 virtualbox machine)

  1. Change GRUB_ENABLE_BLSCFG option to false in /etc/default/grub
  2. Regenerate grub.cfg with sudo grub2-mkconfig -o /boot/grub2/grub.cfg

And now, you should be able to install Matter as usual. Also grub-customizer should now work if you are interested in renaming/moving your grub entries. So after that I got this:

2020-08-11-135836_1920x1080_scrot

My main concerns are if this version works on EFI environments as the virtual machine was not.

In any case, I uploaded this Fedora support release, could you try it out @congomonster?

mateosss commented 4 years ago

I merged the fedora-support branch with a notice for fedora users on the quick start section. It would be nice for it to work without that extra step from users. Also I'm still not sure if it will work for EFI bootloaders.

I will rename this issue to be the main one related to supporting Fedora.

brneor commented 4 years ago

My main concerns are if this version works on EFI environments as the virtual machine was not.

Can't get it to work on an EFI system following the instructions. I'll dig deeper to see what I can do.

brneor commented 4 years ago

Got it partially working (only Fedora icon showing up) by setting GRUB_THEME to /boot/grub2/themes/Matter/theme.txt

mateosss commented 4 years ago

Great! what did you do for it to work on EFI? If everything else went right, the icons should placed by updating your grub.cfg file with sudo grub2-mkconfig -o /boot/grub2/grub.cfg.