Skip to contentSkip to conversation

New configuration variables for setting GRUB's colors in /etc/default/grub (Debian bug #608283)

PATCH Alexander Kurtz 2 participants 3 messages May 26, 2011 – Feb 5, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

it seems there is a quite big demand for setting GRUB's colors directly via /etc/default/grub, see [1-8]. There seem to be no official GRUB_* variables for this purpose yet[9].

However, Arch Linux recommends[10] using GRUB_COLOR_NORMAL and GRUB_COLOR_HIGHLIGHT. I suggest to extend that approach and also provide GRUB_MENU_COLOR_NORMAL and GRUB_MENU_COLOR_HIGHLIGHT roughly like that:

 GRUB_COLOR_NORMAL         - set the GRUB environment variable 'color_normal'
 GRUB_COLOR_HIGHLIGHT      - set the GRUB environment variable 'color_highlight'
 GRUB_MENU_COLOR_NORMAL    - set the GRUB environment variable 'menu_color_normal'

GRUB_MENU_COLOR_HIGHLIGHT - set the GRUB environment variable 'menu_color_highlight'

I have attached a patch which makes grub-mkconfig export these new variables. What do you think?

Best regards

Alexander Kurtz

[1] http://www.debianuserforums.org/viewtopic.php?f=10&t=151
[2] http://ubuntuforums.org/showthread.php?t=1739412
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461851
[4] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495282
[5] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495616
[6] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=500134
[7] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608283
[8] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=610273
[9] http://www.gnu.org/software/grub/manual/grub.html#Simple-configuration
[10] https://wiki.archlinux.org/index.php/GRUB2#Menu_colors

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: [email protected]\
# ofsat0zhkvknzw02
# target_branch: http://bzr.savannah.gnu.org/r/grub/trunk/grub/
# testament_sha1: f46b1113f5f8a74c43ad9ca79a045aba263d2655 # timestamp: 2011-05-26 14:31:09 +0200
# base_revision_id: [email protected] #
# Begin patch
=== modified file 'util/grub-mkconfig.in'

grub-mkconfig.in +4 -0
@@ -252,6 +252,10 @@
   GRUB_GFXMODE \
   GRUB_BACKGROUND \
   GRUB_THEME \
+  GRUB_COLOR_NORMAL \
+  GRUB_COLOR_HIGHLIGHT \
+  GRUB_MENU_COLOR_NORMAL \
+  GRUB_MENU_COLOR_HIGHLIGHT \
   GRUB_GFXPAYLOAD_LINUX \
   GRUB_DISABLE_OS_PROBER \
   GRUB_INIT_TUNE \

# Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWR2t3yoAAXRfgAAQUHP/93rv lgS////wUAOVUDbQHuzlwkkIIT01PTTJiATTU0xDMptAZR6nqCSQg00GmpimmphBpkaAA0GJ6gNC U9qCNAA0ZGgAAABoAcwCaYBMhgACYJgAAAkqQADQ0APUAGjQaZNAaAZbHZ3ZE23QoxQtwa4Cetz7 aov3MEcvbBhm7vod8KxrGMET7emXlYb2OXl4jaOfD56Xq8d9yJarLnVV6fbuTmRTk+/I3fceAjcv K/dksDvmKyxUzhzJccBHgFHaZS4dVYuxo0k7OhszqXXCcQQtacrXhiWJOWNPdIcivmrRZI6JRmrh HOy2M+qsRonwmLOrmu2tWKw+dTHiuN+G0jtkdVxTg0uWNVxpw3EGXxVdzhDJz73O1vFsQXJsZtEU hQLMlm4O01kxhWrXNWKg296caNU09a+mcyqwUbVhvnrGKhvW1vY2JOaxRYwjEZSdm29QImr8aUe5 SN8RUK7qNTLFSxJmNFhVHADWXLO+taUjflWGC515lVnzzcWDW4bdKoVEC3oisdqLBRKattlojjRw TIoX4FSA6QhV9UOAIFQmkim0OgONPQIpKLx2cLFW7u1LolHxLr0zJjmL4/AoRrr4gwoH0HE3kPoe fwXEsRJeIuJEVZcJhWloqlcDjryGGcOTE+K5we/e8YKtGsz7dOs4eUDZu7p3uJ+wNgjeleppiyds 0yOl/AJiT0tw+o24qxLzHbnqPCxlafh4hKZ5ZSRvOBkswRO0q5IhwC6TNvwT3P1HWTSqqRT64RKi QfFxVZG70NhFqdR6cNuyiJtrr8YZdRoqqmbVjff1tLycdSW0pTK4pocs1sltZKE8AJVCgzPT16wL i0yMUnUYEf2zU9js0CaMLlgRBLmIb395Gd8KWan5TrQtV7KKhSGfKqfD2TRaCxDqhDOTG1WeAeAT c81D5aQ2BrdsqyKumKYFgJwmDBqnU1CYCvg2DcgJKdSdvJdmrOrOT1QiDpPkUhO0JxCrWng3lUKw yMZEQo2hgBsYZD476HMsLlmFpuWGQUqXl3qIFKFbZ3opSvGgMC1rtHrqrgsVTMv1AievOXG+1WKZ YcljCvhbegi9lnH2ee1Udi8INECSHJ9fJoJ9/Bi7eDWHpYrKkYZ9bkm1L2szNZr/W53ULyEgvCpk +bngXsjtnu2jj01Jfak8ZlWEQm1Cq8XgfTKjcmMy68YFdZpFCXCL+LuSKcKEgO1u+VA=

#1 lore raw
Quoted 10 lines · Alexander Kurtz

Hi,

it seems there is a quite big demand for setting GRUB's colors directly via /etc/default/grub, see [1-8]. There seem to be no official GRUB_* variables for this purpose yet[9].

However, Arch Linux recommends[10] using GRUB_COLOR_NORMAL and GRUB_COLOR_HIGHLIGHT. I suggest to extend that approach and also provide GRUB_MENU_COLOR_NORMAL and GRUB_MENU_COLOR_HIGHLIGHT roughly like that:

Quoted 7 lines
  GRUB_COLOR_NORMAL         - set the GRUB environment variable 'color_normal'
  GRUB_COLOR_HIGHLIGHT      - set the GRUB environment variable 'color_highlight'
  GRUB_MENU_COLOR_NORMAL    - set the GRUB environment variable 'menu_color_normal'

GRUB_MENU_COLOR_HIGHLIGHT - set the GRUB environment variable 'menu_color_highlight'

I have attached a patch which makes grub-mkconfig export these new variables. What do you think?

This patch does only exporting, not any actual usage.

Quoted 20 lines

Best regards

Alexander Kurtz

[1] http://www.debianuserforums.org/viewtopic.php?f=10&t=151
[2] http://ubuntuforums.org/showthread.php?t=1739412
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461851
[4] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495282
[5] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495616
[6] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=500134
[7] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608283
[8] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=610273
[9] http://www.gnu.org/software/grub/manual/grub.html#Simple-configuration
[10] https://wiki.archlinux.org/index.php/GRUB2#Menu_colors

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#2 lore raw
Quoted 4 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 2 lines · Alexander Kurtz

I have attached a patch which makes grub-mkconfig export these new variables. What do you think?

This patch does only exporting, not any actual usage.

You are correct. I want to use these new variables to improve Debian's /etc/grub.d/05_debian_theme[0]. As written earlier, many Debian and Ubuntu users want a comfortable way to customize menu colors. However, I think the basic configuration options shouldn't be specific to Debian or Ubuntu. That's what this patch is for. Will you include it?

Best regards

Alexander Kurtz

[0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608283#80