Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c26f99622 | |||
| 739cddf60f | |||
| 7cf2f0918f | |||
| f6ab2438e1 | |||
| 42c232dfb4 | |||
| 24ac05a101 | |||
| 92fc1c9686 | |||
| 55aef0cada | |||
| 47a6467e27 | |||
| faf75d2a7f | |||
| 85db6e7cea | |||
| 3e7139701e | |||
| a697a28fe6 | |||
| 610bc23012 | |||
| a2b3fa071b | |||
| 18ea3defc5 | |||
| 326a27a6f2 | |||
| d73179c4ea | |||
| daa8aef95f | |||
| 9aa7e35d71 | |||
| 7cff52a245 |
@@ -1,51 +1,46 @@
|
|||||||

|

|
||||||
|
|
||||||
## Installation:
|
## Installation:
|
||||||
|
|
||||||
Usage: `sudo ./install.sh [OPTIONS...]`
|
Usage: `sudo ./install.sh [OPTIONS...]`
|
||||||
|
|
||||||
```
|
```
|
||||||
-t, --theme theme variant(s) [tela|vimix|stylish|whitesur] (default is tela)
|
-t, --theme theme variant(s) [tela|vimix|stylish|whitesur] (default is tela)
|
||||||
-i, --icon icon variant(s) [color|white|whitesur] (default is color)
|
-i, --icon icon variant(s) [color|white|whitesur] (default is color)
|
||||||
-s, --screen screen display variant(s) [1080p|2k|4k|ultrawide|ultrawide2k] (default is 1080p)
|
-s, --screen screen display variant(s) [1080p|2k|4k|ultrawide|ultrawide2k] (default is 1080p)
|
||||||
-r, --remove Remove theme [tela|vimix|stylish|whitesur] (must add theme name option, default is tela)
|
-c, --custom-resolution set custom resolution (e.g., 1600x900) (disabled in default)
|
||||||
|
-r, --remove remove theme [tela|vimix|stylish|whitesur] (must add theme name option, default is tela)
|
||||||
|
|
||||||
-b, --boot install theme into '/boot/grub' or '/boot/grub2'
|
-b, --boot install theme into '/boot/grub' or '/boot/grub2'
|
||||||
-g, --generate do not install but generate theme into chosen directory (must add your directory)
|
-g, --generate do not install but generate theme into chosen directory (must add your directory)
|
||||||
|
|
||||||
-h, --help Show this help
|
-h, --help show this help
|
||||||
```
|
```
|
||||||
|
*If no options are used, a user interface *`dialog`* will show up instead*
|
||||||
_If no options are used, a user interface `dialog` will show up instead_
|
|
||||||
|
|
||||||
### Examples:
|
### Examples:
|
||||||
- Install Tela theme on 2k display device:
|
- Install Tela theme on 2k display device:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo ./install.sh -t tela -s 2k
|
sudo ./install.sh -t tela -s 2k
|
||||||
```
|
```
|
||||||
|
- Install Tela theme with custom resolution:
|
||||||
|
```sh
|
||||||
|
sudo ./install.sh -t tela -c 1600x900
|
||||||
|
```
|
||||||
- Install Tela theme into /boot/grub/themes:
|
- Install Tela theme into /boot/grub/themes:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo ./install.sh -b -t tela
|
sudo ./install.sh -b -t tela
|
||||||
```
|
```
|
||||||
|
|
||||||
- Uninstall Tela theme:
|
- Uninstall Tela theme:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo ./install.sh -r -t tela
|
sudo ./install.sh -r -t tela
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installation with NixOS:
|
## Installation with NixOS:
|
||||||
To use this theme with NixOS you will have to enable [flakes](https://wiki.nixos.org/wiki/flakes). Before you do this, please inform yourself if you really want to, because flakes are still an unstable feature.
|
To use this theme with NixOS you will have to enable [flakes](https://wiki.nixos.org/wiki/flakes). Before you do this, please inform yourself if you really want to, because flakes are still an unstable feature.
|
||||||
|
|
||||||
First you will have to add grub2 to your `flake.nix` file as a new input.
|
First you will have to add grub2 to your `flake.nix` file as a new input.
|
||||||
```nix
|
```nix
|
||||||
# flake.nix
|
# flake.nix
|
||||||
{
|
{
|
||||||
description = "NixOS configuration";
|
description = "NixOS configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
# Add grub2 themes to your inputs ...
|
# Add grub2 themes to your inputs ...
|
||||||
@@ -53,13 +48,11 @@ First you will have to add grub2 to your `flake.nix` file as a new input.
|
|||||||
url = "github:vinceliuice/grub2-themes";
|
url = "github:vinceliuice/grub2-themes";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, grub2-themes, ... }: {
|
outputs = inputs@{ nixpkgs, grub2-themes, ... }: {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
my_host = nixpkgs.lib.nixosSystem {
|
my_host = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
|
|
||||||
# ... and then to your modules
|
# ... and then to your modules
|
||||||
modules = [
|
modules = [
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
@@ -70,7 +63,6 @@ First you will have to add grub2 to your `flake.nix` file as a new input.
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
After that, you can configure the theme as shown below. In this example it is inside the `configuration.nix` file but it can be any file you choose.
|
After that, you can configure the theme as shown below. In this example it is inside the `configuration.nix` file but it can be any file you choose.
|
||||||
```nix
|
```nix
|
||||||
# configuration.nix
|
# configuration.nix
|
||||||
@@ -81,21 +73,19 @@ After that, you can configure the theme as shown below. In this example it is in
|
|||||||
enable = true;
|
enable = true;
|
||||||
theme = "stylish";
|
theme = "stylish";
|
||||||
footer = true;
|
footer = true;
|
||||||
|
customResolution = "1600x900"; # Optional: Set a custom resolution
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Issues / tweaks:
|
## Issues / tweaks:
|
||||||
|
|
||||||
### Correcting display resolution:
|
### Correcting display resolution:
|
||||||
|
|
||||||
- On the grub screen, press `c` to enter the command line
|
- On the grub screen, press `c` to enter the command line
|
||||||
- Enter `vbeinfo` or `videoinfo` to check available resolutions
|
- Enter `vbeinfo` or `videoinfo` to check available resolutions
|
||||||
- Open `/etc/default/grub`, and edit `GRUB_GFXMODE=[height]x[width]x32` to match your resolution
|
- Open `/etc/default/grub`, and edit `GRUB_GFXMODE=[height]x[width]x32` to match your resolution
|
||||||
- Finally, run `grub-mkconfig -o /boot/grub/grub.cfg` to update your grub config
|
- Finally, run `grub-mkconfig -o /boot/grub/grub.cfg` to update your grub config
|
||||||
|
|
||||||
### Setting a custom background:
|
### Setting a custom background:
|
||||||
|
|
||||||
- Make sure you have `imagemagick` installed, or at least something that provides `convert`
|
- Make sure you have `imagemagick` installed, or at least something that provides `convert`
|
||||||
- Find the resolution of your display, and make sure your background matches the resolution
|
- Find the resolution of your display, and make sure your background matches the resolution
|
||||||
- 1920x1080 >> 1080p
|
- 1920x1080 >> 1080p
|
||||||
@@ -106,6 +96,7 @@ After that, you can configure the theme as shown below. In this example it is in
|
|||||||
- Place your custom background inside the root of the project, and name it `background.jpg`
|
- Place your custom background inside the root of the project, and name it `background.jpg`
|
||||||
- Run the installer like normal, but with -s `[YOUR_RESOLUTION]` and -t `[THEME]` and -i `[ICON]`
|
- Run the installer like normal, but with -s `[YOUR_RESOLUTION]` and -t `[THEME]` and -i `[ICON]`
|
||||||
- Make sure to replace `[YOUR_RESOLUTION]` with your resolution and `[THEME]` with the theme
|
- Make sure to replace `[YOUR_RESOLUTION]` with your resolution and `[THEME]` with the theme
|
||||||
|
- Alternatively, use the `-c` option to set a custom resolution
|
||||||
|
|
||||||
## Contributing:
|
## Contributing:
|
||||||
- If you made changes to icons, or added a new one:
|
- If you made changes to icons, or added a new one:
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
grub2-mkfont -o unifont-16.pf2 -s 16 unifont.otf
|
||||||
|
grub2-mkfont -o unifont-24.pf2 -s 24 unifont.otf
|
||||||
|
grub2-mkfont -o unifont-32.pf2 -s 32 unifont.otf
|
||||||
|
Before Width: | Height: | Size: 976 B |
|
Before Width: | Height: | Size: 952 B |
|
Before Width: | Height: | Size: 963 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 963 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 952 B |
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 14"
|
terminal-font: "Terminus Regular 14"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 18"
|
terminal-font: "Terminus Regular 18"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
@@ -19,7 +19,7 @@ terminal-border: "0"
|
|||||||
top = 30%
|
top = 30%
|
||||||
width = 40%
|
width = 40%
|
||||||
height = 40%
|
height = 40%
|
||||||
item_font = "DejaVu Sans Regular 24"
|
item_font = "Unifont Regular 24"
|
||||||
item_color = "#cccccc"
|
item_color = "#cccccc"
|
||||||
selected_item_color = "#ffffff"
|
selected_item_color = "#ffffff"
|
||||||
icon_width = 48
|
icon_width = 48
|
||||||
@@ -48,5 +48,5 @@ terminal-border: "0"
|
|||||||
id = "__timeout__"
|
id = "__timeout__"
|
||||||
text = "Booting in %d seconds"
|
text = "Booting in %d seconds"
|
||||||
color = "#cccccc"
|
color = "#cccccc"
|
||||||
font = "DejaVu Sans Regular 24"
|
font = "Unifont Regular 24"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 18"
|
terminal-font: "Terminus Regular 18"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
@@ -19,7 +19,7 @@ terminal-border: "0"
|
|||||||
top = 30%
|
top = 30%
|
||||||
width = 40%
|
width = 40%
|
||||||
height = 40%
|
height = 40%
|
||||||
item_font = "DejaVu Sans Regular 32"
|
item_font = "Unifont Regular 32"
|
||||||
item_color = "#cccccc"
|
item_color = "#cccccc"
|
||||||
selected_item_color = "#ffffff"
|
selected_item_color = "#ffffff"
|
||||||
icon_width = 64
|
icon_width = 64
|
||||||
@@ -48,5 +48,5 @@ terminal-border: "0"
|
|||||||
id = "__timeout__"
|
id = "__timeout__"
|
||||||
text = "Booting in %d seconds"
|
text = "Booting in %d seconds"
|
||||||
color = "#cccccc"
|
color = "#cccccc"
|
||||||
font = "DejaVu Sans Regular 32"
|
font = "Unifont Regular 32"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 14"
|
terminal-font: "Terminus Regular 14"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ desktop-image: "background.jpg"
|
|||||||
desktop-color: "#000000"
|
desktop-color: "#000000"
|
||||||
terminal-font: "Terminus Regular 18"
|
terminal-font: "Terminus Regular 18"
|
||||||
terminal-box: "terminal_box_*.png"
|
terminal-box: "terminal_box_*.png"
|
||||||
terminal-left: "0"
|
#terminal-left: "0"
|
||||||
terminal-top: "0"
|
#terminal-top: "0"
|
||||||
terminal-width: "100%"
|
terminal-width: "100%"
|
||||||
terminal-height: "100%"
|
terminal-height: "100%"
|
||||||
terminal-border: "0"
|
terminal-border: "0"
|
||||||
@@ -19,7 +19,7 @@ terminal-border: "0"
|
|||||||
top = 30%
|
top = 30%
|
||||||
width = 40%
|
width = 40%
|
||||||
height = 40%
|
height = 40%
|
||||||
item_font = "DejaVu Sans Regular 24"
|
item_font = "Unifont Regular 24"
|
||||||
item_color = "#cccccc"
|
item_color = "#cccccc"
|
||||||
selected_item_color = "#ffffff"
|
selected_item_color = "#ffffff"
|
||||||
icon_width = 48
|
icon_width = 48
|
||||||
@@ -48,5 +48,5 @@ terminal-border: "0"
|
|||||||
id = "__timeout__"
|
id = "__timeout__"
|
||||||
text = "Booting in %d seconds"
|
text = "Booting in %d seconds"
|
||||||
color = "#cccccc"
|
color = "#cccccc"
|
||||||
font = "DejaVu Sans Regular 24"
|
font = "Unifont Regular 24"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,21 +30,33 @@
|
|||||||
grub2-theme = pkgs.stdenv.mkDerivation {
|
grub2-theme = pkgs.stdenv.mkDerivation {
|
||||||
name = "grub2-theme";
|
name = "grub2-theme";
|
||||||
src = "${self}";
|
src = "${self}";
|
||||||
|
buildInputs = [ pkgs.imagemagick ];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/grub/themes;
|
mkdir -p $out/grub/themes
|
||||||
|
|
||||||
|
# Create placeholder terminal box PNGs that install.sh expects
|
||||||
|
mkdir -p common
|
||||||
|
for box in c e n ne nw s se sw w; do
|
||||||
|
touch common/terminal_box_$box.png
|
||||||
|
done
|
||||||
|
|
||||||
|
# Run the install script
|
||||||
bash ./install.sh \
|
bash ./install.sh \
|
||||||
--generate $out/grub/themes \
|
--generate $out/grub/themes \
|
||||||
--screen ${cfg.screen} \
|
--screen ${cfg.screen} \
|
||||||
--theme ${cfg.theme} \
|
--theme ${cfg.theme} \
|
||||||
--icon ${cfg.icon};
|
--icon ${cfg.icon} \
|
||||||
|
${if cfg.customResolution != null then "--custom-resolution ${cfg.customResolution}" else ""}
|
||||||
|
|
||||||
if [ -n "${splashImage}" ]; then
|
if [ -n "${splashImage}" ]; then
|
||||||
rm $out/grub/themes/${cfg.theme}/background.jpg;
|
rm $out/grub/themes/${cfg.theme}/background.jpg;
|
||||||
${pkgs.imagemagick}/bin/convert ${splashImage} $out/grub/themes/${cfg.theme}/background.jpg;
|
${pkgs.imagemagick}/bin/magick ${splashImage} $out/grub/themes/${cfg.theme}/background.jpg;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ ${pkgs.lib.trivial.boolToString cfg.footer} == "false" ]; then
|
if [ ${pkgs.lib.trivial.boolToString cfg.footer} == "false" ]; then
|
||||||
sed -i ':again;$!N;$!b again; s/\+ image {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt;
|
sed -i ':again;$!N;$!b again; s/\+ image {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ ${pkgs.lib.trivial.boolToString hasBootMenuConfig} == "true" ]; then
|
if [ ${pkgs.lib.trivial.boolToString hasBootMenuConfig} == "true" ]; then
|
||||||
sed -i ':again;$!N;$!b again; s/\+ boot_menu {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt;
|
sed -i ':again;$!N;$!b again; s/\+ boot_menu {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt;
|
||||||
cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt
|
cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt
|
||||||
@@ -53,6 +65,7 @@
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ ${pkgs.lib.trivial.boolToString hasTerminalConfig} == "true" ]; then
|
if [ ${pkgs.lib.trivial.boolToString hasTerminalConfig} == "true" ]; then
|
||||||
sed -i 's/^terminal-.*$//g' $out/grub/themes/${cfg.theme}/theme.txt
|
sed -i 's/^terminal-.*$//g' $out/grub/themes/${cfg.theme}/theme.txt
|
||||||
cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt
|
cat << EOF >> $out/grub/themes/${cfg.theme}/theme.txt
|
||||||
@@ -61,7 +74,9 @@
|
|||||||
fi;
|
fi;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
resolution = resolutions."${cfg.screen}";
|
resolution = if cfg.customResolution != null
|
||||||
|
then cfg.customResolution
|
||||||
|
else resolutions."${cfg.screen}";
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
options = {
|
options = {
|
||||||
@@ -98,6 +113,15 @@
|
|||||||
The screen resolution to use for grub2.
|
The screen resolution to use for grub2.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
customResolution = mkOption {
|
||||||
|
default = null;
|
||||||
|
example = "1600x900";
|
||||||
|
type = types.nullOr (types.strMatching "[0-9]+x[0-9]+");
|
||||||
|
description = ''
|
||||||
|
Custom resolution for grub2 theme. Should be in the format "WIDTHxHEIGHT".
|
||||||
|
If set, this will override the 'screen' option.
|
||||||
|
'';
|
||||||
|
};
|
||||||
splashImage = mkOption {
|
splashImage = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
example = "/my/path/background.jpg";
|
example = "/my/path/background.jpg";
|
||||||
@@ -138,19 +162,17 @@
|
|||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
grub2-theme
|
grub2-theme
|
||||||
];
|
];
|
||||||
boot.loader.grub =
|
boot.loader.grub = {
|
||||||
{
|
theme = "${grub2-theme}/grub/themes/${cfg.theme}";
|
||||||
theme = "${grub2-theme}/grub/themes/${cfg.theme}";
|
splashImage = "${grub2-theme}/grub/themes/${cfg.theme}/background.jpg";
|
||||||
splashImage =
|
gfxmodeEfi = "${resolution},auto";
|
||||||
"${grub2-theme}/grub/themes/${cfg.theme}/background.jpg";
|
gfxmodeBios = "${resolution},auto";
|
||||||
gfxmodeEfi = "${resolution},auto";
|
extraConfig = ''
|
||||||
gfxmodeBios = "${resolution},auto";
|
insmod gfxterm
|
||||||
extraConfig = ''
|
insmod png
|
||||||
insmod gfxterm
|
set icondir=($root)/theme/icons
|
||||||
insmod png
|
'';
|
||||||
set icondir=($root)/theme/icons
|
};
|
||||||
'';
|
|
||||||
};
|
|
||||||
}]);
|
}]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ REO_DIR="$(cd $(dirname $0) && pwd)"
|
|||||||
THEME_VARIANTS=('tela' 'vimix' 'stylish' 'whitesur')
|
THEME_VARIANTS=('tela' 'vimix' 'stylish' 'whitesur')
|
||||||
ICON_VARIANTS=('color' 'white' 'whitesur')
|
ICON_VARIANTS=('color' 'white' 'whitesur')
|
||||||
SCREEN_VARIANTS=('1080p' '2k' '4k' 'ultrawide' 'ultrawide2k')
|
SCREEN_VARIANTS=('1080p' '2k' '4k' 'ultrawide' 'ultrawide2k')
|
||||||
|
custom_resolution=""
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# :::::: C O L O R S :::::: #
|
# :::::: C O L O R S :::::: #
|
||||||
@@ -62,15 +63,16 @@ cat << EOF
|
|||||||
Usage: $0 [OPTION]...
|
Usage: $0 [OPTION]...
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
-t, --theme theme variant(s) [tela|vimix|stylish|whitesur] (default is tela)
|
-t, --theme theme variant(s) [tela|vimix|stylish|whitesur] (default is tela)
|
||||||
-i, --icon icon variant(s) [color|white|whitesur] (default is color)
|
-i, --icon icon variant(s) [color|white|whitesur] (default is color)
|
||||||
-s, --screen screen display variant(s) [1080p|2k|4k|ultrawide|ultrawide2k] (default is 1080p)
|
-s, --screen screen display variant(s) [1080p|2k|4k|ultrawide|ultrawide2k] (default is 1080p)
|
||||||
-r, --remove Remove theme [tela|vimix|stylish|whitesur] (must add theme name option, default is tela)
|
-c, --custom-resolution set custom resolution (e.g., 1600x900) (disabled in default)
|
||||||
|
-r, --remove remove theme [tela|vimix|stylish|whitesur] (must add theme name option, default is tela)
|
||||||
|
|
||||||
-b, --boot install theme into '/boot/grub' or '/boot/grub2'
|
-b, --boot install theme into '/boot/grub' or '/boot/grub2'
|
||||||
-g, --generate do not install but generate theme into chosen directory (must add your directory)
|
-g, --generate do not install but generate theme into chosen directory (must add your directory)
|
||||||
|
|
||||||
-h, --help Show this help
|
-h, --help show this help
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@@ -95,18 +97,53 @@ generate() {
|
|||||||
prompt -i "\n Installing ${theme} ${icon} ${screen} theme..."
|
prompt -i "\n Installing ${theme} ${icon} ${screen} theme..."
|
||||||
|
|
||||||
# Don't preserve ownership because the owner will be root, and that causes the script to crash if it is ran from terminal by sudo
|
# Don't preserve ownership because the owner will be root, and that causes the script to crash if it is ran from terminal by sudo
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/common/"{*.png,*.pf2} "${THEME_DIR}/${theme}"
|
cp -a --no-preserve=ownership "${REO_DIR}/common/"*.pf2 "${THEME_DIR}/${theme}"
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${theme}/theme.txt"
|
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${theme}/theme.txt"
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
||||||
|
|
||||||
# Use custom background.jpg as grub background image
|
# Function to determine which assets to use based on resolution
|
||||||
if [[ -f "${REO_DIR}/background.jpg" ]]; then
|
get_asset_type() {
|
||||||
prompt -w "\n Using custom background.jpg as grub background image..."
|
local width=$(echo $1 | cut -d'x' -f1)
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/background.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
local height=$(echo $1 | cut -d'x' -f2)
|
||||||
convert -auto-orient "${THEME_DIR}/${theme}/background.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
if [ $width -le 1920 ] && [ $height -le 1080 ]; then
|
||||||
|
echo "1080p"
|
||||||
|
elif [ $width -le 2560 ] && [ $height -le 1440 ]; then
|
||||||
|
echo "2k"
|
||||||
|
else
|
||||||
|
echo "4k"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Determine which configuration file and assets to use
|
||||||
|
if [[ -n "$custom_resolution" ]]; then
|
||||||
|
install_depends ImageMagick
|
||||||
|
asset_type=$(get_asset_type "$custom_resolution")
|
||||||
|
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${asset_type}.txt" "${THEME_DIR}/${theme}/theme.txt"
|
||||||
|
# Replace resolution in theme.txt
|
||||||
|
sed -i "s/[0-9]\+x[0-9]\+/${custom_resolution}/" "${THEME_DIR}/${theme}/theme.txt"
|
||||||
|
# Use appropriate background as base and resize it
|
||||||
|
cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${asset_type}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
||||||
|
magick "${THEME_DIR}/${theme}/background.jpg" -resize ${custom_resolution}^ -gravity center -extent ${custom_resolution} "${THEME_DIR}/${theme}/background.jpg"
|
||||||
|
else
|
||||||
|
cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${theme}/theme.txt"
|
||||||
|
cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${screen} == 'ultrawide' ]]; then
|
# Use custom background.jpg as grub background image
|
||||||
|
if [[ -f "${REO_DIR}/background.jpg" ]]; then
|
||||||
|
install_depends ImageMagick
|
||||||
|
prompt -w "\n Using custom background.jpg as grub background image..."
|
||||||
|
cp -a --no-preserve=ownership "${REO_DIR}/background.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
||||||
|
magick -auto-orient "${THEME_DIR}/${theme}/background.jpg" "${THEME_DIR}/${theme}/background.jpg"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Determine which assets to use based on custom resolution or screen
|
||||||
|
if [[ -n "$custom_resolution" ]]; then
|
||||||
|
asset_type=$(get_asset_type "$custom_resolution")
|
||||||
|
cp -a --no-preserve=ownership "${REO_DIR}/assets/assets-${icon}/icons-${asset_type}" "${THEME_DIR}/${theme}/icons"
|
||||||
|
cp -a --no-preserve=ownership "${REO_DIR}/assets/assets-select/select-${asset_type}/"*.png "${THEME_DIR}/${theme}"
|
||||||
|
cp -a --no-preserve=ownership "${REO_DIR}/assets/info-${asset_type}.png" "${THEME_DIR}/${theme}/info.png"
|
||||||
|
elif [[ ${screen} == 'ultrawide' ]]; then
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/assets/assets-${icon}/icons-1080p" "${THEME_DIR}/${theme}/icons"
|
cp -a --no-preserve=ownership "${REO_DIR}/assets/assets-${icon}/icons-1080p" "${THEME_DIR}/${theme}/icons"
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/assets/assets-select/select-1080p/"*.png "${THEME_DIR}/${theme}"
|
cp -a --no-preserve=ownership "${REO_DIR}/assets/assets-select/select-1080p/"*.png "${THEME_DIR}/${theme}"
|
||||||
cp -a --no-preserve=ownership "${REO_DIR}/assets/info-1080p.png" "${THEME_DIR}/${theme}/info.png"
|
cp -a --no-preserve=ownership "${REO_DIR}/assets/info-1080p.png" "${THEME_DIR}/${theme}/info.png"
|
||||||
@@ -178,15 +215,14 @@ install() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if grep "GRUB_BACKGROUND=" /etc/default/grub 2>&1 >/dev/null; then
|
if grep "GRUB_BACKGROUND=" /etc/default/grub 2>&1 >/dev/null; then
|
||||||
#Replace GRUB_BACKGROUND
|
# remove GRUB_BACKGROUND
|
||||||
sed -i "s|.*GRUB_BACKGROUND=.*|GRUB_BACKGROUND=\"${THEME_DIR}/${theme}/background.jpg\"|" /etc/default/grub
|
sed -i "s|.*GRUB_BACKGROUND=.*||" /etc/default/grub
|
||||||
else
|
|
||||||
#Append GRUB_BACKGROUND
|
|
||||||
echo "GRUB_BACKGROUND=\"${THEME_DIR}/${theme}/background.jpg\"" >> /etc/default/grub
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure the right resolution for grub is set
|
# Make sure the right resolution for grub is set
|
||||||
if [[ ${screen} == '1080p' ]]; then
|
if [[ -n "$custom_resolution" ]]; then
|
||||||
|
gfxmode="GRUB_GFXMODE=${custom_resolution},auto"
|
||||||
|
elif [[ ${screen} == '1080p' ]]; then
|
||||||
gfxmode="GRUB_GFXMODE=1920x1080,auto"
|
gfxmode="GRUB_GFXMODE=1920x1080,auto"
|
||||||
elif [[ ${screen} == 'ultrawide' ]]; then
|
elif [[ ${screen} == 'ultrawide' ]]; then
|
||||||
gfxmode="GRUB_GFXMODE=2560x1080,auto"
|
gfxmode="GRUB_GFXMODE=2560x1080,auto"
|
||||||
@@ -230,10 +266,18 @@ install() {
|
|||||||
|
|
||||||
#Check if password is cached (if cache timestamp has not expired yet)
|
#Check if password is cached (if cache timestamp has not expired yet)
|
||||||
elif sudo -n true 2> /dev/null && echo; then
|
elif sudo -n true 2> /dev/null && echo; then
|
||||||
if [[ "${install_boot}" == 'true' ]]; then
|
if [[ -n "$custom_resolution" ]]; then
|
||||||
sudo "$0" -t ${theme} -i ${icon} -s ${screen} -b
|
if [[ "${install_boot}" == 'true' ]]; then
|
||||||
|
sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution} -b
|
||||||
|
else
|
||||||
|
sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution}
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
sudo "$0" -t ${theme} -i ${icon} -s ${screen}
|
if [[ "${install_boot}" == 'true' ]]; then
|
||||||
|
sudo "$0" -t ${theme} -i ${icon} -s ${screen} -b
|
||||||
|
else
|
||||||
|
sudo "$0" -t ${theme} -i ${icon} -s ${screen}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
#Ask for password
|
#Ask for password
|
||||||
@@ -244,16 +288,30 @@ install() {
|
|||||||
else
|
else
|
||||||
sudo -S $0 -t ${theme} -i ${icon} -s ${screen} <<< ${tui_root_login}
|
sudo -S $0 -t ${theme} -i ${icon} -s ${screen} <<< ${tui_root_login}
|
||||||
fi
|
fi
|
||||||
|
elif [[ -n "$custom_resolution" ]]; then
|
||||||
|
if [[ "${install_boot}" == 'true' ]]; then
|
||||||
|
sudo -S $0 -t ${theme} -i ${icon} -c ${custom_resolution} -b <<< ${tui_root_login}
|
||||||
|
else
|
||||||
|
sudo -S $0 -t ${theme} -i ${icon} -c ${custom_resolution} <<< ${tui_root_login}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
prompt -e "\n [ Error! ] -> Run me as root! "
|
prompt -e "\n [ Error! ] -> Run me as root! "
|
||||||
read -r -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s
|
read -r -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s
|
||||||
if sudo -S echo <<< $REPLY 2> /dev/null && echo; then
|
if sudo -S echo <<< $REPLY 2> /dev/null && echo; then
|
||||||
#Correct password, use with sudo's stdin
|
#Correct password, use with sudo's stdin
|
||||||
if [[ "${install_boot}" == 'true' ]]; then
|
if [[ -n "$custom_resolution" ]]; then
|
||||||
sudo -S "$0" -t ${theme} -i ${icon} -s ${screen} -b <<< ${REPLY}
|
if [[ "${install_boot}" == 'true' ]]; then
|
||||||
|
sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution} -b <<< ${REPLY}
|
||||||
|
else
|
||||||
|
sudo "$0" -t ${theme} -i ${icon} -c ${custom_resolution} <<< ${REPLY}
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
sudo -S "$0" -t ${theme} -i ${icon} -s ${screen} <<< ${REPLY}
|
if [[ "${install_boot}" == 'true' ]]; then
|
||||||
|
sudo "$0" -t ${theme} -i ${icon} -s ${screen} -b <<< ${REPLY}
|
||||||
|
else
|
||||||
|
sudo "$0" -t ${theme} -i ${icon} -s ${screen} <<< ${REPLY}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
#block for 3 seconds before allowing another attempt
|
#block for 3 seconds before allowing another attempt
|
||||||
@@ -354,14 +412,21 @@ updating_grub() {
|
|||||||
grub2-mkconfig -o /boot/grub2/grub.cfg
|
grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||||
# Check for Fedora (regular or Atomic)
|
# Check for Fedora (regular or Atomic)
|
||||||
elif has_command dnf || has_command rpm-ostree; then
|
elif has_command dnf || has_command rpm-ostree; then
|
||||||
# Check for UEFI
|
|
||||||
if [[ -f /boot/efi/EFI/fedora/grub.cfg ]]; then
|
|
||||||
prompt -s "Find config file on /boot/efi/EFI/fedora/grub.cfg ...\n"
|
|
||||||
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
|
|
||||||
# Check for BIOS
|
# Check for BIOS
|
||||||
elif [[ -f /boot/grub2/grub.cfg ]]; then
|
if [[ -f /boot/grub2/grub.cfg ]]; then
|
||||||
prompt -s "Find config file on /boot/grub2/grub.cfg ...\n"
|
prompt -s "Find config file on /boot/grub2/grub.cfg ...\n"
|
||||||
grub2-mkconfig -o /boot/grub2/grub.cfg
|
grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||||
|
# Check for UEFI
|
||||||
|
elif [[ -f /boot/efi/EFI/fedora/grub.cfg ]]; then
|
||||||
|
prompt -s "Find config file on /boot/efi/EFI/fedora/grub.cfg ...\n"
|
||||||
|
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f /boot/grub2/grub.cfg && -f /boot/efi/EFI/fedora/grub.cfg ]]; then
|
||||||
|
prompt -w "\n Under EFI, GRUB2 looks for its configuration in /boot/efi/EFI/fedora/grub.cfg,\n however the postinstall script of grub2-common installs a small shim which chains to the standard configuration at /boot/grub2/grub.cfg which is generated above.\n To reset this shim to defaults, delete the existing /boot/efi/EFI/fedora/grub.cfg and then reinstall grub2-common."
|
||||||
|
|
||||||
|
prompt -i "\n sudo rm -f /boot/efi/EFI/fedora/grub.cfg"
|
||||||
|
prompt -i "sudo dnf reinstall grub2-common"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -383,10 +448,12 @@ function install_program () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
install_dialog() {
|
install_depends() {
|
||||||
if [ ! "$(which dialog 2> /dev/null)" ]; then
|
local depend=${1}
|
||||||
prompt -w "\n 'dialog' need to be installed for this shell"
|
|
||||||
install_program "dialog"
|
if [ ! "$(which '${depend}' 2> /dev/null)" ]; then
|
||||||
|
prompt -w "\n '${depend}' need to be installed for this shell"
|
||||||
|
install_program "${depend}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +560,7 @@ dialog_installer() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
install_dialog
|
install_depends dialog
|
||||||
fi
|
fi
|
||||||
run_dialog
|
run_dialog
|
||||||
install "${theme}" "${icon}" "${screen}"
|
install "${theme}" "${icon}" "${screen}"
|
||||||
@@ -645,6 +712,11 @@ while [[ $# -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
-c|--custom-resolution)
|
||||||
|
shift
|
||||||
|
custom_resolution="$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||