• Stars
    star
    286
  • Rank 144,690 (Top 3 %)
  • Language
    Python
  • Created almost 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🌇 Preview a full GRUB 2.x theme (or just a background image) using KVM / QEMU

pre-commit Run Python test suite

About

grub2-theme-preview came into life when I was looking around for available GRUB 2.x themes and wanted a way to quickly see a theme in action without rebooting real hardware.

It takes a theme folder (or just a single picture), creates a temporary bootable image using grub2-mkrescue and launches that image in a virtual machine using KVM/QEMU, all without root privileges.

grub2-theme-preview showing theme "gutsblack-archlinux"

(Showing theme gutsblack-archlinux)

Installation

To install the latest release from PyPI:

# pip install --user grub2-theme-preview

To install from a Git clone for development:

# pip install --user --editable .

Please make sure to install these non-PyPI dependencies as well:

  • grub-mkrescue of GRUB 2 (package grub-common on Debian and Ubuntu)
  • QEMUhypervisor that performs hardware virtualization
  • OVMF — EFI bios image for use with QEMU
  • mtoolscollection of utilities to access MS-DOS
  • xorriso of libisoburnfrontend which enables creation and expansion of the ISO format

Usage

# grub2-theme-preview --help
usage: grub2-theme-preview [-h] [--grub-cfg PATH] [--verbose]
                           [--resolution WxH] [--timeout SECONDS]
                           [--add TARGET=/SOURCE] [--version]
                           [--grub2-mkrescue COMMAND] [--qemu COMMAND]
                           [--xorriso COMMAND] [--no-kvm] [--debug]
                           [--plain-rescue-image]
                           PATH

positional arguments:
  PATH                  path of theme directory (or PNG/TGA image file) to
                        preview

optional arguments:
  -h, --help            show this help message and exit
  --grub-cfg PATH       path of custom grub.cfg file to use (default:
                        /boot/grub{2,}/grub.cfg)
  --verbose             increase verbosity
  --resolution WxH      set a custom resolution, e.g. 800x600
  --timeout SECONDS     set GRUB timeout in whole seconds or -1 to disable
                        (default: 30 seconds)
  --add TARGET=/SOURCE  make grub2-mkrescue add file(s) from /SOURCE to
                        /TARGET in the rescue image (can be passed multiple
                        times)
  --version             show program's version number and exit

command location arguments:
  --grub2-mkrescue COMMAND
                        grub2-mkrescue command (default: auto-detect)
  --qemu COMMAND        KVM/QEMU command (default: qemu-system-<machine>)
  --xorriso COMMAND     xorriso command (default: xorriso)

arguments related to invokation of QEMU/KVM:
  --display DISPLAY     pass "-display DISPLAY" to QEMU, see "man qemu" for
                        details (default: use QEMU's default display)
  --full-screen         pass "-full-screen" to QEMU
  --no-kvm              do not pass -enable-kvm to QEMU (and hence fall back
                        to acceleration "tcg" which is significantly slower
                        than KVM)
  --vga CARD            pass "-vga CARD" to QEMU, see "man qemu" for details
                        (default: use QEMU's default VGA card)

debugging arguments:
  --debug               enable debugging output
  --plain-rescue-image  use unprocessed GRUB rescue image with no theme
                        patched in; useful for checking if a plain GRUB rescue
                        image shows up a GRUB shell, successfully.

More Repositories

1

git-delete-merged-branches

🔥 Command-line tool to delete merged Git branches
Python
858
star
2

image-bootstrap

⛅ Creates Linux chroots and bootable virtual machine images; command line tool (Python 3)
Python
245
star
3

jawanndenn

📅 Simple alternative to Doodle polls and scheduling (Python 3, Django 5, some JavaScript)
Python
182
star
4

django-berlin

🍀 Ever wondered who's doing Django... in Berlin?
79
star
5

sandwine

🍷 Command-line tool to run Windows apps with Wine and bwrap/bubblewrap isolation on Linux
Python
66
star
6

wnpp.debian.net

🌍 Code powering website "Debian Packages that Need Lovin'" created in 2009
Python
42
star
7

resolve-march-native

🐌 Tool to determine what GCC flags -march=native would resolve into
Python
32
star
8

docker-ssl-reverse-proxy

🔒 Easy-to-use auto-SSL reverse proxy as a Docker container based on Caddy and Let’s Encrypt
Python
23
star
9

xiangqi-setup

🎲 Generate razor-sharp Xiangqi (Chinese chess) setup graphics; command line tool + themes
Python
22
star
10

binary-gentoo

🐮 Collection of simple CLI tools to help build Gentoo packages on a non-Gentoo Linux host
Python
17
star
11

django-createsuperuserwithpassword

Django management command to create usable super users, programmatically
Python
16
star
12

svneverever

🔦 Collects path entries across SVN history (Python)
Python
15
star
13

surrogates

😌 Encode and decode pairs of surrogate characters in Python 3
Python
11
star
14

django-migration-vis

to visualize django migration graphs with GraphVis
Python
11
star
15

golang-berlin

🍀 Ever wondered who's doing Golang... in Berlin?
10
star
16

antijack

🥷 seccomp-based anti-TTY-hijacking proof-of-concept (prevents TIOCSTI and TIOCLINUX)
C
10
star
17

go-wait-for-it

🦫 Wait for service(s) to be available before executing a command.
Go
9
star
18

visdriver

🎦 visdriver uses Winamp plug-ins to visualize audio; targets Wine on GNU/Linux primarily
C
8
star
19

fetchcommandwrapper

🐮 Wrapper integrating aria2 (https://aria2.github.io/) into portage's FETCHCOMMAND for faster downloads (Python)
Python
8
star
20

no-cyclic-imports

♻️ Tool to detect and report on cyclic imports in a Python codebase
Python
8
star
21

mozilla-password-decrypt

🔓 Decrypt passwords stored by Firefox, Thunderbird, Iceweasel, Icedove using libnss3.so
Python
7
star
22

update-notifier-tray

💡 Update indicator tray icon for Debian and Gentoo; meant to replace gone update-notifier
Python
7
star
23

shared-library-version-bump

🌍 A web-tool to help with bumping -version-info linker arguments with your upcoming release of a shared library
HTML
6
star
24

rnv

🐠 Relax NG Compact Syntax validator by David Tolpin; official upstream maintenance repository
C
5
star
25

vue-tristate-checkbox

Vue.js component implementing a cycling tristate checkbox that supports form submission
HTML
5
star
26

extract-hotline-miami-soundtrack

🎵 Extract soundtrack from Hotline Miami PC game .wad file (OGG Vorbis); command line tool
C
5
star
27

enum

🔢 Command line tool to enumerate values, replacing GNU seq and *BSD jot (moved from https://fedorahosted.org/enum/)
C
4
star
28

svgstrip

🛀 Tool that strips private information from SVG files (Python)
Python
4
star
29

import-watch

Trace module imports and detect/deny cyclic imports at runtime
Python
3
star
30

dsp_restless

The Restless Winamp Plugin (a.k.a. dsp_restless) of 2005
C++
3
star
31

backup-my-hub

🐙 Simple command line tool to make local backups of GitHub repositories and gists (Python)
Python
3
star
32

rust-for-it

🦀 Wait for one or more services (TCP port) to be available before executing a command; Rust version of wait-for-it
Rust
3
star
33

xiangqi-book-example

Example of a book featuring print-quality Xiangqi board setup graphics generated on-the-fly using xiangqi-setup; PDF output download at https://github.com/hartwork/xiangqi-book-example/releases/download/1.0.0/book_1_0_0.pdf
TeX
3
star
34

sdl_video_demo

Demos fast blitting of a video buffer to the screen with scaling while respecting aspect-ratio in C99 for both SDL 2 and SDL 1
C
2
star
35

klogripper

🚽 Kernel log ripper, i.e. a union of dmesg and tail -f (C)
C
2
star
36

newspipe

📰 RSS/Atom aggregation to e-mail. Fork of Newspipe 1.1.9 with SSL and packaging (Python)
Python
2
star
37

slides_shell_we_continue

🐚 Slides for a talk on Bash and the terminal (in German)
CSS
2
star
38

gentoo-workshop-troisdorf-2015-08-01

🐮 Slides for a talk on how to write Ebuilds for Gentoo (in German); PDF: http://downloads.trolug.de/2015-09-01_gentoo-workshop-troisdorf_sebastian_pipping_paketierung.pdf
Makefile
2
star
39

slides_python_json_emoji_crash_story

🗿 Slides of talk "Python JSON Emoji crash story" at Django Meetup Berlin 2020-02-18; latest PDF: https://github.com/hartwork/slides_python_json_emoji_crash_story/releases/download/v4/python-json-emoji-crash-story-2020-02-18-v4.pdf
Makefile
2
star
40

OpenXiangqi

🎲 Chinese chess (Java, GNU AGPL v3 or later)
Java
1
star
41

out_bridge

The Outbridge Winamp Plugin (a.k.a. out_bridge) of 2005/2006
C++
1
star
42

gen_freeze

The Freeze Winamp Plugin (a.k.a. gen_freeze) of 2006
C++
1
star
43

dsp_freeverb_gpl

The GPL Freeverb Winamp Plugin (a.k.a. dsp_freeverb_gpl) of 2006
C++
1
star
44

flasktop

🔝 "top in the browser" using Flask and jQuery DataTables (Python, JavaScript)
Python
1
star
45

audio_pump_demo

🎙️ Demos pumping audio from the microphone to headphones/speakers in C99 for PulseAudio, PortAudio and SDL 2
C
1
star
46

beamer-theme-matrix

🌐 LaTeX Beamer Theme Matrix of 2009 (Bash)
Shell
1
star
47

gen_allmusic

The Allmusic Hotkey Winamp Plugin (a.k.a. gen_allmusic) of 2006
C++
1
star