Skip to content

Commit

Permalink
New interactive install.sh (bobafetthotmail#6)
Browse files Browse the repository at this point in the history
* Make a new interactive installer script
- rewrite install.sh
- change src/theme.conf to fit with new install.sh
- update README.md

* Change instruction order in README to reduce copy size
  • Loading branch information
Suchit Kar authored and StevenCoburn committed Apr 19, 2024
1 parent b130901 commit a8468c5
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 102 deletions.
84 changes: 0 additions & 84 deletions Install.sh

This file was deleted.

31 changes: 19 additions & 12 deletions README.md
Expand Up @@ -13,11 +13,11 @@ NOTE: this is a fork of munlik's theme since he seems to have abandoned his proj

### Installation [Quick]:

1. Just paste this command in your terminal.
1. Just paste this command in your terminal and enter your choices.
```
bash <(curl -s https://raw.githubusercontent.com/bobafetthotmail/refind-theme-regular/master/Install.sh)
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/diddypod/refind-theme-regular/master/install.sh)"
```
2. To adjust icon size, font size, background color and selector color edit `theme.conf`.
2. To further adjust icon size, font size, background color and selector color edit `theme.conf`.

```
sudo nano /boot/efi/EFI/refind/refind-theme-regular/theme.conf
Expand All @@ -30,7 +30,15 @@ NOTE: this is a fork of munlik's theme since he seems to have abandoned his proj
git clone https://github.com/bobafetthotmail/refind-theme-regular.git
```

2. Locate refind directory under EFI partition. For most Linux based system is commonly `/boot/efi/EFI/refind/`. Copy theme directory to it.
2. Remove unused directories and files.
```
sudo rm -rf refind-theme-regular/{src,.git}
```
```
sudo rm refind-theme-regular/install.sh
```

3. Locate refind directory under EFI partition. For most Linux based system is commonly `/boot/efi/EFI/refind/`. Copy theme directory to it.

**Important:** Delete older installed versions of this theme before you proceed any further.

Expand All @@ -40,24 +48,23 @@ NOTE: this is a fork of munlik's theme since he seems to have abandoned his proj
```
sudo cp -r refind-theme-regular /boot/efi/EFI/refind/
```
3. Remove unused directory.
```
sudo rm -rf /boot/efi/EFI/refind/refind-theme-regular/{src,.git}
```

4. To adjust icon size, font size, background color and selector color edit `theme.conf`.
```
sudo nano /boot/efi/EFI/refind/refind-theme-regular/theme.conf
```

5. To enable the theme add `include refind-theme-regular/theme.conf` at the end of `refind.conf`.
5. To enable the theme add `include refind-theme-regular/theme.conf` at the end of `refind.conf`, and comment out or delete any other themes you might have installed.
```
sudo nano /boot/efi/EFI/refind/refind.conf
```

**NOTE**: If your not geting your full resolution or have color issues then try disabling the CSM in your UEFI settings.

### Contribute new icons:

0. fork this repository on github and then git clone your fork of this repository in your Linux system
0. Fork this repository on github and then git clone your fork of this repository in your Linux system

1. The icons must be in svg format to allow easy generation of icons at any scale, canvas size must have width and height 128 px for OS icons, or 48 px for tool icons. The actual icon in the svg file should roughly fit in a square with a side of 96 px or 20 px (for OS and tool icons, respectively). Inkscape is a good program to create and work with svg files.

Expand All @@ -67,9 +74,9 @@ NOTE: this is a fork of munlik's theme since he seems to have abandoned his proj

4. cd in the ./src directory and run the script ./render_bitmap.sh that will process the svg files and generate the png files at various sizes.

5. copy the png icons you generated from their /src/bitmap subfolder into the appropriate /icons subfolders for their size by running ./copy-bitmap.sh
5. Copy the png icons you generated from their /src/bitmap subfolder into the appropriate /icons subfolders for their size by running ./copy-bitmap.sh

6. commit your changes, upload to your fork and then open a PR.
6. Commit your changes, upload to your fork and then open a PR.

**More information**

Expand Down
151 changes: 151 additions & 0 deletions install.sh
@@ -0,0 +1,151 @@
#!/bin/sh

# An installer for refind-theme-regular by Munlik

#Check if root
[[ $EUID -ne 0 ]] && echo "This script must be run as root." && exit 1

clear

#Clone the theme
echo -n "Downloading rEFInd theme Regular to $PWD"
git clone https://github.com/diddypod/refind-theme-regular.git &> /dev/null
echo " - [DONE]"

#Useful formatting tags
bold=$(tput bold)
normal=$(tput sgr0)

#Set install path
echo "Enter rEFInd install location"
read -e -p "Default - ${bold}/boot/efi/EFI/refind/${normal}: " location
if test -z "$location";
then
location="/boot/efi/EFI/refind/"
fi
if test "${location: -1}" != "/"
then
location="$location/"
fi

#Set icon size
echo "Pick an icon size: (larger icons look better on bigger and denser displays)"
read -p "${bold}1: small (128px-48px)${normal}, 2: medium (256px-96px), 3: large (384px-144px), 4: extra-large (512px-192px): " size_select
if test -z "$size_select";
then
size_select=1
fi
case "$size_select" in
1)
size_big="128"
size_small="48"
break
;;
2)
size_big="256"
size_small="96"
break
;;
3)
size_big="384"
size_small="144"
break
;;
4)
size_big="512"
size_small="192"
break
;;
*)
echo "Incorrect choice. Exiting."
exit 1
;;
esac
echo "Selected size - big icons: $size_big px, small icons: $size_small px"

#Set theme color
echo "Select a theme color"
read -p "${bold}1: light${normal}, 2: dark: " theme_select
if test -z "$theme_select";
then
theme_select=1
fi
case "$theme_select" in
1)
theme_name="light"
theme_path=""
break
;;
2)
theme_name="dark"
theme_path="_dark"
break
;;
*)
echo "Incorrect choice. Exiting."
exit 1
;;
esac
echo "Selected theme - $theme_name"

#Uncomment relevant lines from src/theme.conf
echo -n "Generating theme file theme.conf"
cd refind-theme-regular
cp src/theme.conf theme.conf
sed -i "s/#icons_dir refind-theme-regular\/icons\/$size_big-$size_small/icons_dir refind-theme-regular\/icons\/$size_big-$size_small/" theme.conf
sed -i "s/#big_icon_size $size_big/big_icon_size $size_big/" theme.conf
sed -i "s/#small_icon_size $size_small/small_icon_size $size_small/" theme.conf
sed -i "s/#banner refind-theme-regular\/icons\/$size_big-$size_small\/bg$theme_path.png/banner refind-theme-regular\/icons\/$size_big-$size_small\/bg$theme_path.png/" theme.conf
sed -i "s/#selection_big refind-theme-regular\/icons\/$size_big-$size_small\/selection$theme_path-big.png/selection_big refind-theme-regular\/icons\/$size_big-$size_small\/selection$theme_path-big.png/" theme.conf
sed -i "s/#selection_small refind-theme-regular\/icons\/$size_big-$size_small\/selection$theme_path-small.png/selection_small refind-theme-regular\/icons\/$size_big-$size_small\/selection$theme_path-small.png/" theme.conf
cd ..
echo " - [DONE]"

#Clean up
echo -n "Removing unused directories"
rm -rf refind-theme-regular/{src,.git}
rm -rf refind-theme-regular/install.sh
echo " - [DONE]"

#Remove previous installs
echo -n "Deleting older installed versions (if any)"
rm -rf "$location"{regular-theme,refind-theme-regular}
echo " - [DONE]"

#Copy theme setup folders
echo -n "Copying theme to $location"
cp -r refind-theme-regular "$location"
echo " - [DONE]"

#Edit refind.conf - remove older themes
echo -n "Removing old themes from refind.conf"
sed --in-place=".bak" 's/^\s*include/# (disabled) include/' "$location"refind.conf
echo " - [DONE]"

#Edit refind.conf - add new theme
echo -n "Updating refind.conf"
echo "
# Load rEFInd theme Regular
include refind-theme-regular/theme.conf" | tee -a "$location"refind.conf &> /dev/null
echo " - [DONE]"

#Clean up - remove download
read -p "Delete download? (${bold}Y${normal}/n): " del_confirm
if test -z "$del_confirm";
then
del_confirm="y"
fi
case "$del_confirm" in
y|Y)
echo -n "Deleting download"
rm -r refind-theme-regular
echo " - [DONE]"
break
;;
*)
break
;;
esac

echo "Thank you for installing rEFInd theme Regular."
echo "NOTE: If your not geting your full resolution or have color issues then try disabling the CSM in your UEFI settings."
12 changes: 6 additions & 6 deletions src/theme.conf
Expand Up @@ -2,26 +2,26 @@

#ICON

icons_dir refind-theme-regular/icons/128-48
#icons_dir refind-theme-regular/icons/128-48
#icons_dir refind-theme-regular/icons/256-96
#icons_dir refind-theme-regular/icons/384-144
#icons_dir refind-theme-regular/icons/512-192

#ICON SIZE

big_icon_size 128
#big_icon_size 128
#big_icon_size 256
#big_icon_size 384
#big_icon_size 512

small_icon_size 48
#small_icon_size 48
#small_icon_size 96
#small_icon_size 144
#small_icon_size 192

#BACKGROUND IMAGE

banner refind-theme-regular/icons/128-48/bg.png
#banner refind-theme-regular/icons/128-48/bg.png
#banner refind-theme-regular/icons/256-96/bg.png
#banner refind-theme-regular/icons/384-144/bg.png
#banner refind-theme-regular/icons/512-192/bg.png
Expand All @@ -32,7 +32,7 @@ banner refind-theme-regular/icons/128-48/bg.png

#SELECTION IMAGE

selection_big refind-theme-regular/icons/128-48/selection-big.png
#selection_big refind-theme-regular/icons/128-48/selection-big.png
#selection_big refind-theme-regular/icons/256-96/selection-big.png
#selection_big refind-theme-regular/icons/384-144/selection-big.png
#selection_big refind-theme-regular/icons/512-192/selection-big.png
Expand All @@ -41,7 +41,7 @@ selection_big refind-theme-regular/icons/128-48/selection-big.png
#selection_big refind-theme-regular/icons/384-144/selection_dark-big.png
#selection_big refind-theme-regular/icons/512-192/selection_dark-big.png

selection_small refind-theme-regular/icons/128-48/selection-small.png
#selection_small refind-theme-regular/icons/128-48/selection-small.png
#selection_small refind-theme-regular/icons/256-96/selection-small.png
#selection_small refind-theme-regular/icons/384-144/selection-small.png
#selection_small refind-theme-regular/icons/512-192/selection-small.png
Expand Down

0 comments on commit a8468c5

Please sign in to comment.