From 27932d2fba5362fe2f8fe5d13e70d1072868504d Mon Sep 17 00:00:00 2001 From: paperbenni Date: Mon, 26 Oct 2020 20:38:36 +0100 Subject: [PATCH 1/1] rewrite instantinstall --- programs/instantinstall | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/programs/instantinstall b/programs/instantinstall index 7259662..b3a9caf 100755 --- a/programs/instantinstall +++ b/programs/instantinstall @@ -1,7 +1,24 @@ -#!/usr/bin/dash +#!/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" + imenu -e "internet is required to install packages" exit 1 fi done if [ -n "$INSTALLPACKAGES" ] then - echo "running command: yay -S --needed --noconfirm $@; sleep 2; exit" - st -e "bash" -c "yay -S --needed --noconfirm $@; sleep 2; exit" + 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 -- 2.11.0