mateosss / matter

Customizable GRUB theme inspired by Material Design
Boost Software License 1.0
873 stars 51 forks source link

Convert error on Arch derivatives #48

Open atidyshirt opened 4 years ago

atidyshirt commented 4 years ago

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

mateosss commented 4 years ago

From what I see Garuda is based on Arch, so if it is using grub, it should work just fine. Let's try to debug this:

  1. Just to be sure, remember that once you download and install Matter, you should keep the "installer" folder right there, so place it in some safe directory that you will not delete by accident before installing.

  2. Second, can you upload the contents of these three files?

    • /boot/grub/grub.cfg
    • /etc/default/grub
    • /usr/sbin/grub-mkconfig

Also can you elaborate on the "incredibly laggy" part of the title? where in particular? and how is it slow, it has a delay before each key press, or is it something else?

atidyshirt commented 4 years ago

Also can you elaborate on the "incredibly laggy" part of the title? where in particular? and how is it slow, it has a delay before each key press, or is it something else?

By laggy I mean that it takes a good 500 - 1000ms for key press to register when moving up or down the list of boot options, (so I guess yeah key delay).

Just to be sure, remember that once you download and install Matter, you should keep the "installer" folder right there, so place it in some safe directory that you will not delete by accident before installing.

I re-installed just to make sure I didn't accidentally delete anything, problem still persists.Garuda does use grub. It does come pre-installed with its own theme if this matters.

Files:

/boot/grub/grub.cfg

is empty? not sure what this file is suppost to hold but could be the issue

/etc/default/grub

# GRUB boot loader configuration

GRUB_DEFAULT="0"
GRUB_TIMEOUT="5"
GRUB_DISTRIBUTOR="Garuda"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=a2a899f3-8319-4c79-8858-b43dfefb83e5 loglevel=3"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK="y"

# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE="menu"

# Uncomment to use basic console
GRUB_TERMINAL_INPUT="console"

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT="console"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE="auto"

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX="keep"

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID="true"

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT="true"

### BEGIN Matter Theme Overrides
GRUB_THEME=/boot/grub/themes/Matter/theme.txt
GRUB_GFXMODE=1920x1080,auto

# Fedora specific fixes
GRUB_ENABLE_BLSCFG=false
GRUB_TERMINAL_OUTPUT=""

### END Matter Theme Overrides

/usr/sbin/grub-mkconfig

#! /bin/sh
set -e

# Generate grub.cfg by inspecting /boot contents.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.

prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"

prefix="/usr"
exec_prefix="/usr"
sbindir="/usr/bin"
bindir="/usr/bin"
sysconfdir="/etc"
PACKAGE_NAME=GRUB
PACKAGE_VERSION=2.04
host_os=linux-gnu
datadir="${datarootdir}"
if [ "x$pkgdatadir" = x ]; then
    pkgdatadir="${datadir}/grub"
fi
# export it for scripts
export pkgdatadir

grub_cfg=""
grub_mkconfig_dir="${sysconfdir}"/grub.d

self=`basename $0`

grub_probe="${sbindir}/grub-probe"
grub_file="${bindir}/grub-file"
grub_editenv="${bindir}/grub-editenv"
grub_script_check="${bindir}/grub-script-check"

export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"

. "${pkgdatadir}/grub-mkconfig_lib"

# Usage: usage
# Print the usage.
usage () {
    gettext_printf "Usage: %s [OPTION]\n" "$self"
    gettext "Generate a grub config file"; echo
    echo
    print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")"
    print_option_help "-h, --help" "$(gettext "print this message and exit")"
    print_option_help "-v, --version" "$(gettext "print the version information and exit")"
    echo
    gettext "Report bugs to <bug-grub@gnu.org>."; echo
}

argument () {
  opt=$1
  shift

  if test $# -eq 0; then
      gettext_printf "%s: option requires an argument -- \`%s'\n" "$self" "$opt" 1>&2
      exit 1
  fi
  echo $1
}

# Check the arguments.
while test $# -gt 0
do
    option=$1
    shift

    case "$option" in
    -h | --help)
    usage
    exit 0 ;;
    -V | --version)
    echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
    exit 0 ;;
    -o | --output)
    grub_cfg=`argument $option "$@"`; shift;;
    --output=*)
    grub_cfg=`echo "$option" | sed 's/--output=//'`
    ;;
    -*)
    gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
    usage
    exit 1
    ;;
    # Explicitly ignore non-option arguments, for compatibility.
    esac
done

if [ "x$EUID" = "x" ] ; then
  EUID=`id -u`
fi

if [ "$EUID" != 0 ] ; then
  root=f
  case "`uname 2>/dev/null`" in
    CYGWIN*)
      # Cygwin: Assume root if member of admin group
      for g in `id -G 2>/dev/null` ; do
    case $g in
      0|544) root=t ;;
    esac
      done ;;
  esac
  if [ $root != t ] ; then
    gettext_printf "%s: You must run this as root\n" "$self" >&2
    exit 1
  fi
fi

set $grub_probe dummy
if test -f "$1"; then
    :
else
    gettext_printf "%s: Not found.\n" "$1" 1>&2
    exit 1
fi

# Device containing our userland.  Typically used for root= parameter.
GRUB_DEVICE="`${grub_probe} --target=device /`"
GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true

# Device containing our /boot partition.  Usually the same as GRUB_DEVICE.
GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`"
GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true

# Filesystem for the device containing our userland.  Used for stuff like
# choosing Hurd filesystem module.
GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`"

if [ x"$GRUB_FS" = xunknown ]; then
    GRUB_FS="$(stat -f -c %T / || echo unknown)"
fi

# Provide a default set of stock linux early initrd images.
# Define here so the list can be modified in the sourced config file.
if [ "x${GRUB_EARLY_INITRD_LINUX_STOCK}" = "x" ]; then
    GRUB_EARLY_INITRD_LINUX_STOCK="intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode.cpio"
fi

if test -f ${sysconfdir}/default/grub ; then
  . ${sysconfdir}/default/grub
fi

# XXX: should this be deprecated at some point?
if [ "x${GRUB_TERMINAL}" != "x" ] ; then
  GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}"
  GRUB_TERMINAL_OUTPUT="${GRUB_TERMINAL}"
fi

termoutdefault=0
if [ "x${GRUB_TERMINAL_OUTPUT}" = "x" ]; then
    GRUB_TERMINAL_OUTPUT=gfxterm;
    termoutdefault=1;
fi

for x in ${GRUB_TERMINAL_OUTPUT}; do
    case "x${x}" in
    xgfxterm) ;;
    xconsole | xserial | xofconsole | xvga_text)
            # make sure all our children behave in conformance with ascii..
        export LANG=C;;
    *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;;
    esac
done

GRUB_ACTUAL_DEFAULT="$GRUB_DEFAULT"

if [ "x${GRUB_ACTUAL_DEFAULT}" = "xsaved" ] ; then GRUB_ACTUAL_DEFAULT="`"${grub_editenv}" - list | sed -n '/^saved_entry=/ s,^saved_entry=,,p'`" ; fi

# These are defined in this script, export them here so that user can
# override them.
export GRUB_DEVICE \
  GRUB_DEVICE_UUID \
  GRUB_DEVICE_PARTUUID \
  GRUB_DEVICE_BOOT \
  GRUB_DEVICE_BOOT_UUID \
  GRUB_FS \
  GRUB_FONT \
  GRUB_PRELOAD_MODULES \
  GRUB_ACTUAL_DEFAULT

# These are optional, user-defined variables.
export GRUB_DEFAULT \
  GRUB_HIDDEN_TIMEOUT \
  GRUB_HIDDEN_TIMEOUT_QUIET \
  GRUB_TIMEOUT \
  GRUB_TIMEOUT_STYLE \
  GRUB_DEFAULT_BUTTON \
  GRUB_HIDDEN_TIMEOUT_BUTTON \
  GRUB_TIMEOUT_BUTTON \
  GRUB_TIMEOUT_STYLE_BUTTON \
  GRUB_BUTTON_CMOS_ADDRESS \
  GRUB_BUTTON_CMOS_CLEAN \
  GRUB_DISTRIBUTOR \
  GRUB_CMDLINE_LINUX \
  GRUB_CMDLINE_LINUX_DEFAULT \
  GRUB_CMDLINE_XEN \
  GRUB_CMDLINE_XEN_DEFAULT \
  GRUB_CMDLINE_LINUX_XEN_REPLACE \
  GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT \
  GRUB_CMDLINE_NETBSD \
  GRUB_CMDLINE_NETBSD_DEFAULT \
  GRUB_CMDLINE_GNUMACH \
  GRUB_EARLY_INITRD_LINUX_CUSTOM \
  GRUB_EARLY_INITRD_LINUX_STOCK \
  GRUB_TERMINAL_INPUT \
  GRUB_TERMINAL_OUTPUT \
  GRUB_SERIAL_COMMAND \
  GRUB_DISABLE_LINUX_UUID \
  GRUB_DISABLE_LINUX_PARTUUID \
  GRUB_DISABLE_RECOVERY \
  GRUB_VIDEO_BACKEND \
  GRUB_GFXMODE \
  GRUB_BACKGROUND \
  GRUB_THEME \
  GRUB_GFXPAYLOAD_LINUX \
  GRUB_DISABLE_OS_PROBER \
  GRUB_COLOR_NORMAL \
  GRUB_COLOR_HIGHLIGHT \
  GRUB_INIT_TUNE \
  GRUB_SAVEDEFAULT \
  GRUB_ENABLE_CRYPTODISK \
  GRUB_BADRAM \
  GRUB_OS_PROBER_SKIP_LIST \
  GRUB_DISABLE_SUBMENU

if test "x${grub_cfg}" != "x"; then
  rm -f "${grub_cfg}.new"
  oldumask=$(umask); umask 077
  exec > "${grub_cfg}.new"
  umask $oldumask
fi
gettext "Generating grub configuration file ..." >&2
echo >&2

cat << EOF
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by $self using templates
# from ${grub_mkconfig_dir} and settings from ${sysconfdir}/default/grub
#
EOF

for i in "${grub_mkconfig_dir}"/* ; do
  case "$i" in
    # emacsen backup files. FIXME: support other editors
    *~) ;;
    # emacsen autosave files. FIXME: support other editors
    */\#*\#) ;;
    *)
      if grub_file_is_not_garbage "$i" && test -x "$i" ; then
        echo
        echo "### BEGIN $i ###"
        "$i"
        echo "### END $i ###"
      fi
    ;;
  esac
done

if test "x${grub_cfg}" != "x" ; then
  if ! ${grub_script_check} ${grub_cfg}.new; then
    # TRANSLATORS: %s is replaced by filename
    gettext_printf "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
%s file attached." "${grub_cfg}.new" >&2
    echo >&2
    exit 1
  else
    # none of the children aborted with error, install the new grub.cfg
    mv -f ${grub_cfg}.new ${grub_cfg}
  fi
fi

gettext "done" >&2
echo >&2

### BEGIN Matter Theme Overrides
/home/atidyshirt/Programs/matter/matter.py -so -i arch microsoft-windows folder arch arch >&2
### END Matter Theme Overrides

I apologize, probably should have just attatched the files, o well ;)

mateosss commented 4 years ago

The empty grub.cfg is indeed not normal. Can you post Matter's output when you install as well?

atidyshirt commented 4 years ago

Running program

[sudo] password for atidyshirt:
[I] [MATTER GRUB THEME]
[I] Argument -i required. Which icons go to which grub entries?.
[I] Your grub entries are:
1. Garuda Linux
2. Windows
3. Advanced options
4. Garuda Linux, with Linux linux-zen
5. Garuda Linux, with Linux linux-zen (fallback initramfs)
[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

Do you want me to run with any flags?

I am seeing some warnings actually

atidyshirt commented 4 years ago
[I] Begin Matter install
[I] Build theme from user preferences
[I] Download arch.svg
[I] Download microsoft-windows.svg
[I] Download folder.svg
[I] Convert icons
convert: geometry does not contain image `/home/atidyshirt/Programs/matter/icons/arch.svg' @ warning/attribute.c/GetImageBoundingBox/510.
convert: geometry does not contain image `/home/atidyshirt/Programs/matter/icons/microsoft-windows.svg' @ warning/attribute.c/GetImageBoundingBox/510.
convert: geometry does not contain image `/home/atidyshirt/Programs/matter/icons/folder.svg' @ warning/attribute.c/GetImageBoundingBox/510.
convert: geometry does not contain image `/home/atidyshirt/Programs/matter/icons/arch.svg' @ warning/attribute.c/GetImageBoundingBox/510.
convert: geometry does not contain image `/home/atidyshirt/Programs/matter/icons/arch.svg' @ warning/attribute.c/GetImageBoundingBox/510.
[I] Build font

[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/grub/grub.cfg patch
[I] 5 icons succesfully patched onto /boot/grub/grub.cfg
[I] Begin /usr/bin/grub-mkconfig patch
[I] Clean old /usr/bin/grub-mkconfig patch if any
[I] /usr/bin/grub-mkconfig succesfully patched, icons will now persist between grub updates.
[I] Update grub.cfg
[I] Remake grub.cfg with /usr/bin/update-grub -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found theme: /boot/grub/themes/Matter/theme.txt
Found linux image: /boot/vmlinuz-linux-zen
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img
Found fallback initrd image(s) in /boot: initramfs-linux-zen-fallback.img
Found Windows 10 on /dev/sdc1
Found linux image: /boot/vmlinuz-linux-zen
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img
Found fallback initrd image(s) in /boot: initramfs-linux-zen-fallback.img
done
[I] Begin /boot/grub/grub.cfg patch
[I] 5 icons succesfully patched onto /boot/grub/grub.cfg
[I] Matter succesfully installed
mateosss commented 4 years ago

Oh I think this is the problem: convert: geometry does not contain image '/home/atidyshirt/Programs/matter/icons/arch.svg' @ warning/attribute.c/GetImageBoundingBox/510.

The convert command from ImageMagick is not generating the icons, it should have stopped and not continue the installation nonetheless. I've seen this problem before some days ago in an Arch installation.

Okay, now can you give me the output of these commands?

convert --version
convert -list format | grep SVG
atidyshirt commented 4 years ago
╭─atidyshirt@atidyshirt ~
╰─$ convert --version
Version: ImageMagick 7.0.10-31 Q16 x86_64 2020-09-27 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(4.5)
Delegates (built-in): bzlib cairo djvu fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png raqm raw rsvg tiff webp wmf x xml zlib
╭─atidyshirt@atidyshirt ~
╰─$ convert -list format | grep SVG
     MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
      SVG  SVG       rw+   Scalable Vector Graphics (RSVG 2.50.0)
     SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (RSVG 2.50.0)
mateosss commented 4 years ago

Thanks a lot! I will be digging deeper on these problems that keep popping with ImageMagick and let you know of any update. For now you can completely uninstall matter with ./matter.py -u if it is causing you slowdowns.

laubblaeser commented 4 years ago

I have the same problem on Manjaro. Here's my output for the two commands above:

[laubblaeser@ferdux matter]$ convert --version
Version: ImageMagick 7.0.10-30 Q16 x86_64 2020-09-20 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(4.5) 
Delegates (built-in): bzlib cairo djvu fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png raqm raw rsvg tiff webp wmf x xml zlib
[laubblaeser@ferdux matter]$ convert -list format | grep SVG
     MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
      SVG  SVG       rw+   Scalable Vector Graphics (RSVG 2.48.8)
     SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (RSVG 2.48.8)

If I can be of any assistance in solving this mystery, please feel free to get in touch.

Gariomat commented 4 years ago

I just had the same problem on Arch. changing the convert command in matter.py to

command = (
        rf"convert -trim -scale 36x36 -extent 72x72 -gravity center {src_path} -separate -delete 1-3 -negate \( -size 72x72 xc:{color} -duplicate 2 \) -swap 0,3 -combine -define png:color-type=6 -colorspace sRGB -channel RGB {dst_path}"
    )

solved it for me. Here's my ImageMagick version:

$ convert --version
Version: ImageMagick 7.0.10-37 Q16 x86_64 2020-11-07 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(4.5) 
Delegates (built-in): bzlib cairo djvu fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png raqm raw rsvg tiff webp wmf x xml zlib
$ convert -list format | grep SVG
     MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
      SVG  SVG       rw+   Scalable Vector Graphics (RSVG 2.50.1)
     SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (RSVG 2.50.1)