Compare commits
6 Commits
2019_08_24
...
2019-10-01
Author | SHA1 | Date | |
---|---|---|---|
fa55fb3a81 | |||
1e8660bcce | |||
e666d78bf4 | |||
fdba42467a | |||
8da9d44f6e | |||
90a5dcb2e4 |
@ -21,8 +21,14 @@ Usage: `sudo ./install.sh` **[OPTIONS...]**
|
||||
| -s, --stylish | Stylish grub theme |
|
||||
| -t, --tela | Tela grub theme |
|
||||
| -l, --slaze | Slaze grub theme |
|
||||
| -2, --2k | Install 2k(2560x1440) background image |
|
||||
| -4, --4k | Install 4k(3840x2160) background image |
|
||||
| -h, --help | Show this help |
|
||||
|
||||
For example: `Install Tela theme on 2k display device`
|
||||
|
||||
sudo ./install -t -2
|
||||
|
||||
## Screenshots
|
||||
|
||||
### Vimix grub theme
|
||||
|
BIN
assets/assets-tela/icons/endeavouros.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 61 KiB |
@ -24,6 +24,7 @@ solus
|
||||
kaos
|
||||
void
|
||||
macosx
|
||||
endeavouros
|
||||
recovery
|
||||
restart
|
||||
shutdown
|
||||
|
BIN
assets/assets-white/icons/endeavouros.png
Normal file
After Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 59 KiB |
@ -23,6 +23,7 @@ lubuntu
|
||||
solus
|
||||
kaos
|
||||
macosx
|
||||
endeavouros
|
||||
recovery
|
||||
restart
|
||||
shutdown
|
||||
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 161 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 189 KiB |
BIN
backgrounds/2k/background-stylish.jpg
Normal file
After Width: | Height: | Size: 139 KiB |
BIN
backgrounds/2k/background-tela.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
backgrounds/2k/background-vimix.jpg
Normal file
After Width: | Height: | Size: 193 KiB |
BIN
backgrounds/4k/background-stylish.jpg
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
backgrounds/4k/background-tela.jpg
Normal file
After Width: | Height: | Size: 358 KiB |
BIN
backgrounds/4k/background-vimix.jpg
Normal file
After Width: | Height: | Size: 619 KiB |
66
install.sh
@ -6,7 +6,7 @@ ROOT_UID=0
|
||||
THEME_DIR="/boot/grub/themes"
|
||||
THEME_DIR_2="/boot/grub2/themes"
|
||||
|
||||
REO_DIR=$(cd $(dirname $0) && pwd)
|
||||
REO_DIR="$(cd $(dirname $0) && pwd)"
|
||||
|
||||
MAX_DELAY=20 # max delay for user to enter root password
|
||||
|
||||
@ -51,6 +51,8 @@ usage() {
|
||||
printf " %-25s%s\n" "-s, --stylish" "stylish grub theme"
|
||||
printf " %-25s%s\n" "-t, --tela" "tela grub theme"
|
||||
printf " %-25s%s\n" "-v, --vimix" "vimix grub theme"
|
||||
printf " %-25s%s\n" "-2, --2k" "Install 2k(2560x1440) background image"
|
||||
printf " %-25s%s\n" "-4, --24" "Install 4k(3840x2160) background image"
|
||||
printf " %-25s%s\n" "-h, --help" "Show this help"
|
||||
}
|
||||
|
||||
@ -64,47 +66,57 @@ install() {
|
||||
elif [[ ${theme} == 'vimix' ]]; then
|
||||
local name="Vimix"
|
||||
else
|
||||
prompt -i "\n Run sudo ./install.sh again! or run ./install.sh -h for help"
|
||||
prompt -i "\n Run ./install.sh -h for help or install dialog"
|
||||
install_dialog
|
||||
prompt -i "\n Run ./install.sh again!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ ${screen} == '2k' ]]; then
|
||||
local screen="2k"
|
||||
elif [[ ${screen} == '4k' ]]; then
|
||||
local screen="4k"
|
||||
else
|
||||
local screen="1080p"
|
||||
fi
|
||||
|
||||
# Checking for root access and proceed if it is present
|
||||
if [ "$UID" -eq "$ROOT_UID" ]; then
|
||||
|
||||
# Create themes directory if not exists
|
||||
echo -e "\n Checking for the existence of themes directory..."
|
||||
|
||||
[[ -d ${THEME_DIR}/${name} ]] && rm -rf ${THEME_DIR}/${name}
|
||||
[[ -d ${THEME_DIR_2}/${name} ]] && rm -rf ${THEME_DIR_2}/${name}
|
||||
[[ -d /boot/grub ]] && mkdir -p ${THEME_DIR}/${name}
|
||||
[[ -d /boot/grub2 ]] && mkdir -p ${THEME_DIR_2}/${name}
|
||||
[[ -d "${THEME_DIR}/${name}" ]] && rm -rf "${THEME_DIR}/${name}"
|
||||
[[ -d "${THEME_DIR_2}/${name}" ]] && rm -rf "${THEME_DIR_2}/${name}"
|
||||
[[ -d /boot/grub ]] && mkdir -p "${THEME_DIR}/${name}"
|
||||
[[ -d /boot/grub2 ]] && mkdir -p "${THEME_DIR_2}/${name}"
|
||||
|
||||
# Copy theme
|
||||
prompt -i "\n Installing ${name} theme..."
|
||||
prompt -i "\n Installing ${name} ${screen} theme..."
|
||||
|
||||
if [ -d /boot/grub ]; then
|
||||
cp -a ${REO_DIR}/common/* ${THEME_DIR}/${name}
|
||||
cp -a ${REO_DIR}/backgrounds/background-${theme}.jpg ${THEME_DIR}/${name}/background.jpg
|
||||
cp -a "${REO_DIR}/common/"* "${THEME_DIR}/${name}"
|
||||
cp -a "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${name}/background.jpg"
|
||||
|
||||
if [ ${theme} == 'tela' ]; then
|
||||
cp -a ${REO_DIR}/assets/assets-tela/icons ${THEME_DIR}/${name}
|
||||
cp -a ${REO_DIR}/assets/assets-tela/select/*.png ${THEME_DIR}/${name}
|
||||
cp -a "${REO_DIR}/assets/assets-tela/icons" "${THEME_DIR}/${name}"
|
||||
cp -a "${REO_DIR}/assets/assets-tela/select/"*.png "${THEME_DIR}/${name}"
|
||||
else
|
||||
cp -a ${REO_DIR}/assets/assets-white/icons ${THEME_DIR}/${name}
|
||||
cp -a ${REO_DIR}/assets/assets-white/select/*.png ${THEME_DIR}/${name}
|
||||
cp -a "${REO_DIR}/assets/assets-white/icons" "${THEME_DIR}/${name}"
|
||||
cp -a "${REO_DIR}/assets/assets-white/select/"*.png "${THEME_DIR}/${name}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d /boot/grub2 ]; then
|
||||
cp -a ${REO_DIR}/common/* ${THEME_DIR_2}/${name}
|
||||
cp -a ${REO_DIR}/backgrounds/background-${theme}.jpg ${THEME_DIR_2}/${name}/background.jpg
|
||||
cp -a "${REO_DIR}/common/"* "${THEME_DIR_2}/${name}"
|
||||
cp -a "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR_2}/${name}/background.jpg"
|
||||
|
||||
if [ ${theme} == 'tela' ]; then
|
||||
cp -a ${REO_DIR}/assets/assets-tela/icons ${THEME_DIR_2}/${name}
|
||||
cp -a ${REO_DIR}/assets/assets-tela/select/*.png ${THEME_DIR_2}/${name}
|
||||
cp -a "${REO_DIR}/assets/assets-tela/icons" "${THEME_DIR_2}/${name}"
|
||||
cp -a "${REO_DIR}/assets/assets-tela/select/"*.png "${THEME_DIR_2}/${name}"
|
||||
else
|
||||
cp -a ${REO_DIR}/assets/assets-white/icons ${THEME_DIR_2}/${name}
|
||||
cp -a ${REO_DIR}/assets/assets-white/select/*.png ${THEME_DIR_2}/${name}
|
||||
cp -a "${REO_DIR}/assets/assets-white/icons" "${THEME_DIR_2}/${name}"
|
||||
cp -a "${REO_DIR}/assets/assets-white/select/*".png "${THEME_DIR_2}/${name}"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -112,6 +124,10 @@ install() {
|
||||
prompt -i "\n Setting ${name} as default..."
|
||||
grep "GRUB_THEME=" /etc/default/grub 2>&1 >/dev/null && sed -i '/GRUB_THEME=/d' /etc/default/grub
|
||||
|
||||
# Backup grub config
|
||||
cp -an /etc/default/grub /etc/default/grub.bak
|
||||
|
||||
# Edit grub config
|
||||
[[ -d /boot/grub ]] && echo "GRUB_THEME=\"${THEME_DIR}/${name}/theme.txt\"" >> /etc/default/grub
|
||||
[[ -d /boot/grub2 ]] && echo "GRUB_THEME=\"${THEME_DIR_2}/${name}/theme.txt\"" >> /etc/default/grub
|
||||
|
||||
@ -131,7 +147,7 @@ install() {
|
||||
|
||||
else
|
||||
# Error message
|
||||
prompt -e "\n [ Error!] -> Run me as root "
|
||||
prompt -e "\n [ Error! ] -> Run me as root "
|
||||
|
||||
# persisted execution of the script as root
|
||||
read -p "[ trusted ] specify the root password : " -t${MAX_DELAY} -s
|
||||
@ -193,7 +209,7 @@ fi
|
||||
|
||||
if [[ $# -lt 1 ]] && [[ $UID -ne $ROOT_UID ]]; then
|
||||
# Error message
|
||||
prompt -e "\n [ Error!] -> Run me as root "
|
||||
prompt -e "\n [ Error! ] -> Run me as root "
|
||||
|
||||
# persisted execution of the script as root
|
||||
read -p "[ trusted ] specify the root password : " -t${MAX_DELAY} -s
|
||||
@ -219,6 +235,12 @@ while [[ $# -ge 1 ]]; do
|
||||
-v|--vimix)
|
||||
theme='vimix'
|
||||
;;
|
||||
-2|--2k)
|
||||
screen='2k'
|
||||
;;
|
||||
-4|--4k)
|
||||
screen='4k'
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
@ -232,6 +254,6 @@ while [[ $# -ge 1 ]]; do
|
||||
shift
|
||||
done
|
||||
|
||||
install_dialog && install
|
||||
install
|
||||
|
||||
exit 0
|
||||
|