mirror of
https://github.com/Lissy93/dotfiles.git
synced 2025-02-16 15:09:12 +01:00
Updates notification options, and passes params to install scripts
This commit is contained in:
parent
5fdf94386a
commit
47d9a140ef
35
install.sh
35
install.sh
@ -5,6 +5,7 @@
|
|||||||
######################################################################
|
######################################################################
|
||||||
# Fetches latest changes, symlinks files, and installs dependencies #
|
# Fetches latest changes, symlinks files, and installs dependencies #
|
||||||
# Then sets up ZSH, TMUX, Vim as well as OS-specific tools and apps #
|
# Then sets up ZSH, TMUX, Vim as well as OS-specific tools and apps #
|
||||||
|
# Checks all dependencies are met, and prompts to install if missing #
|
||||||
# For docs and more info, see: https://github.com/lissy93/dotfiles #
|
# For docs and more info, see: https://github.com/lissy93/dotfiles #
|
||||||
# #
|
# #
|
||||||
# IMPORTANT: Before running, read through everything very carefully! #
|
# IMPORTANT: Before running, read through everything very carefully! #
|
||||||
@ -101,12 +102,12 @@ make_intro () {
|
|||||||
cleanup () {
|
cleanup () {
|
||||||
# Reset tab color and title (iTerm2 only)
|
# Reset tab color and title (iTerm2 only)
|
||||||
echo -e "\033];\007\033]6;1;bg;*;default\a"
|
echo -e "\033];\007\033]6;1;bg;*;default\a"
|
||||||
|
Arch
|
||||||
# Unset re-used variables
|
# Unset re-used variables
|
||||||
unset PROMPT_TIMEOUT
|
unset PROMPT_TIMEOUT
|
||||||
unset AUTO_YES
|
unset AUTO_YES
|
||||||
|
|
||||||
# dino
|
# dinosaurs are awesome
|
||||||
echo "🦖"
|
echo "🦖"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,6 +135,20 @@ system_verify () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Shows a desktop notification, on compatible systems ($1 = message)
|
||||||
|
show_notification () {
|
||||||
|
if [[ $PARAMS == *"--no-notifications"* ]]; then return; fi
|
||||||
|
notif_title=$TITLE
|
||||||
|
notif_logo="${DOTFILES_DIR}/.github/logo.png"
|
||||||
|
if command_exists terminal-notifier; then
|
||||||
|
terminal-notifier -group 'dotfiles' -title $notif_title -subtitle $1 \
|
||||||
|
-message $2 -appIcon $notif_logo -contentImage $notif_logo \
|
||||||
|
-remove 'ALL' -sound 'Sosumi' &> /dev/null
|
||||||
|
elif command_exists notify-send; then
|
||||||
|
notify-send -u normal -t 15000 -i "${notif_logo}" "${notif_title}" "${1}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Prints welcome banner, verifies that requirements are met
|
# Prints welcome banner, verifies that requirements are met
|
||||||
function pre_setup_tasks () {
|
function pre_setup_tasks () {
|
||||||
# Show pretty starting banner
|
# Show pretty starting banner
|
||||||
@ -150,7 +165,8 @@ function pre_setup_tasks () {
|
|||||||
echo -e "\n${CYAN_B}Are you happy to continue? (y/N)${RESET}"
|
echo -e "\n${CYAN_B}Are you happy to continue? (y/N)${RESET}"
|
||||||
read -t $PROMPT_TIMEOUT -n 1 -r ans_start
|
read -t $PROMPT_TIMEOUT -n 1 -r ans_start
|
||||||
if [[ ! $ans_start =~ ^[Yy]$ ]] && [[ $AUTO_YES != true ]] ; then
|
if [[ ! $ans_start =~ ^[Yy]$ ]] && [[ $AUTO_YES != true ]] ; then
|
||||||
echo -e "\n${PURPLE}No worries, feel free to come back another time.\nTerminating...${RESET}"
|
echo -e "\n${PURPLE}No worries, feel free to come back another time."\
|
||||||
|
"\nTerminating...${RESET}"
|
||||||
make_banner "🚧 Installation Aborted" ${YELLOW_B} 1
|
make_banner "🚧 Installation Aborted" ${YELLOW_B} 1
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@ -326,13 +342,13 @@ function install_packages () {
|
|||||||
# Arch Linux
|
# Arch Linux
|
||||||
arch_pkg_install_script="${DOTFILES_DIR}/scripts/installs/arch-pacman.sh"
|
arch_pkg_install_script="${DOTFILES_DIR}/scripts/installs/arch-pacman.sh"
|
||||||
chmod +x $arch_pkg_install_script
|
chmod +x $arch_pkg_install_script
|
||||||
$arch_pkg_install_script $params
|
$arch_pkg_install_script $PARAMS
|
||||||
fi
|
fi
|
||||||
# If running in Linux desktop mode, prompt to install desktop apps via Flatpak
|
# If running in Linux desktop mode, prompt to install desktop apps via Flatpak
|
||||||
flatpak_script="${DOTFILES_DIR}/scripts/installs/flatpak.sh"
|
flatpak_script="${DOTFILES_DIR}/scripts/installs/flatpak.sh"
|
||||||
if [[ $(uname -s) == "Linux" ]] && [ ! -z $XDG_CURRENT_DESKTOP ] && [ -f $flatpak_script ]; then
|
if [[ $SYSTEM_TYPE == "Linux" ]] && [ ! -z $XDG_CURRENT_DESKTOP ] && [ -f $flatpak_script ]; then
|
||||||
chmod +x $flatpak_script
|
chmod +x $flatpak_script
|
||||||
$flatpak_script
|
$flatpak_script $PARAMS
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,12 +374,7 @@ function finishing_up () {
|
|||||||
SKIP_WELCOME=true || exec zsh
|
SKIP_WELCOME=true || exec zsh
|
||||||
|
|
||||||
# Show popup
|
# Show popup
|
||||||
if command_exists terminal-notifier; then
|
show_notification "All Tasks Complete" "Your dotfiles are now configured and ready to use 🥳"
|
||||||
terminal-notifier -group 'dotfiles' -title $TITLE -subtitle 'All Tasks Complete' \
|
|
||||||
-message "Your dotfiles are now configured and ready to use 🥳" \
|
|
||||||
-appIcon ./.github/logo.png -contentImage ./.github/logo.png \
|
|
||||||
-remove 'ALL' -sound 'Sosumi' &> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Show press any key to exit
|
# Show press any key to exit
|
||||||
echo -e "${CYAN_B}Press any key to exit.${RESET}\n"
|
echo -e "${CYAN_B}Press any key to exit.${RESET}\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user