Skip to content

Commit 55b9d4d

Browse files
committed
Update install.sh for Pop_OS
1 parent 2e89128 commit 55b9d4d

File tree

1 file changed

+58
-45
lines changed

1 file changed

+58
-45
lines changed

install.sh

+58-45
Original file line numberDiff line numberDiff line change
@@ -20,53 +20,66 @@ echo "Installing/Updating Ghostty..."
2020
source /etc/os-release
2121
ARCH=$(dpkg --print-architecture)
2222

23-
if [ "$ID" = "ubuntu" ]; then
24-
if [[ "$VERSION_ID" =~ ^(24.10|24.04)$ ]]; then
25-
SUFFIX="${ARCH}_${VERSION_ID}"
26-
else
27-
echo "This installer is not compatible with Ubuntu $VERSION_ID"
28-
exit 1
29-
fi
30-
elif [ "$ID" = "debian" ]; then
31-
if [ "$VERSION_CODENAME" = "bookworm" ]; then
32-
SUFFIX="${ARCH}_${VERSION_CODENAME}"
33-
else
34-
echo "This installer is not compatible with Debian $VERSION_CODENAME"
35-
exit 1
36-
fi
37-
elif [ "$ID" = "kali" ]; then
38-
# Map Kali versions to Debian codenames
39-
declare -A KALI_TO_DEBIAN=(
40-
["2023"]="bookworm"
41-
["2024"]="bookworm"
42-
)
43-
KALI_YEAR=$(echo "$VERSION_ID" | cut -d'.' -f1)
44-
DEBIAN_CODENAME=${KALI_TO_DEBIAN[$KALI_YEAR]}
45-
if [ -z "$DEBIAN_CODENAME" ]; then
46-
echo "This installer is not compatible with Kali Linux $VERSION_ID"
47-
exit 1
48-
fi
49-
SUFFIX="${ARCH}_${DEBIAN_CODENAME}"
50-
elif [ "$ID" = "linuxmint" ]; then
51-
declare -A SUPPORTED_VERSIONS=(
52-
["oracular"]="24.10"
53-
["noble"]="24.04"
54-
)
23+
case "$ID" in
24+
ubuntu|pop)
25+
if [[ "$VERSION_ID" =~ ^(24.10|24.04)$ ]]; then
26+
SUFFIX="${ARCH}_${VERSION_ID}"
27+
else
28+
echo "This installer is not compatible with Ubuntu $VERSION_ID"
29+
exit 1
30+
fi
31+
;;
32+
33+
debian)
34+
if [ "$VERSION_CODENAME" = "bookworm" ]; then
35+
SUFFIX="${ARCH}_${VERSION_CODENAME}"
36+
else
37+
echo "This installer is not compatible with Debian $VERSION_CODENAME"
38+
exit 1
39+
fi
40+
;;
41+
42+
kali)
43+
# Map Kali versions to Debian codenames
44+
declare -A KALI_TO_DEBIAN=(
45+
["2023"]="bookworm"
46+
["2024"]="bookworm"
47+
)
48+
KALI_YEAR=$(echo "$VERSION_ID" | cut -d'.' -f1)
49+
DEBIAN_CODENAME=${KALI_TO_DEBIAN[$KALI_YEAR]}
50+
if [ -z "$DEBIAN_CODENAME" ]; then
51+
echo "This installer is not compatible with Kali Linux $VERSION_ID"
52+
exit 1
53+
fi
54+
SUFFIX="${ARCH}_${DEBIAN_CODENAME}"
55+
;;
56+
57+
linuxmint)
58+
declare -A SUPPORTED_VERSIONS=(
59+
["oracular"]="24.10"
60+
["noble"]="24.04"
61+
)
5562

56-
if [[ -n "${SUPPORTED_VERSIONS[$UBUNTU_CODENAME]}" ]]; then
57-
SUFFIX="${ARCH}_${SUPPORTED_VERSIONS[$UBUNTU_CODENAME]}"
58-
else
59-
echo "This installer is not compatible with Linux Mint $VERSION"
63+
if [[ -n "${SUPPORTED_VERSIONS[$UBUNTU_CODENAME]}" ]]; then
64+
SUFFIX="${ARCH}_${SUPPORTED_VERSIONS[$UBUNTU_CODENAME]}"
65+
else
66+
echo "This installer is not compatible with Linux Mint $VERSION"
67+
exit 1
68+
fi
69+
;;
70+
71+
*)
72+
echo "This install script is not compatible with $ID."
73+
echo "If this distribution is based on Ubuntu, you can open an issue to add support to the install script."
74+
echo "https://github.com/mkasberg/ghostty-ubuntu/issues/new?template=Blank+issue"
75+
echo ""
76+
echo "Please run 'cat /etc/os-release' and include the output in the issue on GitHub."
77+
echo ""
78+
echo "In the mean time, you can try manually installing the correct .deb file."
6079
exit 1
61-
fi
62-
else
63-
echo "This install script is not compatible with $ID."
64-
echo "If this distribution is based on Ubuntu, you can open an issue to add support to the install script."
65-
echo "https://github.com/mkasberg/ghostty-ubuntu/issues/new?template=Blank+issue"
66-
echo ""
67-
echo "In the mean time, you can try manually installing the correct .deb file."
68-
exit 1
69-
fi
80+
;;
81+
esac
82+
7083

7184
GHOSTTY_DEB_URL=$(
7285
curl -s https://api.github.com/repos/mkasberg/ghostty-ubuntu/releases/latest | \

0 commit comments

Comments
 (0)