From c7a9a5b399e350da3c9836006bb87330d8cdf0bf Mon Sep 17 00:00:00 2001 From: koksnuss Date: Tue, 29 May 2018 15:43:42 +0200 Subject: [PATCH] add check if i3 is installed --- install.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 0b771cb..dff6fb2 100644 --- a/install.sh +++ b/install.sh @@ -1,16 +1,19 @@ #!/bin/bash echo "" -echo "Installing i3blocks" -echo "Checking if i3blocks is installed" +echo "::: Installing i3blocks" +echo "::: Checking if i3 is installed" +i3 -v &> /dev/null +[[ $? -ne 0 ]] && echo "::: Please install i3 and restart this setup" && exit 1 +echo "::: Checking if i3blocks is installed" i3blocks -V &> /dev/null -[[ $? -ne 0 ]] && echo "Please install i3blocks first and restart this setup" && exit 1 -echo "Checking if the directory ~/.config/i3blocks already exists" +[[ $? -ne 0 ]] && echo "::: Please install i3blocks and restart this setup" && exit 1 +echo "::: Checking if the directory ~/.config/i3blocks already exists" [[ -d "$HOME/.config/i3blocks" ]] && echo "Moving ~/.config/i3blocks to ~/.config/i3blocks.bak" && mv "$HOME/.config/i3blocks"{,.bak} >/dev/null 2>/dev/null -echo "Downloading simple-i3blocks to ~/.config/i3blocks" +echo "::: Downloading simple-i3blocks to ~/.config/i3blocks" git clone https://will.kein.hk/git/koksnuss/simple-i3blocks.git ~/.config/i3blocks &> /dev/null cd "$HOME/.config/i3blocks/modules" -echo "Masking modules as execulatbles" +echo "::: Masking modules as execulatbles" chmod u+x audio backlight battery cpu datetime ip ram storage -echo "Finished, please reload i3. Normally you can do this with the shortcut MOD+SHIFT+R" +echo "::: Finished, please reload i3. Normally you can do this with the shortcut MOD+SHIFT+R" echo ""