1
0

refactor: init

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
This commit is contained in:
Jack Cherng
2020-08-12 03:57:24 +08:00
parent 567b00c91e
commit d126b582fe
87 changed files with 255 additions and 228 deletions
+35
View File
@@ -0,0 +1,35 @@
# EditorConfig is awesome: https://EditorConfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.bat]
charset = latin1
end_of_line = crlf
[*.{css,sass,scss}]
indent_size = 2
[*.js]
indent_size = 2
[*.json]
indent_size = 4
[*.md]
indent_size = 2
trim_trailing_whitespace = false
[*.{sh,csh,tcsh,zsh,bash,fish}]
indent_size = 4
[*.{yml,yaml,toml,neon}]
indent_size = 2
[Makefile]
indent_style = tab
+6
View File
@@ -0,0 +1,6 @@
.editorconfig export-ignore
.gitattributes export-ignore
.github/ export-ignore
.gitignore export-ignore
.travis.yml export-ignore
docs/ export-ignore
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017 Andrei Shevchuk
Copyright (c) 2020 Jack Cherng (@jfcherng)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+9 -22
View File
@@ -1,27 +1,14 @@
## Poly dark GRUB theme
# Ventoy theme: Poly Dark
Supported languages: Chinese (simplified), English, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, Ukrainian
The [Poly Dark](https://github.com/shvchk/poly-dark) GRUB theme modified
to be used for my [Ventoy](https://github.com/ventoy/Ventoy) setup.
![](https://i.imgur.com/OHGyR2N.gif)
## Screenshots
Screenshot is intentionally low res to fit GitHub UI. See also: [1280×720](https://i.imgur.com/iKtkLr4.png), [1920×1080](https://i.imgur.com/faGEmp5.png)
![Screenshot_init](https://raw.githubusercontent.com/jfcherng/ventoy-theme-poly-dark/master/docs/screenshot_init.png)
---
## Installation
### Installation / update
1. **Secure way:**
- Download install script:
`wget -P /tmp https://github.com/shvchk/poly-dark/raw/master/install.sh`
- Review install script at `/tmp/install.sh`
- Run it: `bash /tmp/install.sh`
2. **Easier, less secure way** — just download and run install script:
`wget -O - https://github.com/shvchk/poly-dark/raw/master/install.sh | bash`
---
### See also
- [Poly light GRUB theme](https://github.com/shvchk/poly-light)
- [Fallout GRUB theme](https://github.com/shvchk/fallout-grub-theme)
- See https://www.ventoy.net/en/plugin_theme.html
- The `/disk_root/` in this repository means the root of your USB disk.
- If you only need the theme, just take the `/disk_root/ventoy/theme/poly-dark/`.
+22
View File
@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2020 Jack Cherng (@jfcherng)
Copyright (c) 2017 Andrei Shevchuk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Before

Width:  |  Height:  |  Size: 656 KiB

After

Width:  |  Height:  |  Size: 656 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 109 B

Before

Width:  |  Height:  |  Size: 67 B

After

Width:  |  Height:  |  Size: 67 B

@@ -0,0 +1,69 @@
# Global properties
title-text: "Ventoy theme: Poly Dark (@jfcherng, @shvchk)"
title-font: "Unifont Regular 22"
title-color: "#FFFFFF"
desktop-image: "background.png"
desktop-color: "#FFFFFF"
terminal-font: "Unifont Regular 18"
terminal-box: "terminal_box_*.png"
terminal-left: "0"
terminal-top: "0"
terminal-width: "100%"
terminal-height: "100%"
terminal-border: "0"
# Boot menu
+ boot_menu {
left = 15%
top = 20%
width = 70%
height = 50%
item_font = "Unifont Regular 18"
item_color = "#777777"
selected_item_color = "#999999"
item_height = 40
item_spacing = 4
item_pixmap_style = "item_*.png"
item_icon_space = "16"
selected_item_pixmap_style = "selected_item_*.png"
}
# Countdown message
+ label {
left = 0
top = 80%
width = 100%
align = "center"
id = "__timeout__"
text = "Booting in %d seconds"
color = "#777777"
font = "Unifont Regular 18"
}
# Grub2 messages
+ hbox {
top = 85%
left = 20%
+ label {text = "Enter: " font = "Unifont Regular 18" color = "#00EEEE" align = "left"}
+ label {text = "Boot Selection " font = "Unifont Regular 18" color = "#cccccc" align = "left"}
+ label {text = "E: " font = "Unifont Regular 18" color = "#00EEEE" align = "left"}
+ label {text = "Edit Selection " font = "Unifont Regular 18" color = "#cccccc" align = "left"}
+ label {text = "C: " font = "Unifont Regular 18" color = "#00EEEE" align = "left"}
+ label {text = "GRUB Commandline" font = "Unifont Regular 18" color = "#cccccc" align = "left"}
}
# Ventoy messages
+ hbox {
top = 85%+24
left = 20%
+ label {text = "F1: " font = "Unifont Regular 18" color = "#00EEEE" align = "left"}
+ label {text = "Mem Disk " font = "Unifont Regular 18" color = "#cccccc" align = "left"}
+ label {text = "F2: " font = "Unifont Regular 18" color = "#00EEEE" align = "left"}
+ label {text = "Power " font = "Unifont Regular 18" color = "#cccccc" align = "left"}
+ label {text = "F3: " font = "Unifont Regular 18" color = "#00EEEE" align = "left"}
+ label {text = "Tree View " font = "Unifont Regular 18" color = "#cccccc" align = "left"}
+ label {text = "F4: " font = "Unifont Regular 18" color = "#00EEEE" align = "left"}
+ label {text = "Local Boot " font = "Unifont Regular 18" color = "#cccccc" align = "left"}
+ label {text = "F5: " font = "Unifont Regular 18" color = "#00EEEE" align = "left"}
+ label {text = "Debug " font = "Unifont Regular 18" color = "#cccccc" align = "left"}
}
+113
View File
@@ -0,0 +1,113 @@
{
"control": [
{ "VTOY_DEFAULT_MENU_MODE": "1" },
{ "VTOY_FILT_DOT_UNDERSCORE_FILE": "1" },
{ "VTOY_DEFAULT_SEARCH_ROOT": "/_ISO" }
],
"theme": {
"file": "/ventoy/theme/poly-dark/theme.txt",
"gfxmode": "1920x1080",
"display_mode": "GUI",
"ventoy_left": "5%",
"ventoy_top": "95%",
"ventoy_color": "#ff0000"
},
"menu_class": [
{
"key": "Acronis",
"class": "acronis"
},
{
"key": "archlinux-",
"class": "archlinux"
},
{
"key": "CentOS-",
"class": "centos"
},
{
"key": "clonezilla-",
"class": "clonezilla"
},
{
"key": "debian-",
"class": "debian"
},
{
"key": "deepin-",
"class": "deepin"
},
{
"key": "elementaryos-",
"class": "elementaryos"
},
{
"key": "Federa-",
"class": "federa"
},
{
"key": "linuxmint-",
"class": "linuxmint"
},
{
"key": "macOS",
"class": "macosx"
},
{
"key": "openSUSU-",
"class": "opensuse"
},
{
"key": "Win7",
"class": "windows_7"
},
{
"key": "Win8",
"class": "windows_8"
},
{
"key": "Win10",
"class": "windows_10"
},
{
"key": "WinXP",
"class": "windows_xp"
},
{
"key": "kubuntu-",
"class": "kubuntu"
},
{
"key": "lubuntu-",
"class": "lubuntu"
},
{
"key": "xubuntu-",
"class": "xubuntu"
},
{
"key": "ubuntu-",
"class": "ubuntu"
},
{
"dir": "/_ISO/Linux",
"class": "linux"
},
{
"dir": "/_ISO/macOS",
"class": "macosx"
},
{
"dir": "/_ISO/Utility",
"class": "utility"
},
{
"dir": "/_ISO/Windows",
"class": "windows"
},
{
"dir": "/_ISO/WinPE",
"class": "win_pe"
}
]
}
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

-118
View File
@@ -1,118 +0,0 @@
#! /usr/bin/env bash
THEME='poly-dark'
LANG='English'
# Change to temporary directory
cd $(mktemp -d)
# Pre-authorise sudo
sudo echo
# Select language, optional
declare -A LANGS=(
[Chinese]=zh_CN
[English]=EN
[French]=FR
[German]=DE
[Italian]=IT
[Norwegian]=NO
[Portuguese]=PT
[Russian]=RU
[Spanish]=ES
[Ukrainian]=UA
)
LANG_NAMES=($(echo ${!LANGS[*]} | tr ' ' '\n' | sort -n))
PS3='Please select language #: '
select l in "${LANG_NAMES[@]}"
do
if [[ -v LANGS[$l] ]]
then
LANG=$l
break
else
echo 'No such language, try again'
fi
done < /dev/tty
# Detect distro and set GRUB location and update method
GRUB_DIR='grub'
UPDATE_GRUB=''
if [ -e /etc/os-release ]; then
source /etc/os-release
if [[ "$ID" =~ (debian|ubuntu|solus) || \
"$ID_LIKE" =~ (debian|ubuntu) ]]; then
UPDATE_GRUB='update-grub'
elif [[ "$ID" =~ (arch|gentoo) || \
"$ID_LIKE" =~ (archlinux|gentoo) ]]; then
UPDATE_GRUB='grub-mkconfig -o /boot/grub/grub.cfg'
elif [[ "$ID" =~ (centos|fedora|opensuse) || \
"$ID_LIKE" =~ (fedora|rhel|suse) ]]; then
GRUB_DIR='grub2'
UPDATE_GRUB='grub2-mkconfig -o /boot/grub2/grub.cfg'
fi
fi
echo 'Fetching theme archive'
wget -O ${THEME}.zip https://github.com/shvchk/${THEME}/archive/master.zip
echo 'Unpacking theme'
unzip ${THEME}.zip
if [[ "$LANG" != "English" ]]
then
echo "Changing language to ${LANG}"
sed -i -r -e '/^\s+# EN$/{n;s/^(\s*)/\1# /}' \
-e '/^\s+# '"${LANGS[$LANG]}"'$/{n;s/^(\s*)#\s*/\1/}' ${THEME}-master/theme.txt
fi
echo 'Creating GRUB themes directory'
sudo mkdir -p /boot/${GRUB_DIR}/themes/${THEME}
echo 'Copying theme to GRUB themes directory'
sudo cp -r ${THEME}-master/* /boot/${GRUB_DIR}/themes/${THEME}
echo 'Removing other themes from GRUB config'
sudo sed -i '/^GRUB_THEME=/d' /etc/default/grub
echo 'Making sure GRUB uses graphical output'
sudo sed -i 's/^\(GRUB_TERMINAL\w*=.*\)/#\1/' /etc/default/grub
echo 'Removing empty lines at the end of GRUB config' # optional
sudo sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' /etc/default/grub
echo 'Adding new line to GRUB config just in case' # optional
echo | sudo tee -a /etc/default/grub
echo 'Adding theme to GRUB config'
echo "GRUB_THEME=/boot/${GRUB_DIR}/themes/${THEME}/theme.txt" | sudo tee -a /etc/default/grub
echo 'Removing theme installation files'
rm -rf ${THEME}.zip ${THEME}-master
echo 'Updating GRUB'
if [[ $UPDATE_GRUB ]]; then
eval sudo "$UPDATE_GRUB"
else
cat << ' EOF'
--------------------------------------------------------------------------------
Cannot detect your distro, you will need to run `grub-mkconfig` (as root) manually.
Common ways:
- Debian, Ubuntu, Solus and derivatives: `update-grub` or `grub-mkconfig -o /boot/grub/grub.cfg`
- RHEL, CentOS, Fedora, SUSE and derivatives: `grub2-mkconfig -o /boot/grub2/grub.cfg`
- Arch, Gentoo and derivatives: `grub-mkconfig -o /boot/grub/grub.cfg`
--------------------------------------------------------------------------------
EOF
fi
-87
View File
@@ -1,87 +0,0 @@
# Global properties
title-text: ""
desktop-image: "background.png"
desktop-color: "#000000"
terminal-font: "Unifont Regular 18"
terminal-box: "terminal_box_*.png"
terminal-left: "0"
terminal-top: "0"
terminal-width: "100%"
terminal-height: "100%"
terminal-border: "0"
# Boot menu
+ boot_menu {
left = 15%
top = 20%
width = 70%
height = 60%
item_font = "Unifont Regular 18"
item_color = "#777777"
selected_item_color = "#999999"
item_height = 40
item_spacing = 4
item_pixmap_style = "item_*.png"
selected_item_pixmap_style = "selected_item_*.png"
}
# Countdown message
+ label {
left = 0
top = 100%-48
width = 100%
align = "center"
id = "__timeout__"
# DE
# text = "Start in %d Sekunden."
# EN
text = "Booting in %d seconds"
# ES
# text = "Arranque en %d segundos"
# FR
# text = "Démarrage automatique dans %d secondes"
# IT
# text = "Avvio in %d secondi"
# NO
# text = "Starter om %d sekunder"
# PT
# text = "Arranque automático dentro de %d segundos"
# RU
# text = "Загрузка выбранного пункта через %d сек."
# UA
# text = "Автоматичне завантаження розпочнеться через %d сек."
# zh_CN
# text = "在 %d 内启动"
color = "#777777"
font = "Unifont Regular 18"
}
# Navigation keys hint
+ label {
left = 0
top = 100%-24
width = 100%
align = "center"
# DE
# text = "System mit ↑ und ↓ auswählen und mit Enter bestätigen."
# EN
text = "Use ↑ and ↓ keys to change selection, Enter to confirm"
# ES
# text = "Use las teclas ↑ y ↓ para cambiar la selección, Enter para confirmar"
# FR
# text = "Choisissez le système avec les flèches du clavier (↑ et ↓), puis validez avec la touche Enter (↲)"
# IT
# text = "Usa i tasti ↑ e ↓ per cambiare la selezione, premi Invio ↲ per confermare"
# NO
# text = "Bruk ↑ og ↓ for å endre menyvalg, velg med Enter"
# PT
# text = "Use as teclas ↑ e ↓ para mudar a seleção, e ENTER para confirmar"
# RU
# text = "Используйте клавиши ↑ и ↓ для изменения выбора, Enter для подтверждения"
# UA
# text = "Використовуйте ↑ та ↓ для вибору, Enter для підтвердження"
# zh_CN
# text = "使用 ↑ 和 ↓ 键移动选择条,Enter 键确认"
color = "#777777"
font = "Unifont Regular 18"
}