Whiptail based software intaller for Ubuntu based systems
CLI tool for installing whatever software you like with (somewhat) ease
You can check if a software, cli tool, package, whatever... is installed via these functions:
check_package()
(viadpkg
)check_file()
check_directory()
check_command()
(viacommand
)
You can place your software by adding them to the associative array software_check
located in includes/software.sh
:
- The
key
is the package name (lower-kebab-case) - The
value
is how the script will check the installation status of the software (see step above)
local nvm_dir="${HOME}/.config/nvm"
software_check[neofetch]='check_package'
software_check[nvm]="check_directory '${nvm_dir}'"
Note: Surround the variable with single quotes
'${var}'
in case the string contains spaces
You can install your software calling the following functions inside installation()
located in includes/software.sh
and the help of an associative array called $is_installed
:
$is_installed
is an associative array with the installation status of every software you add in the previous step
Syntax
$1
: Human-readable name of the package$2
: Name of the package$3
: Installed?
Example
install_standard "Yakuake" "yakuake" "${is_installed[yakuake]}"
Syntax
$1
: Human-readable name of the package$2
: Name of the package$3
: PPA$4
: Installed?
Example
install_PPA "GIT" "git" "ppa:git-core/ppa" "${is_installed[git]}"
Syntax
$1
: Human-readable name of the package$2
: URL of DEB file$3
: Installed?
Example
local code_url="https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64"
install_deb "VSCode" "${code_url}" "${is_installed[code]}"
You can place custom installation processes in the include/custom.sh
script.
- Create a function with the following name structure:
install_<name-kebab-case>()
- Use the
install_anki()
function as an example. - Add your software name to the list
- Place your newly created function in the
installation()
function# Anki install_anki "${is_installed[anki]}"
include/software.sh
check_software() {
local nvm_dir="${HOME}/.config/nvm"
software_check[neofetch]='check_package'
software_check[nvm]="check_directory '${nvm_dir}'"
software_check[qbittorrent]='check_package'
software_check[code]='check_package'
#...
}
installation() {
# ...
# neofetch (System Info)
install_standard "neofetch" "neofetch (System Info)" "${is_installed[neofetch]}"
# qBitorrent
install_PPA "qbittorrent" "qBittorrent" "ppa:qbittorrent-team/qbittorrent-stable" "${is_installed[qbittorrent]}"
# VSCode
local code_url="https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64"
install_deb "VSCode" "${code_url}" "${is_installed[code]}"
# Custom installation
# nvm
install_nvm "${is_installed[nvm]}"
}
include/custom.sh
install_nvm(){
if $1; then return; fi
if (! whiptail --title '🚀 nvm 🚀' --yesno "Do you want to install 'nvm'?" --defaultno 9 60); then
whiptail --title '❌ nvm ❌' --msgbox "Installation canceled" 9 60
fi
__log_separator__ 'nvm'
# ...
whiptail --title "✅ nvm ✅" --msgbox "Installation completed" 9 60
}