GithubHelp home page GithubHelp logo

mateosss / matter Goto Github PK

View Code? Open in Web Editor NEW
854.0 9.0 50.0 1.14 MB

Customizable GRUB theme inspired by Material Design

License: Boost Software License 1.0

Python 100.00%
material-design grub google-fonts material-design-icons grub-themes hacktoberfest

matter's People

Contributors

ahellqui avatar danielbiegler avatar ethanbarclay avatar franciscodemaussion avatar heyzec avatar julio-b avatar krausekurt avatar mateosss avatar nirajankeybridge avatar obiwanrohan avatar sephger avatar stegschreck avatar vangyyy avatar weathercold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matter's Issues

error: null src bitmap in grub_video_bitmap_create_scaled.

On some installations this error appears sparingly. I'll let this issue here for anyone that gets it.

The same error mentioned in this project: grml/grml#16
and they seem to solve it by replacing the property desktop-color for desktop-image in theme.txt and a tiny png.

It would be nice to be able to reproduce this issue and then solve it.

Bundle svg converter into Matter

As of now Matter has two dependencies.

  • ImageMagick: which brings the convert command for convertig icons in svg to png
  • Inkscape: big in size but improves the default ImageMagick svg converter a lot, without it, icons usually look odd.

These packages seem to be bringing a lot of trouble, it would be great to have an svg converter bundled directly into Matter so that there would be no more problems with dependencies.

Automate svg-icons conversion to png

It is necessary to make a svg2png.sh script that uses the convert command and converts the icons from svg-icons into Matter/icons/ folder of size 72x72.

Be aware that the conversion mentioned in #5 generates some problems with the icon borders. The fix should avoid that.

Also another commands instead of convert could be used, but that's the main one I know of.

And lastly, there is only one Icon in svg-icons folder right now, and it was manually centered in inkscape, it would be nice, as an optional feature, that the svgs needn't the manual treatment, and could be used directly with the bounding box added automatically as specified in the wiki

Broken Download

Downloading zip archive from the readme link results in completely empty subdirectories.

image

Add default icons

When there are menuentrys or submenus without a --class value in /boot/grub/grub.cfg, there is no icon, it would be nice to always have at least one default icon.

Icons not showing correct

I installed icons for Linux mint and arch. Only one arch icon is showing, the Linuxmint and folder icons are missing. I'm using grub, any help or ideas?

Error during uninstall

During installation something went wrong and my grub didn't show any of the icons I told the matter script to use.

So I tried to uninstall it and received this message:

[I] Begin Matter uninstall
[I] Request root access
[sudo] Passwort für laubblaeser: 
[I] Begin Matter uninstall
[I] Clean Matter Theme Overrides from /etc/default/grub
[I] Clean Matter Theme Overrides from /usr/bin/grub-mkconfig
[I] Clean install directory
[I] Update grub.cfg
[I] Remake grub.cfg with /usr/bin/update-grub -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.8-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.8-x86_64.img
Found initrd fallback image: /boot/initramfs-5.8-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.7-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.7-x86_64.img
Found initrd fallback image: /boot/initramfs-5.7-x86_64-fallback.img
Found Windows Boot Manager on /dev/sda3@/EFI/Microsoft/Boot/bootmgfw.efi
Found linux image: /boot/vmlinuz-5.8-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.8-x86_64.img
Found initrd fallback image: /boot/initramfs-5.8-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.7-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.7-x86_64.img
Found initrd fallback image: /boot/initramfs-5.7-x86_64-fallback.img
Found memtest86+ image: /boot/memtest86+/memtest.bin
/usr/bin/grub-probe: Warnung: Unbekannter Gerätetyp nvme0n1.
Adding boot menu entry for UEFI Firmware Settings ...
Adding boot menu entry for UEFI Firmware Settings ...
Adding boot menu entry for UEFI Firmware Settings ...
Found memtest86+ image: /boot/memtest86+/memtest.bin
/usr/bin/grub-probe: Warnung: Unbekannter Gerätetyp nvme0n1.
Fehler: syntax error.
Fehler: Incorrect command.
Fehler: syntax error.
Syntaxfehler in Zeile 272
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
[I] Matter succesfully uninstalled

Sorry that parts are in German. I think you can still get the gist of it.
I'm especially wondering about the errors Fehler: ... at the end.
What could I do to fix this?

Problems that can arise if user moves matter folder, or deletes it

If a user accidentally moves the matter folder or deletes it, it can lead to this error when uninstalling old kernels. It may not be easy to realise that it is caused by matter folder.

sudo apt remove 'linux-*5.6.0-*' -f

The following packages will be REMOVED:
  linux-headers-5.6.0-1056-oem linux-image-5.6.0-1056-oem linux-modules-5.6.0-1048-oem linux-modules-5.6.0-1056-oem
  linux-oem-5.6-headers-5.6.0-1048 linux-oem-5.6-headers-5.6.0-1056
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 722 MB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 387302 files and directories currently installed.)
Removing linux-image-5.6.0-1056-oem (5.6.0-1056.60) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.6.0-1056-oem
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Sourcing file `/etc/default/grub.d/oem-flavour.cfg'
Generating grub configuration file ...
Found theme: /boot/grub/themes/Matter/theme.txt
Found linux image: /boot/vmlinuz-5.10.0-1029-oem
Found initrd image: /boot/initrd.img-5.10.0-1029-oem
Found linux image: /boot/vmlinuz-5.8.0-55-generic
Found initrd image: /boot/initrd.img-5.8.0-55-generic
Found linux image: /boot/vmlinuz-5.8.0-53-generic
Found initrd image: /boot/initrd.img-5.8.0-53-generic
Found linux image: /boot/vmlinuz-5.8.0-50-generic
Found initrd image: /boot/initrd.img-5.8.0-50-generic
Found linux image: /boot/vmlinuz-5.8.0-43-generic
Found initrd image: /boot/initrd.img-5.8.0-43-generic
Found linux image: /boot/vmlinuz-5.10.0-1029-oem
Found initrd image: /boot/initrd.img-5.10.0-1029-oem
Found linux image: /boot/vmlinuz-5.8.0-55-generic
Found initrd image: /boot/initrd.img-5.8.0-55-generic
Found linux image: /boot/vmlinuz-5.8.0-53-generic
Found initrd image: /boot/initrd.img-5.8.0-53-generic
Found linux image: /boot/vmlinuz-5.8.0-50-generic
Found initrd image: /boot/initrd.img-5.8.0-50-generic
Found linux image: /boot/vmlinuz-5.8.0-43-generic
Found initrd image: /boot/initrd.img-5.8.0-43-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
[I] [Matter] Setting entry icons
[I] Found /usr/sbin/grub-mkconfig hook
done
/usr/sbin/grub-mkconfig: 326: /home/heyzec/Desktop/matter/matter/matter.py: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.6.0-1056-oem (--remove):
 installed linux-image-5.6.0-1056-oem package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.6.0-1056-oem
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Convert error on Arch derivatives

Hi, it looks close to awesome, however no matter what I do icons do not seem to show up, the feedback says that all five icons are created and when I run update-grub it says they are being included, not sure what is going on, any help would be appreciated.

Running: Garuda Linux, Windows 10

Add custom background feature

Are there any plans for user to add a custom background using this script? Currently, I am customising my background by editing the theme.txt.template file and manually copying the background picture into the /boot/grub/themes folder. Adding this feature into the python script shouldn't be too hard. I wouldn't mind being assigned this issue.

Type Error

$>> python3 matter.py -b -hl 888888 -bg 262321 -fg ffffff -ic dfdfdf

[I] Build theme from user preferences
Traceback (most recent call last):
File "/home/artem/matter/matter.py", line 856, in
prepare_source_dir()
File "/home/artem/matter/matter.py", line 334, in prepare_source_dir
if len(icons) != len(entries):
TypeError: object of type 'NoneType' has no len()
$>>

Matter should set up its own installation files

Currently, the user is asked to download the folder to a "safe" location and then run the script. Instead, the installation directory should be handled automatically by matter without requesting the user to be careful. Issues like #67 occur because of this.

An idea for improving Matter installation would be to do something like other command-line utilities and provide an installation script, something like wget -qO- https://raw.githubusercontent.com/mateosss/matter/v1.2.1/install.py | python3

And then make the current matter.py utility just a matter command in the user PATH.

Another idea would be to make Matter installable through pip like grub2-theme-preview.

Use a smaller font on grub console.

When you press the C key while on grub to go to the grub terminal, it is using the same font as in the main view which is huge and it is a bit annoying.

Would be nice to use the other font that grub already is loading Unifont Regular 16, which is smaller and better at being a console font.

Extra points if you find out if this Unifont Regular 16 will work on other non ubuntu based distros.

Add --font-size flag

After #18 is resolved, a --font-size or -s flag is needed for generating the pf2 file based not only in the correct font, but also with the correct size.

In the future this flag will be used for making the theme adaptable to different screen resolutions.

Change user grub settings to 1920x1080 if available

Right now Matter only works properly on a 1920x1080 grub screen.

When a user runs set-matter.sh the script should detect if the resolution 1920x1080 would be available (is listed when running vbeinfo on grub terminal), and if so, change the GRUB_GFXMODE property in /etc/default/grub to 1920x1080.
If 1920x1080 is not available, cancel the installation.

Read this short wiki page before starting https://github.com/mateosss/matter/wiki/Considerations

Be sure to ask in the comments for any questions!

Matter lost my fedora entries

Hello! I've recently installed matter theme, played with it and remove it. Next I tryed to install in again, but it lost my fedora entries and GRUB looks default.

sudo ./matter.py

[sudo] password for vasily:
[I] [ Matter GRUB THEME ]
[I] Argument -i required. Which icons go to which grub entries?
[I] Your grub entries are:
1. Windows Boot Manager (on /dev/nvme0n1p1)
2. UEFI Firmware Settings
[I] Look for icons you like at https://materialdesignicons.com/
[I] Then install with:
[I] ./matter.py -i icon-for-entry-1 icon-for-entry-2 ...
[I] Example (with 8 entries, _ means ignore):
[I] ./matter.py -i ubuntu microsoft-windows folder _ _ _ _ cog

config.json

icons |  
-- | --
Fedora Linux (5.19.16-200.fc36.x86_64) 36 (Workstation Edition) | "fedora"
Fedora Linux (5.19.6-200.fc36.x86_64) 36 (Workstation Edition) | "_"
Fedora Linux (5.18.19-200.fc36.x86_64) 36 (Workstation Edition) | "_"
Fedora Linux (0-rescue-aa1d5af998b24c1487127f33ef936e0b) 36 (Workstation Edition) | "_"
Windows Boot Manager (on /dev/nvme0n1p1) | "microsoft-windows"
UEFI Firmware Settings | "cog"

System informarion:
OS: Fedora release 36 (Thirty Six) x86_64
Kernel: 5.19.16-200.fc36.x86_64
Resolution: 1920x1080
WM: i3

Sorry, it is my first issue on gh. If I should provide more informarion about my system, I will.

Text blurry with any font size and native resolution

I've been testing matter for the last couple of hours, however, I noticed that text in GRUB is completely blurry. Interestingly, the icons are perfectly sharp.

I've tried changing and forcing GRUB's resolution, playing with different font sizes, using different fonts and even adding every option possible to grub-mkfont!

For reference (taken from QEMU, tho it also happens irl):

image

This is with GRUB version 2.04-1ubuntu26 running over Pop!_OS, freshly installed. I'm using matter from master, and installed all the requirements directly from Ubuntu's repositories.

The convert command returned an error

Hello. Im running in MX Linux 19.2 patito feo.
when i run matter, i got this error:

-hl bd93f8 -fg f8f8f3 -bg 282a36 \                                             
-ff /usr/share/fonts/truetype/Ubuntu/Ubuntu\ Medium\ Nerd\ Font\ Complete.ttf \
-fn Ubuntu Nerd Font -fs 32
[I] Begin Matter install
[I] Build theme from user preferences
[I] Download debian.svg
[I] Download folder.svg
[I] Download memory.svg
[I] Download microsoft-windows.svg
[I] Download cog.svg
[I] Convert icons
convert-im6.q16: no decode delegate for this image format `' @ error/constitute.c/ReadImage/560.
convert-im6.q16: unable to open image `Repos/matter/icons/debian.svg': No such file or directory @ error/blob.c/OpenBlob/2874.
convert-im6.q16: delegate failed `'rsvg-convert' -o '%o' '%i'' @ error/delegate.c/InvokeDelegate/1928.
convert-im6.q16: unable to open file `/tmp/magick-18436rdkJflvHXxwW': No such file or directory @ error/constitute.c/ReadImage/600.
convert-im6.q16: no decode delegate for this image format `' @ error/constitute.c/ReadImage/560.
convert-im6.q16: no images defined `Repos/matter/Matter/icons/debian.png' @ error/convert.c/ConvertImageCommand/3258.
[E] Stop. The convert command returned an error. ```


any help?

Add a license

Adding a license (legally) enables the creation and publishing of copies/forks of the project, among other benefits.

I noticed that one of the READMEs listed Vimix as a basis which was released under GPL3 -- if you used code from that project it might be wisest to license this project under the same.

If you're not sure what kind of license would be appropriate, see choosealicense.com for summaries and opinions on options.

Can't change fonts or background color on arch

I typed this in sudo Downloads/matter/matter.py -bg FFF8E1 -fg 263238 -hl E91E63 and this is what was returned

[I] Argument -i required. Which icons go to which grub entries?.
[I] Your grub entries are:
1. Arch Linux
2. Advanced options for Arch Linux
3. Arch Linux, with Linux linux
4. Arch Linux, with Linux linux (fallback initramfs)
5. Windows Boot Manager (on /dev/sda2)
[I] Look for icons you like at https://materialdesignicons.com/
[I] Then install with:
[I] ./matter.py -i icon-for-entry-1 icon-for-entry-2 ...
[I] Example (with 8 entries, _ means ignore):
[I] ./matter.py -i ubuntu microsoft-windows folder _ _ _ _ cog

I tried setting icons and changing background in the same line but it still won't work. Help.

Add --uninstall flag

Add a way to revert the theme directly from the script with --uninstall or -u options.
It should completely remove matter from /etc/grub/themes and leave a working grub.

Missing grub-mkfont

Hello! In README you ask to create an issue if grub-mkfont (or grub2-mkfont) is missing on my system. So here I am.
grub-mkfont only comes with truetype USE flag in portage (Gentoo)

Great project btw

convert from imagemagick not found

Hi, I'm on ubuntu 20.04, with inkscape --version: Inkscape 1.0 (9f2f71dc58, 2020-08-02)
Pango version: 1.40.14
This is what get when running matter:
[I] Begin Matter install
[I] Build theme from user preferences
[I] Convert icons
[E] Stop. The convert command from imagemagick was not found
[E] Consider installing inkscape

Improve palette customization

#7 Helped adding the basis for changing the text color between two palettes.
Now it would be nice to be able to easily add more palettes that let you change the background (desktop-color), the foreground (item_color and color) and the highlight (selected_item_color).

A palette should be something like

{
  name: "hicontrast",
  foreground: "#FFFFFF",
  background: "#000000",
  highlight: "#00E676"
}

Matter has too many dependencies

This is a real general issue, and I have no clue where to start to tackle it - but what do you think the chances are somebody will really install mtools, QEMU, grub2-something-something, and a ton more? I like keeping my system light - but I'd also really like to use this. Hence, I'd like to tackle killing off dependencies one by one.

Does anyone have thoughts on how we should start?

Add --font flag

Add a --font or -f flag to ./set-matter.sh with three options poiret-one, pattaya, and karla.
You can get the ttf files for those fonts here.

The idea is that the ttf files will be inside a fonts folder, and based on the selection, grub-mkfont will be used to generate the pf2 file and set the corresponding font in theme.txt.

KeyError: 'width' line 54, in inkscape_convert_svg2png

Hi,
I am facing an error like this:

Traceback (most recent call last):
  File "./matter.py", line 876, in <module>
    do_install()
  File "./matter.py", line 543, in do_install
    prepare_source_dir()
  File "./matter.py", line 386, in prepare_source_dir
    convert_icon_svg2png(icon)
  File "./matter.py", line 248, in convert_icon_svg2png
    exit_code = converter(color, src_path, dst_path, whisper=whisper)
  File "/home/jaza/Documents/Hacking/matter/svg2png.py", line 54, in inkscape_convert_svg2png
    int_ignore_units(root.attrib["width"]),
KeyError: 'width'

And here is the command I run:
sudo ./matter.py -i ubuntu folder _ _ _ _ _ _ microsoft-windows
I am just trying to change my GRUB theme using matter and I think all the dependency have been installed properly.

Thank you for your advice and solutions!

Partial solution to Matter temporarily breaking on kernel upgrade.

When upgrading a kernel in ubuntu, apt keeps the old version of the kernel until you do a sudo apt autoremove. In this way the amount of entries in your grub increases but Matter set itself to apply the same number of icons as grub entries the user had on installation.

In particular the command (the hook) that patches grub.cfg is written at the end of /usr/sbin/grub-mkconfig with exactly the same icons the user originally specified. But if the number of entries varies, this command will just not do anything and return a warning for the user.

It would be nice to have some way of avoiding these situations in which the user stops having icons until he does a sudo apt autoremove (or equivalent in other distros). The optimal approach would be to pair the icons the user specifies to particular entries, such that when the number of entries varies Matter can recognize which entries had which icons.

For now, however, it would be enough to add a flag to the script called --relax-icons/-ri which when set, will relax the --icons/-i inputs to:

  • If the user provides less icons than entries, the remaining ones are considered "_" (underscores)
  • If the user provides more icons than entries, the extra icons are ignored.
    And then just add this flag to the hook command in grub-mkconfig.

This will at least show some icons on these situations, but most likely some of them will be in the wrong places.

Matter hook disabled on grub upgrade

Matter adds to the end of the /usr/sbin/grub-mkconfig script a call to itself so whenever the grub is updated (on a new kernel installation for example) matter can overwrite grub.cfg to put the icon classes in place.

However when the grub itself is upgraded, grub-mkconfig is overwritten effectively removing the Matter hook at the end, and you as an user need to "install" Matter again for keeping the correct icons.

One solution that comes to mind would be to place the hook on the package manager instead. With apt something like this would be needed. A problem with this approach is how to gracefully handle other package managers.

Hopefully there are other alternatives that you can come with. Any ideas are welcomed.

Improve READMEs of each folder

Matter folder structure is more or less preserved on install even though some folders don't have more than a README file. The idea behind this is that a curious user or potential contributors can read right from the repo what each folder is supposed to contain and get an idea of how Matter works in the process.

If you've been reading the project and think you can improve the description of some area that you found particularly weird, go ahead and submit a PR, hopefully it will make it easier for future readers.

KeyError: 'width' line 54, in inkscape_convert_svg2png

Hi,
I am facing an error like this:

Traceback (most recent call last):
  File "./matter.py", line 876, in <module>
    do_install()
  File "./matter.py", line 543, in do_install
    prepare_source_dir()
  File "./matter.py", line 386, in prepare_source_dir
    convert_icon_svg2png(icon)
  File "./matter.py", line 248, in convert_icon_svg2png
    exit_code = converter(color, src_path, dst_path, whisper=whisper)
  File "/home/jaza/Documents/Hacking/matter/svg2png.py", line 54, in inkscape_convert_svg2png
    int_ignore_units(root.attrib["width"]),
KeyError: 'width'

And here is the command I run:
sudo ./matter.py -i ubuntu folder _ _ _ _ _ _ microsoft-windows
I am just trying to change my GRUB theme using matter and I think all the dependency have been installed properly.

Thank you for your advice and solutions!

Improve Fedora Support

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'

[optimization] Layout division

I would suggest optimizing the layout with grids. This would fix all problems with different resolutions, and shows you where all elements should be placed (atm there are all over the place)

grub

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.