Giter VIP home page Giter VIP logo

matter's Introduction

Matter

Minimalist grub theme originally inspired by material design 2.

Matter Gif

Feel free to open issues for any problem or request you have and/or submit pull requests.

Index

Download

Click here to download Matter

It is strongly advised to put the downloaded files in some folder that will not get deleted, as the main script matter.py is needed for future grub updates made by your system. Also if you want to uninstall matter you could do it from there as well.

Dependencies

Matter will inform you of any missing dependencies, but here is a list anyways:

  • inkscape (Main dependency): This brings the convert command from imagemagick with best svg to png conversion.
  • grub-mkconfig and grub-mkfont: General grub utilities needed. If you don't have these, please create an issue with more information about your system as I've only worked with ones that have these commands.
  • PIL (Optional): For image conversions with the --downloadbackground/-dlbg option. Can be installed with either of: pip install Pillow, sudo apt install python3-pil (Ubuntu), pacman -S python-pillow (Arch).
  • grub2-theme-preview (Optional): For testing results (--test/-t argument) without rebooting.

Usage

Help

You always can see the command reference with ./matter.py -h, next up are some sections that may be useful, or may not be very well documented in the command's help.

Quick Start

Note for Fedora users (click to show)

Matter does not yet support The Boot Loader Specification so before executing matter.py you should set GRUB_ENABLE_BLSCFG="false" in /etc/default/grub and then update your grub file with sudo grub2-mkconfig -o /boot/grub2/grub.cfg

See this issue for updates or if you want to help out with fedora support

Note for users with screen resolution other than 1920x1080 (click to show)

Matter layout might break in other resolutions with the default installation, you might need to tweak the grub.template GRUB_GFXMODE property and theme.txt.template percentages

See this issue for more information.

Following is a Matter installation with default values. Don't worry, it is very easy to rollback or overwrite this installation later if you want to.

The script that does all the work is matter.py, so let's start by running it

./matter.py

It outputs almost everything you need to know for later, but for now let's focus on the list it shows, those are your grub entries. It should look similar to this one:

1. Ubuntu
2. Windows
3. More Options
4. Ubuntu, with Linux 5.3.0-61-generic
5. Ubuntu, with Linux 5.3.0-61-generic (recovery mode)
6. Ubuntu, with Linux 5.3.0-59-generic
7. Ubuntu, with Linux 5.3.0-59-generic (recovery mode)
8. System Setup

Now you should pick some icons from https://materialdesignicons.com for each entry listed (you only need the icon's name, use the search panel and hover over any icon you like to see its name). For this example I will pick ubuntu for entry 1, microsoft-windows for 2, folder for 3 (as it is a submenu in my particular case), and cog for 8. I don't care about all the remaining entries so I will just use "_" (underscore) for those.

# Installs matter with icons matching the corresponding entries
./matter.py -i ubuntu microsoft-windows folder _ _ _ _ cog

And thats it! If you reboot now, you should get something like this:

Quick Start Result

Tip: If you need to tidy up your grub entries hierarchy and names I recommend using grub-customizer (tutorial).

Uninstall

You can completely remove Matter from your system with ./matter.py -u

Fonts

Matter uses .ttf fonts and only one, the default, comes prepackaged. You can specify your own fonts by giving a .ttf file, the font name, and an optional font size like so:

./matter.py -ff ~/fonts/Cinzel/Cinzel-Regular.ttf -fn Cinzel Regular -fs 40
  • --fontfile/-ff: The .ttf path
  • --fontname/-fn: The name of the font, in this case Cinzel Regular but could be Open Sans Bold (Tip: If you don't know the font name, you can specify any name, go to the grub, press C to open console, and type lsfonts to list the font names)
  • --fontsize/-fs: By default it is 32, recommended values are multiples of 4.
  • --font/-f: This argument is not used in this example as it is used to select prepackaged fonts. Note that after giving a ttf file to -ff, matter will save it as a prepackaged font, so it could be referenced later on with this flag. See prepackaged (available) fonts at the end of --help/-h output

Tip: Google Fonts is a good place to get fonts

Colors

You can specify the color of 4 elements: --foreground/-fg, --background/-bg, --iconcolor/-ic and --highlight/-hl (selected text color), there are some Material Design colors prepackaged that you can see at the end of the --help/-h output, you can also specify custom colors. Here is an example of the syntax:

./matter.py -hl FFC107 -fg white -bg 2196f3 -ic pink

Images (unfinished)

You can specify a background image with --image/-im, the supported image formats/extensions are PNG, JPG, JPEG, and TGA. This feature is considered unfinished because it does not yet work as well as it could (see #58)

Here is an example of the syntax:

./matter.py -im ~/Pictures/some-cool-image-that-has-good-contrast-with-my-text-color.png

You can also specify an URL with --downloadbackground/-dlbg to automatically download an image from the internet. The image will be converted to png so it doesn't need to be a grub-compatible 8-bit jpg. It should be in the jpg or png format though. This feature is also considered unfinished.

./matter.py -dlbg "https://source.unsplash.com/1920x1080/?nature"

Testing Without Rebooting

If you install the pip package grub2-theme-preview you can test combinations of fonts and colors with the --buildonly/-b and --test/-t flags like so:

./matter.py -t -b -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl FFC107 -fg white -bg 2196F3 \
-ff ~/fonts/MuseoModerno/static/MuseoModerno-Regular.ttf \
-fn MuseoModerno Regular -fs 40

Note: it will use your system's grub.cfg, so set your icons beforehand.

What does Matter do to my system files?

Besides the need for the extracted files to be in a persistent location, Matter needs to edit three files:

  1. /etc/default/grub: For setting theme and resolution.
  2. /boot/grub/grub.cfg: For setting icons.
  3. /usr/sbin/grub-mkconfig: For making icons persistent across grub updates.
  4. /etc/grub.d/99_matter: For making icons persistent across grub upgrades.

Also it places the theme files in /boot/grub/themes/Matter/, this one is standard to grub themes in general.

Both (1) and (3) are clearly distinguished with special BEGIN/END comments at the end of each file. (2) Adds a --class flag to each entry, but it can be restored as new with update-grub. And (4) is a custom file.

All of these modifications are completely cleaned up by uninstalling

Gallery

Here are some examples with their respective commands that you can copy or get inspired from.

Example 1

Example 1

Font: Josefin Sans Regular 400

# Light version, invert -fg and -bg for dark one
./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl ef233c -fg 2b2d42 -bg edf2f4 \
-ff ~/fonts/Josefin_Sans/static/JosefinSans-Regular.ttf \
-fn Josefin Sans Regular -fs 32

Example 2

Example 2

Font: Comfortaa Medium 500

./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl white -fg f0f0f0 -bg ff0d7b \
-ff ~/fonts/Comfortaa/static/Comfortaa-Medium.ttf \
-fn Comfortaa Regular -fs 32

Example 3

Example 3

Font: Lobster Regular 400

./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl 118ab2 -fg ffd166 -bg 073b4c \
-ff ~/fonts/Lobster/Lobster-Regular.ttf \
-fn Lobster Regular -fs 32

Example 4

Example 4

Fonts: Bebas Neue Regular 400 and Russo One Regular 400

# Using Bebas Neue font (more compact), the other uses Russo One
./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl 2c251b -fg 2c251b -bg ffe70b \
-ff ~/fonts/Bebas_Neue/BebasNeue-Regular.ttf \
-fn Bebas Neue Regular -fs 36
# -ff ~/fonts/Russo_One/RussoOne-Regular.ttf \
# -fn Russo One Regular -fs 36

Example 5

Example 5

Font: Poiret One Regular 400

./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl black -fg 101010 -bg fce1e0 \
-ff ~/fonts/Poiret_One/PoiretOne-Regular.ttf \
-fn Poiret One Regular -fs 48

Example 6

Example 6

Font: Josefin Sans Medium 500

./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl ffe78a -fg fdf7f9 -bg 582335 \
-ff ~/fonts/Josefin_Sans/static/JosefinSans-Medium.ttf \
-fn Josefin Sans Regular -fs 32

Example 7

Example 7

Font: Josefin Slab Bold 700

./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl A4E11E -fg white -bg 5b1ee1 \
-ff ~/fonts/Josefin_Slab/JosefinSlab-Bold.ttf \
-fn Josefin Slab Bold -fs 36

Example 8

Example 8

Font: MuseoModerno Regular 400

./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl FFC107 -fg white -bg 2196F3 \
-ff ~/fonts/MuseoModerno/static/MuseoModerno-Regular.ttf \
-fn MuseoModerno Regular -fs 32

Example 9

Example 9

Font: Amatic SC Regular 400

./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-bg FFF8E1 -fg 263238 -hl E91E63 \
-ff ~/fonts/Amatic_SC/AmaticSC-Regular.ttf \
-fn Amatic SC Regular -fs 64

Example 10

Example 10

Font: Cinzel Regular 400

# This is the light version, the dark one uses -bg 1a1d21 -fg c9a45b instead
./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-hl c28f2c -bg white -fg d0a85c \
-ff ~/fonts/Cinzel/Cinzel-Regular.ttf \
-fn Cinzel Regular -fs 40
# -hl c28f2c -bg 1a1d21 -fg c9a45b \

Example 11

Example 11

./matter.py -i ubuntu microsoft-windows folder _ _ _ _ _ _ cog \
-im ~/images/material-background.png

Contributing

Feel free to submit any pull request that improves in any way the project.

Read the wiki https://github.com/mateosss/matter/wiki, that's where any useful information for developers will reside.

If you think you got a nice result out of Matter and would like to share it, please create an issue with it! I would love to see your results.

Thanks

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

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.

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.

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

Fails on Fedora SilverBlue / Project BlueFin / Immutable

Tried running ./matter.py on Project BlueFin but it fails as /usr/sbin is read-only

[I] Prepare installation directory
[I] Clean install directory
[I] Copy built theme to installation directory
[I] Patch /etc/default/grub with Matter Theme Overrides
[I] Begin /boot/grub2/grub.cfg patch
[I] 11 icons successfully patched onto /boot/grub2/grub.cfg
[I] Begin /usr/sbin/grub2-mkconfig patch
[I] Clean old /usr/sbin/grub2-mkconfig patch if any
Traceback (most recent call last):
  File "/var/home/**USER**/matter/./matter.py", line 876, in <module>
    do_install()
  File "/var/home/**USER**/matter/./matter.py", line 548, in do_install
    do_set_icons(patch_grubcfg=True)
  File "/var/home/**USER**/matter/./matter.py", line 693, in do_set_icons
    with open(GRUB_MKCONFIG_PATH, "w") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 30] Read-only file system: '/usr/sbin/grub2-mkconfig'

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 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

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

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.

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.

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!

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.

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 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.

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.

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.

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?

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.

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.

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.

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

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

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?

Just comes up with more complex grub???

i managed to hit enter before i could say the issue sorry, this is all very new to me, but after i set everything up through terminal and did a reboot, all that came up was a text based grub where you had to type commands? is this normal? im not sure if ive done something spectacularly wrong or if its just a simple fix but its annoying i would appreciate help :'))

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!

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.

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"
}

Broken Download

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

image

Installation Issue

I'm attempting to install matter as per the instructions in the readme file, but I keep getting an error.

ezra@ezras-linux:~/Documents/Grub themes/matter$ ./matter.py -i ubuntu folder _ _ _ _ microsoft-windows
[I] Begin Matter install
[I] Build theme from user preferences
[I] Convert icons
Inkscape 1.1.2 (0a00cf5339, 2022-02-04)

ConcreteInkscapeApplication<Gtk::Application>::on_open: Can't use '--export-filename' with multiple input files (output file would be overwritten for each input file). Please use '--export-type' instead and rename manually.
ConcreteInkscapeApplication<Gtk::Application>::on_open: Can't use '--export-filename' with multiple input files (output file would be overwritten for each input file). Please use '--export-type' instead and rename manually.
ConcreteInkscapeApplication<Gtk::Application>::on_open: Can't use '--export-filename' with multiple input files (output file would be overwritten for each input file). Please use '--export-type' instead and rename manually.
[I] Build font
can't open file themes/matter/Matter/font.pf2, index 0: error 1: cannot open resource
can't open file /home/ezra/Documents/Grub, index 0: error 2: unknown file format
can't open file themes/matter/fonts/Josefin_Sans_Regular.ttf, index 0: error 1: cannot open resource

[E] /usr/bin/grub-mkfont execution was not clean
[E] for fontfile: /home/ezra/Documents/Grub themes/matter/fonts/Josefin_Sans_Regular.ttf

Am I doing something wrong? I apologize if it's a stupid error, I'm a linux noob.

Am I supposed to be running the matter.py from the directory it is in (as shown above)? Also, am I supposed to leave the theme.txt.template as is or should it be theme.txt? Looking at other examples of installing grub themes online indicates that it should be theme.txt.

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.

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!

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: 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.

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.