about summary refs log tree commit diff
path: root/install.sh
diff options
context:
space:
mode:
authorWeirdTreeThing <bradyn127@protonmail.com>2023-09-04 07:00:00 -0400
committerGitHub <noreply@github.com>2023-09-04 07:00:00 -0400
commitf4a8df729c47a8494a287ffccc4523c1642119b2 (patch)
tree3313e3904e26e56315a8c36a2bd760b5dbce7e46 /install.sh
parent2291f57e91dfb63362fea8903d6e411937e39e7c (diff)
parent31b2a6cdf9342078ffbc97fcf65cb44af3b735e3 (diff)
Merge pull request #1 from CoolPenguin27/main
add check if keyd is already installed
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh70
1 files changed, 37 insertions, 33 deletions
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