All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin D Bennett <colin@gibibit.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Cc: anthony.cunningham@gmail.com
Subject: Re: Random selections and changing splash screen
Date: Wed, 28 Jan 2009 07:09:05 -0800	[thread overview]
Message-ID: <20090128070905.4dcf7f4f@gibibit.com> (raw)
In-Reply-To: <a6a0fea0901280501x45fb8b27td2f583114594ea6@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3829 bytes --]

On Wed, 28 Jan 2009 13:01:52 +0000
Antóin Óg Ó Cuinneagáin <anthony.cunningham@gmail.com> wrote:

> Hi my name is Anthony Cunningham and I have recently joined this list.
> 
> I'd had some ideas for features for Grub and the wiki mentions putting
> them on this list in case they exist, or others may be working on
> something similar.
> 
> One idea is that after the timeout a random entry is chosen from the
> boot menu, instead of default.  The use case I had in mind would be
> where multiple distributions are installed and the user would let a
> random one boot as an incentive to learn to work with that
> distributions package manager, destop environment etc.
> the entry could be like :
> random  //any random entry
> random (4,5,8)  //random of 4, 5 or 8
> random not (3,5,9) //random , except these..for not choosing windows
> or rescue partitions etc.

Hi Anthony,

That's an interesting idea.  It wouldn't be too hard to implement, I'm
sure.  Another implementation that might be cleaner than specifying the
indices of the items to select from would be to use the 'class'
attribute of menu items which has recently been added.

The 'class' attribute works similarly to the way the HTML/CSS class
attribute functions:  Each menu entry has a set of zero or more classes
(which are simply character strings) which characterize the entry.  The
reason I added the 'class' attribute initially was to support showing
an icon for each menu entry, where the most appropriate icon is chosen
(i.e., if 'Ubuntu Linux 8.10' is an entry with classes { 'ubuntu',
'linux', 'os' }, then an icon called 'ubuntu.png' is first looked for,
then if that is not found, 'linux.png' is searched for, etc.).

We could use the 'class' attribute to identify which items you want to
randomly select from.  For instance, suppose you want to choose a
random entry from all the free operating systems installed.  Then you
could add a class 'free-os' to the classes for each Linux, BSD, and
other free OS menu entry.  The 'random boot' command could then be
specified as:
  random   // Any random entry
  random --class=free-os    // Any free operating system
  random --class=linux --exclude-class=rescue
  // ^ Any Linux distribution, but not rescue entries.

I really try to avoid using indices to refer to entries in the grub.cfg
since that makes it brittle to change (if you add/move/delete an entry,
some of your index references may need to be changed, and it's up to
you to figure out which ones).

> Also another feature I thought of (when may exist) is a per entry
> splashscreen setting, and moving up and down with the arrow keys would
> change the background splashscreen.
> I think this would be a nice feature to show OS specific splashscreens
> Windows, Red Hat, FreeBSD etc.
> 
> Anthony

By the 'splashscreen', do you mean the background image behind the GRUB
menu?  So, as you press the arrow keys up and down on the GRUB menu to
select an entry to boot, the background image is changing depending on
the highlighted menu entry?

This is definitely possible, and it could be done on a theme-by-theme
basis (this would be, IMO, a great place to use Lua scripting in
the theme[1]). If the background-switching feature really seems useful,
I can take a look at adding it to my gfxmenu branch sometime, which is
in the final stages of preparation for merging into mainline GRUB.

Regards,
Colin

[1] Lua support is *not* currently planned for inclusion into GRUB, but
    I did do a very successful 'spike' experiment which allows themes to
    include Lua code that can use the GRUB graphics API.  I'd still
    like to continue down the path of adding Lua support at some point,
    because I think the value is high and the effort required is low.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-01-28 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 13:01 Random selections and changing splash screen Antóin Óg Ó Cuinneagáin
2009-01-28 15:09 ` Colin D Bennett [this message]
2009-01-28 16:39   ` Pavel Roskin
2009-02-07 22:05   ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090128070905.4dcf7f4f@gibibit.com \
    --to=colin@gibibit.com \
    --cc=anthony.cunningham@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.