#!/bin/bash # program that prompts the user to install a package if it is not already installed if [ "$1" == -i ]; then if ! [ -e /tmp/instantinstalllist ]; then echo "no install list found" exit fi while read p; do echo "installing $p" yay -S --needed --noconfirm "$p" done >/tmp/instantinstalllist INSTALLPACKAGES="true" if ! checkinternet; then imenu -e "internet is required to install packages" exit 1 fi done if [ -n "$INSTALLPACKAGES" ]; then echo "running terminal emulator" # install packages in a terminal emulator st -e "bash" -c "instantinstall -i" fi for i in $@; do checkpackage "$i" || exit 1 done