-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2d0c991
Showing
100 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.deb | ||
debian/boot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Windows GRUB 样式 | ||
|
||
仿写了一个类似 Windows Boot Manager 的 GRUB 主题,简体中文版。 | ||
|
||
## 效果 | ||
|
||
![1](./img/1.png) | ||
|
||
作为对比,这是原版 Windows Boot Manager 在我的电脑中的效果 | ||
|
||
![2](./img/2.png) | ||
|
||
## 使用方法 | ||
|
||
首先你需要准备好你自己的 `微软雅黑` 和 `微软静黑` 字体。文件名一般是 `msyh.ttc` ,`msyhl.ttc` 和 `msjh.ttc`,这个可以从 Windows 获得,在 `C:\Windows\Fonts` 里。 | ||
|
||
### Debian 系简易安装 | ||
|
||
我提供了 deb 安装包,您需要从 release 里下载 deb 包进行安装,同时根据安装时的终端的提示完成字体配置。 | ||
|
||
该 deb 包适用于任何架构,但仅限于 Debian 系发行版。卸载该 deb 包时会打扫干净恢复原样。 | ||
|
||
### 手动安装 | ||
|
||
对于 Debian 系发行版,手动安装的方法是: | ||
|
||
1. 下载本仓库,把本仓库 `src` 目录复制为 `/boot/grub/themes/Windows` 目录。 | ||
2. 修改 `/boot/grub/themes/Windows/theme.txt` 第 35 行为你自己的操作系统。 | ||
3. 修改 `/etc/grub.d/00_header`,在顶上添加一行 | ||
|
||
```bash | ||
GRUB_THEME=/boot/grub/themes/Windows/theme.txt | ||
```` | ||
|
||
4. 修改 `/etc/grub.d/10_linux`,在含有 `gettext_printf "Advanced options for %s"` 的那一行(本人电脑是 393 行)里,`\$menuentry_id_option` 前添加一项 `${CLASS}`(前后带空格) | ||
5. 修改 `/etc/grub.d/30_os-prober`,在含有 `gettext_printf "Advanced options for %s"` 的那一行(本人电脑是 291 行)里,`\$menuentry_id_option` 前添加一项 `${CLASS}`(前后带空格) | ||
6. 修改 `/etc/grub.d/30_uefi-firmware`,在含有 `menuentry '$LABEL'` 的那一行(本人电脑是 37 行)里,`\$menuentry_id_option` 前添加一项 `--class efi`(前后带空格) | ||
7. 完成字体配置 | ||
|
||
```bash | ||
sudo grub-mkfont -s 24 -o /boot/grub/themes/Windows/msjh24.pf2 your/msjh.ttc | ||
sudo grub-mkfont -s 16 -o /boot/grub/themes/Windows/msyh16.pf2 your/msyh.ttc | ||
sudo grub-mkfont -s 64 -o /boot/grub/themes/Windows/msyh64.pf2 your/msyhl.ttc | ||
``` | ||
|
||
8. 执行 `update-grub` | ||
|
||
其他发行版暂不清楚能否可以运行,但方法类似。 | ||
|
||
## 感谢 | ||
|
||
图标来自于 [https://github.com/MrVivekRajan/Grub-Themes](https://github.com/MrVivekRajan/Grub-Themes) 的二次制作。 | ||
|
||
## 免责声明 | ||
|
||
本仓库仅供学习交流使用,禁止用于商用,若使用本仓库内容请标明出处。 | ||
|
||
使用本开源仓库及其成果时,您知道可能对你的计算机产生危害,产生的一切损失由使用者承担。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Package: grub-theme-windows | ||
Version: 1.0.0 | ||
Architecture: all | ||
Maintainer: github.com/KZ25T | ||
Description: A windows-like GRUB theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
cp -r /etc/grub.d /etc/grub.d.bak | ||
source /etc/os-release | ||
echo "generating for $NAME" | ||
sed -i '/^prefix=/i GRUB_THEME=/boot/grub/themes/Windows/theme.txt' /etc/grub.d/00_header | ||
sed -i 's/\(.*Advanced options for %s.*\)\\\$menuentry/\1\${CLASS} \\\$menuentry/' /etc/grub.d/10_linux | ||
sed -i 's/\(.*Advanced options for %s.*\)\\\$menuentry/\1\${CLASS} \\\$menuentry/' /etc/grub.d/30_os-prober | ||
sed -i 's|^\(.*\)\\$menuentry_id_option|\1--class efi \\$menuentry_id_option|' /etc/grub.d/30_uefi-firmware | ||
sed -i "s#HOST_DISTRO#$NAME#g" /boot/grub/themes/Windows/theme.txt | ||
update-grub | ||
|
||
echo -e "\e[1;33m" | ||
echo "Attention: This is NOT an ERROR but you have to read it." | ||
echo "We didn't prepare font file because of copyright. YOU SHOULD DO IT YOURSELF LIKE BELOW." | ||
echo "You should prepare your Microsoft YaHei and JhengHei font, name like: msjh.ttc msyh.ttc msyhl.ttc from Windows." | ||
echo "Then run command below:" | ||
echo "\$ sudo grub-mkfont -s 24 -o /boot/grub/themes/Windows/msjh24.pf2 your/msjh.ttc" | ||
echo "\$ sudo grub-mkfont -s 16 -o /boot/grub/themes/Windows/msyh16.pf2 your/msyh.ttc" | ||
echo "\$ sudo grub-mkfont -s 64 -o /boot/grub/themes/Windows/msyh64.pf2 your/msyhl.ttc" | ||
read -s -n 1 -p "DO YOU KNOW THAT? Press RETURN to continue." | ||
echo -e "\e[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
dir_A="/etc/grub.d.bak" | ||
dir_B="/etc/grub.d" | ||
|
||
if [ -d "$dir_A" ]; then | ||
if [ -d "$dir_B" ]; then | ||
rm -r "$dir_B" | ||
mv "$dir_A" "$dir_B" | ||
else | ||
echo "We have not found $dir_B, maybe it's wrong, please fix it yourself. Hope you a good luck." | ||
fi | ||
else | ||
echo "Directory $dir_A does not exist, no action taken. Maybe it's wrong, please fix it yourself. Hope you a good luck." | ||
fi | ||
|
||
update-grub |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Global Property | ||
title-text: "" | ||
desktop-color: "#2165b5" | ||
terminal-left: "0" | ||
terminal-top: "0" | ||
terminal-width: "100%" | ||
terminal-height: "100%" | ||
terminal-border: "0" | ||
terminal-font: "GNU Unifont Regular 16" | ||
|
||
# Show the boot menu | ||
+ boot_menu { | ||
left = 8% | ||
top = 17% | ||
width = 500 | ||
height = 70% | ||
item_font = "Microsoft JhengHei Regular 24" | ||
item_color = "#ffffff" | ||
icon_width = 128 | ||
icon_height = 128 | ||
item_icon_space = 10 | ||
item_height = 144 | ||
item_padding = 10 | ||
item_spacing = 10 | ||
selected_item_pixmap_style = "frame_*.png" | ||
} | ||
|
||
# Show a countdown message using the label component | ||
+ label { | ||
top = 13% | ||
left = 9% | ||
width = 30% | ||
id = "__timeout__" | ||
font = "Microsoft YaHei Regular 16" | ||
text = "HOST_DISTRO 将在 %d 秒 内自动运行。" | ||
color = "#ffffff" | ||
} | ||
|
||
+ label { | ||
text = "选择操作系统" | ||
font = "Microsoft YaHei Regular 64" | ||
top = 3% | ||
left = 9% | ||
color = "#ffffff" | ||
} |