From 31b2a6cdf9342078ffbc97fcf65cb44af3b735e3 Mon Sep 17 00:00:00 2001 From: SuperPenguin34 <108895116+CoolPenguin27@users.noreply.github.com> Date: Sun, 3 Sep 2023 22:56:10 -0700 Subject: add check if keyd is already installed --- install.sh | 70 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 33 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 21a65c9..f5aff2d 100755 --- a/install.sh +++ b/install.sh @@ -15,40 +15,44 @@ elif [ -f /usr/bin/apk ]; then distro="alpine" fi -echo "Installing keyd dependencies" -case $distro in - deb) - sudo apt install -y build-essential git - ;; - arch) - sudo pacman -S --noconfirm base-devel git - ;; - fedora) - sudo dnf groupinstall -y "Development Tools" "Development Libraries" - ;; -esac -echo "Installing keyd" -case $distro in - suse) - sudo zypper --non-interactive install keyd - ;; - arch) - git clone https://aur.archlinux.org/keyd.git - cd keyd - makepkg -si --noconfirm - ;; - alpine) - doas apk add --no-interactive keyd - ;; - *) - git clone https://github.com/rvaiya/keyd - cd keyd - make - sudo make install - cd .. - ;; -esac +if ! [ -f /usr/bin/keyd ]; then + # if keyd isnt installed + echo "Installing keyd dependencies" + case $distro in + deb) + sudo apt install -y build-essential git + ;; + arch) + sudo pacman -S --noconfirm base-devel git + ;; + fedora) + sudo dnf groupinstall -y "Development Tools" "Development Libraries" + ;; + esac + + echo "Installing keyd" + case $distro in + suse) + sudo zypper --non-interactive install keyd + ;; + arch) + git clone https://aur.archlinux.org/keyd.git + cd keyd + makepkg -si --noconfirm + ;; + alpine) + doas apk add --no-interactive keyd + ;; + *) + git clone https://github.com/rvaiya/keyd + cd keyd + make + sudo make install + cd .. + ;; + esac +fi echo "Generating config" python3 cros-keyboard-map.py -- cgit 1.4.1-2-gfad0