GithubHelp home page GithubHelp logo

lxtharia / minegrub-theme Goto Github PK

View Code? Open in Web Editor NEW
3.1K 15.0 34.0 60.84 MB

A Grub Theme in the style of Minecraft!

License: MIT License

Python 51.03% Nix 33.19% Shell 15.78%
grub2 grub2-theme grub2-themes grub-theme grub-themes minecraft

minegrub-theme's Introduction

Minegrub

A Grub Theme in the style of Minecraft!

Minegrub Preview "Screenshot"

Installation

Note: grub vs grub2

  • If you have a /boot/grub2 folder instead of a /boot/grub folder , you need to adjust the file paths mentioned here and in the minegrub-update.service file
  • Also if you're not sure, run grub-mkconfig -V to check if you have grub version 2 (you should have)

Manually

  • Clone this repository
git clone https://github.com/Lxtharia/minegrub-theme.git
  • (optional) Choose a background
./choose-background.sh  # or just copy a custom image to minegrub/background.png
  • If you want to use the update script, copy an arbitrary number of images you would like to use to minegrub/backgrounds/. You can find some options in background_options/ but you can also use your own images.

  • If you do not want to use the update script or if you always want to use the same background, you can use ./choose-background.sh or just copy a custom image to minegrub/background.png

  • Copy the folder to your boot partition: (for info: -ruv = recursive, update, verbose)

cd ./minegrub-theme
sudo cp -ruv ./minegrub /boot/grub/themes/
  • Change/add this line in your /etc/default/grub:
GRUB_THEME=/boot/grub/themes/minegrub/theme.txt
  • Update your live grub config by running
sudo grub-mkconfig -o /boot/grub/grub.cfg
  • You're good to go!

NixOS module (flake)

This is a minimal example
# flake.nix
{
  inputs.minegrub-theme.url = "github:Lxtharia/minegrub-theme";
  # ...

  outputs = {nixpkgs, ...} @ inputs: {
    nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem {
      modules = [
        ./configuration.nix
        inputs.minegrub.nixosModules.default
      ];
    };
  }
}

# configuration.nix
{ pkgs, ... }: {

  boot.loader.grub = {
    minegrub-theme = {
      enable = true;
      splash = "100% Flakes!";
      boot-options-count = 4;
    };
    # ...
  };
}

Configuration

Adjusting for a different amount of boot options:

  • When you have more/less than 4 boot options, you might want to adjust the height of the bottom bar (that says "Options" and "Console")
  • The formula and some precalculated values (for 2,3,4,5... boot options) are in the theme.txt, so you should be able to easily change it to the correct value.

Random splash texts and accurate "x Packages Installed" text!

The update_theme.py script chooses a random line from assets/splashes.txt and generates and replaces the logo.png which holds the splash text, as well as updates the amount of packages currently installed. It also randomly chooses a file from backgrounds/ (ignoring hidden files beginning with a dot) as the background image.

  • Make sure neofetch is installed
  • Make sure Python 3 (or an equivalent) and the Pillow python package are installed
    • Install Pillow either with the python-pillow package from the AUR or with sudo -H pip3 install pillow
    • It's important to use sudo -H, because it needs to be available for the root user
  • To add new splash texts simply edit ./minegrub/assets/splashes.txt and add them to the file.
  • Put all backgrounds you want to randomly choose from in ./minegrub/backgrounds/. Hidden files (i.e. filenames beginning with a dot) will be ignored. You can also add your own images.
  • If you want to get a specific splash and/or background for the next boot, run python update_theme.py [BACKGROUND_FILE [SPLASH]], e.g. python update_theme.py 'backgrounds/1.15 - [Buzzy Bees].png' 'Splashing!'
    • Empty string parameters will be replaced by a random choice, e.g. python update_theme.py '' 'Splashing!' for a random background and the splash Splashing!.

Update splash and "Packages Installed"...

...manually

  • Just run python /boot/grub/themes/minegrub/update_theme.py (from anywhere) after boot using whatever method works for you

...with init-d (SysVinit)

  • Just copy the ./minegrub-SysVinit.sh under /etc/init.d as minecraft-grub then run update-rc.d minecraft-grub defaults as root privileges:
sudo cp -v "./minegrub-SysVinit.sh" "/etc/init.d/minecraft-grub"
sudo chmod u+x "/etc/init.d/minecraft-grub" # Just to be sure the permissions are set correctly.
sudo update-rc.d minecraft-grub defaults

...with systemd

  • Edit ./minegrub-update.service to use /boot/grub2/ on line 5 if applicable
  • Copy ./minegrub-update.service to /etc/systemd/system
  • Enable the service: systemctl enable minegrub-update.service
  • If it's not updating after rebooting (it won't update on the first reboot because it updates after you boot into your system), check systemctl status minegrub-update.service for any errors (for example if pillow isn't installed in the correct scope)

Notes:

  • the GRUB_TIMEOUT_STYLE in the defaults/grub file should be set to menu, so it immediately shows the menu (else you would need to press ESC and you dont want that)
  • I'm no Linux expert, that's why I explain it so thoroughly, for other newbies :>
  • i use arch btw
  • i hope u like it, cause i sure do lmao

Thanks to

Font downloaded from https://www.fontspace.com/minecraft-font-f28180 and used for non commercial use.

minegrub-theme's People

Contributors

duhby avatar hughnew avatar jacksaur avatar lazypwny751 avatar lxtharia avatar megz15 avatar nicholasz2510 avatar nktfh100 avatar ocfox avatar samsu-f avatar sebbl0508 avatar silaspeters 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  avatar  avatar  avatar  avatar  avatar  avatar

minegrub-theme's Issues

grub theme is not applying

i am using Debian 12 and the grub keeps taking the default background up when updating and is not changing

grub file -


# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=menu
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# If your computer has multiple operating systems installed, then you
# probably want to run os-prober. However, if your computer is a host
# for guest OSes installed via LVM or raw disk devices, running
# os-prober can cause damage to those guest OSes as it mounts
# filesystems to look for things.
GRUB_DISABLE_OS_PROBER=false
GRUB_THEME=/boot/grub/themes/minegrub/theme.txt

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal
#GRUB_TERMINAL=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=1920x1080x30,auto

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

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

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

terminal output on updating it


Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-6.1.0-18-amd64
Found initrd image: /boot/initrd.img-6.1.0-18-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done

I am new to linux so i have no clue

Build problem when using it through NixOS Flake

I'm trying to use Minegrub on my NixOS, using a Flake for the whole config. Unfortunately, I get an error while building, related to minegrub:

[root@nixos:/etc/nixos]# nix log /nix/store/wr9q40ndd6wnpiw869vh9j5360g2qlb6-minegrub-theme.drv
[root@nixos:/etc/nixos]# nixos-rebuild build
building the system configuration...
error: builder for '/nix/store/wr9q40ndd6wnpiw869vh9j5360g2qlb6-minegrub-theme.drv' failed with exit code 2;
       last 5 log lines:
> unpacking sources
> unpacking source archive /nix/store/qmlsa71lfnwvlp4cph73k789z9ajg418-source
> source root is source
> patching sources
> sed: can't read update_theme.py: No such file or directory
       For full logs, run 'nix log /nix/store/wr9q40ndd6wnpiw869vh9j5360g2qlb6-minegrub-theme.drv'.
error: 1 dependencies of derivation '/nix/store/i048izr3c7ffzqs2c0789qzlahgpalgf-grub-config.xml.drv' failed to build
error: 1 dependencies of derivation '/nix/store/0h9zdylh13wbjchfwqrk82lg50klv93b-install-grub.sh.drv' failed to build
error: 1 dependencies of derivation '/nix/store/z0agq1y58lwdbmqksxzimjfmys78djb0-nixos-system-nixos-23.11.20230831.3e52e76.drv' failed to build

[root@nixos:/etc/nixos]# nix log /nix/store/wr9q40ndd6wnpiw869vh9j5360g2qlb6-minegrub-theme.drv^*
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/qmlsa71lfnwvlp4cph73k789z9ajg418-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
sed: can't read update_theme.py: No such file or directory

The issue is related to the minegrub-theme package not being built properly. It appears that the build process expects a file named update_theme.py which it can't find. Here is the github of the related project that contains a flake.nix: https://github.com/Lxtharia/minegrub-theme.

Here is my current /etc/nixos/flake.nix:

# flake.nix for /etc/nixos/
{
  description = "Custom NixOS configuration";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    minegrub-theme.url = "github:Lxtharia/minegrub-theme";
  };

  outputs = {nixpkgs, ...} @ inputs: {
    # replace whatever comes after nixosConfigurations with your hostname.
    nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        ./configuration.nix
        inputs.minegrub-theme.nixosModules.default
      ];
    };
  };
}

I'm still a noob with NixOS and Flakes, so the issue can be from the project itself or from my side. Feel free to ask for anything.

Any help appreciated.

Shadows for text

Hello, when I first saw this theme for GRUB, I was confused by the fact that the labels on the buttons look somehow wrong. I compared them with what I see in the game and realized what the problem is - the lack of shadows for the letters! It seems to me that adding shadows would have a positive effect on the visual part of this theme in the future. Perhaps you will find my attempt to add shadows to letters for this theme useful (There is a text alignment problem and in general I don’t quite like my implementation).

preview_minegrub

Update Service complaining about missing background

The update-theme.py-Script requires a folder /boot/grub/themes/minegrub/backgrounds to exist, but it does not after following instructions (even if you use the choose-background.sh-script, which is marked as optional). Pls add this folder or change the description :)

Scaling to fit wider monitors

Hey, not sure if its possible, but it would be very nice to be able to scale this to wider monitors. Personally, I just made my own background, but it was a pain b/c I couldn't find the source image for the background and had to boot up beta 1.7.3 and take my own screenshot, and even now it doesn't really look perfect.

Alternatively, you could just take the image I made and put it in with the name background_wide.png, which would probably work just as well.
Background

Rescaling

Hi!
I really like your theme, but I've got an issue. I have 6 boot menu entries on my laptop, which means that, if I use the formula you provide in the theme.txt file, the bottom bar ends up outside the screen. Is there a way to rescale everything so it fits my screen?
Good job btw (and I use Arch too btw ;) )!

Consider moving to Codeberg

Moving the whole repo and all code over to Codeberg would be great, as it is a libre, free, open-source, privacy-friendly and non-profit Git platform from Germany, running the Gittea soft-fork Forgejo.

If you need any help with the transfer I am happy to assist.

Incorrect directory in installation instructions.

The issue

The directory with the grub config file mentioned here is incorrect:

- change/add this line in your `/etc/defaults/grub`:

You might have made a spelling mistake as the directory /etc/defaults/ does not exist on the Linux filesystem by default and no applications will read from that directory. The directory that you are looking for is /etc/default/ (and with the grub config file: /etc/default/grub).


Some explaination about /etc/default

Because you said in your notes (on this line of README.md) that you are not an expert concerning Linux, here is a brief explanation of what /etc/default/ actually does:

From a post on a Slackware forum:

Basically, /etc/default contains some parameters that the end user or administrator is likely to change, rather than embedding the values in the actual boot scripts. In this way, changes will persist even if you upgrade the package and the boot script is replaced.

In Debian, /etc/default/ is a directory of mostly empty files. The way it is meant to work is that each /etc/init.d/test script first sources /etc/default/test before starting/stopping the test service. The purpose of the file is to provide extra options for starting the service, or override certain aspects of the service's startup.

Source: Ask Ubuntu: What is the purpose of /etc/default?

Hope this helps!

Improvement request for NixOS configuration.

I would be really cool if I was possible to pass a new parameter controlling the number of boot instances through the nixos config file:

minegrub-theme = {
        enable = true;
        splash = "Infinite recursion";
        boot-instance-nb = 7;
};

And maybe even another one for the button length.

Or maybe it should be done in the flake.nix ? I don't know, I'm still a 2-weeks noob with NixOS.

Thanks in advance to all.

init.d auto-update service

this awesome theme and its auto updater can be served with an init.d service, installed on demand and showing up-to-date data on every reboot.

Grub vs grub2

Hey there, so im trying to install this absolutely wonderful project but i have a folder "/boot/grub" but not "/boot/grub2", cant seem to find much about the issue, got any recurses or tips?

Incorrect Font Size

The font size for the boot entries is too small.
The issue persists if I force a resolution (either native resolution or half size). I've tried tinkering with the fonts, but I was unable to fix it myself.
PXL_20240121_153415382

Text on MINEGRUB doesn't changed, after restart

Hi that mean, that text "Im using arch btw"
after im restarting my pc
I see that assets dir have file with this random text, but its still only "im using arch btw"
Btw i didn't see smth about this file, and i how to randomise this. Help me

Small font size

All text that isn't part of an image is very small.
IMG20231201195657.jpg
Screen Resolution is 1920x1080

I have tried using grub-mkfont to make a new .pf2 font file from the minecraft regular otf, but with the --size option set to bigger (tried 60 and 240), then putting that into the theme folder and changing the various mentions of Minecraft Regular 30 to Minecraft Regular 60 (or 240 for that) in theme.txt, but that didn't produce a noticeable effect.

I am using Grub Customizer to change the names of options, but this was a problem since before I started using that.

Minecraft Font not displaying

I just discovered this awesome GRUB theme. Thank you so much!
Everything works fine expect the custom Minecraft font does not load. For all the text GRUB continues to use the base font. I could not find any working solutions so far.

I am using Fedora37 with UEFI-boot.

Error building in NixOS (file not found)

I've been trying to build the minegrub theme using the instructions on the readme (which has a typo btw, "minegrub" should be "minegrub-theme" in the flake.nix). Whenever I put the splash splash: "100% Flakes!" (or any other string), I get the following error:

[root@nixxie:/etc/nixos]# nixos-rebuild switch
building the system configuration...
error: builder for '/nix/store/y3fq5081yashw377h0mcs7cgxlxyfpy0-minegrub-theme.drv' failed with exit code 1;
       last 9 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/863c8c1dwsaspli6hrjkn31hps8wxiib-source
       > source root is source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > ERROR: The file 100% Flakes! does not exist.
       For full logs, run 'nix log /nix/store/y3fq5081yashw377h0mcs7cgxlxyfpy0-minegrub-theme.drv'.
error: 1 dependencies of derivation '/nix/store/37676acmhsvq6vlz3bpkv9rg00wbc9lp-grub-config.xml.drv' failed to build
error: 1 dependencies of derivation '/nix/store/02809bi6jgvz5il1jwhry7kz5irmks5v-install-grub.sh.drv' failed to build
error: 1 dependencies of derivation '/nix/store/aky4cpwmdd1z257xjkdbr3lcjkgcdb9a-nixos-system-nixxie-24.05.20240422.1e1dc66.drv' failed to build

Then when I try to comment out the line with the splash, the following occurs:

[root@nixxie:/etc/nixos]# nixos-rebuild switch
building the system configuration...
error: builder for '/nix/store/ncqpcwlc7ani3d207sb690sfrczv5if8-minegrub-theme.drv' failed with exit code 1;
       last 9 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/863c8c1dwsaspli6hrjkn31hps8wxiib-source
       > source root is source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > ERROR: The file deleting garbage... does not exist.
       For full logs, run 'nix log /nix/store/ncqpcwlc7ani3d207sb690sfrczv5if8-minegrub-theme.drv'.
error: 1 dependencies of derivation '/nix/store/2y97rzr329q9y6f3rwj60wnmpd09fs8f-grub-config.xml.drv' failed to build
error: 1 dependencies of derivation '/nix/store/k2s8dnh2cps5aqpg62l7s05mydbhkbfg-install-grub.sh.drv' failed to build
error: 1 dependencies of derivation '/nix/store/lxz9amb9lzh3i2mjlvqi68aw3pnyayih-nixos-system-nixxie-24.05.20240422.1e1dc66.drv' failed to build

I am not very knowledgable on NixOS, so if I'm doing anything wrong, please tell me.

"logo.png not found"

After it working just fine I get now an error message while booting

Error: can't find file "\boot\grub\themes\minegrunb-theme\logo.png"; logo.png is missing

I have the Cycler.sh activated.

Workaround with redoing grub-mkconfig works in best case only for one reboot, even when there is no grub update. Most of the time it doesn't work.

Platform is Endeavour OS (arch fork)

License Problem

I couldn't see any license in root directory. Can you add a license? I would like to package this.

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.