diff --git a/debian/changelog b/debian/changelog index de336e7c..3c984b99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ debian-cd (3.1.23) UNRELEASED; urgency=medium * contrib/HEADER.html.in: add paragraphs describing the Debian Edu netinst images for amd64 and i386. + [ Samuel Thibault ] + * Support dark theme boot entries. + -- Holger Levsen Thu, 07 Feb 2019 15:53:42 +0100 debian-cd (3.1.22) unstable; urgency=medium diff --git a/tools/boot/buster/parse_isolinux b/tools/boot/buster/parse_isolinux index a15e52d2..e7d4ae00 100755 --- a/tools/boot/buster/parse_isolinux +++ b/tools/boot/buster/parse_isolinux @@ -137,6 +137,14 @@ sub create_theme_file { } close(IN); close(OUT); + open(IN, "<", "$theme_dir/$filename"); + open(OUT, ">", "$theme_dir/dark-$filename"); + while () { + next if ($_ =~ /^desktop-image:/); + print OUT "$_"; + } + close(IN); + close(OUT); } make_path($theme_dir); @@ -152,6 +160,7 @@ $menu_title[$menudepth] = $menu{"title"}; my %kernel; my $in_kernel = 0; +my $in_dark = 0; my $new_menu = 0; $menudepth++; @@ -172,6 +181,9 @@ foreach my $line(@lines) { } $menu{"number"} = $mn_string; $menu{"label"} = $1; + if ($menu{"label"} eq "dark") { + $in_dark = 1; + } if ($in_kernel) { print_kernel(\%kernel); undef %kernel; @@ -192,6 +204,7 @@ foreach my $line(@lines) { $pre = "... "; } else { $pre = ""; + $in_dark = 0; } } elsif ($line =~ /^\s*menu title (.*$)/) { if ($in_kernel) { @@ -215,9 +228,18 @@ foreach my $line(@lines) { $pre = ""; } debug(); - print_indent "set menu_color_normal=cyan/blue\n"; - print_indent "set menu_color_highlight=white/blue\n"; - print_indent "set theme=/boot/grub/theme/" . $menu{"number"} . "\n"; + if ($in_dark) { + print_indent "set menu_color_normal=white/black\n"; + print_indent "set menu_color_highlight=yellow/black\n"; + print_indent "set color_normal=white/black\n"; + print_indent "set color_highlight=yellow/black\n"; + print_indent "background_image\n"; + print_indent "set theme=/boot/grub/theme/dark-" . $menu{"number"} . "\n"; + } else { + print_indent "set menu_color_normal=cyan/blue\n"; + print_indent "set menu_color_highlight=white/blue\n"; + print_indent "set theme=/boot/grub/theme/" . $menu{"number"} . "\n"; + } create_theme_file($menu{"number"}); $new_menu = 0; }