diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a760406 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +*.AppImage +*.tar.gz + +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ diff --git a/assets/1.png b/assets/1.png index 713fdcc..7d27b04 100644 Binary files a/assets/1.png and b/assets/1.png differ diff --git a/assets/2.png b/assets/2.png index 7c47d00..083bea9 100644 Binary files a/assets/2.png and b/assets/2.png differ diff --git a/assets/appimage.png b/assets/appimage.png index bb6a104..b3a84cd 100644 Binary files a/assets/appimage.png and b/assets/appimage.png differ diff --git a/assets/ghostty.appdata.xml b/assets/ghostty.appdata.xml new file mode 100644 index 0000000..723a1f5 --- /dev/null +++ b/assets/ghostty.appdata.xml @@ -0,0 +1,68 @@ + + + + com.mitchellh.ghostty + MIT + MIT + Ghostty + https://raw.githubusercontent.com/ghostty-org/ghostty/refs/heads/main/images/icons/icon_256.png + Fast, native, feature-rich terminal emulator pushing modern features + +

+ Ghostty is a terminal emulator that differentiates itself by being fast, + feature-rich, and native. While there are many excellent terminal + emulators available, they all force you to choose between speed, + features, or native UIs. Ghostty provides all three. +

+ +

+ In all categories, I am not trying to claim that Ghostty is the best + (i.e. the fastest, most feature-rich, or most native). But Ghostty is + competitive in all three categories and Ghostty doesn't make you choose + between them. +

+ +

+ Ghostty also intends to push the boundaries of what is possible with a + terminal emulator by exposing modern, opt-in features that enable CLI + tool developers to build more feature rich, interactive applications. +

+ +

+ While aiming for this ambitious goal, our first step is to make Ghostty + one of the best fully standards compliant terminal emulator, remaining + compatible with all existing shells and software while supporting all of + the latest terminal innovations in the ecosystem. You can use Ghostty as + a drop-in replacement for your existing terminal emulator. +

+
+ + com.mitchellh.ghostty.desktop + + https://ghostty.org/ + https://ghostty.org/docs/about + https://github.com/ghostty-org/ghostty/issues + + + + + Mitchell Hashimoto + + + + + +

+ Initial AppImage build. +

+
+
+
+
diff --git a/assets/ghostty.desktop b/assets/ghostty.desktop new file mode 100644 index 0000000..35aa68c --- /dev/null +++ b/assets/ghostty.desktop @@ -0,0 +1,22 @@ +[Desktop Entry] +Name=Ghostty +Type=Application +Comment=A terminal emulator +Exec=ghostty +Icon=com.mitchellh.ghostty +StartupWMClass=com.mitchellh.ghostty +Categories=System;TerminalEmulator;Utility; +Keywords=terminal;tty;pty; +StartupNotify=true +Terminal=false +Actions=new-window; +X-GNOME-UsesNotifications=true +X-TerminalArgExec=-e +X-TerminalArgTitle=--title= +X-TerminalArgAppId=--class= +X-TerminalArgDir=--working-directory= +X-TerminalArgHold=--wait-after-command + +[Desktop Action new-window] +Name=New Window +Exec=ghostty diff --git a/build.sh b/build.sh index 924e56d..bf4c02b 100755 --- a/build.sh +++ b/build.sh @@ -3,11 +3,25 @@ set -e export ARCH="$(uname -m)" + GHOSTTY_VERSION="1.0.1" + +# Detect latest version numbers when jq is available. +if command -v jq >/dev/null 2>&1; then + if [ "$1" = "latest" ]; then + GHOSTTY_VERSION="$( + curl -s https://api.github.com/repos/ghostty-org/ghostty/tags | + jq '[.[] | select(.name != "tip") | .name | ltrimstr("v")] | sort_by(split(".") | map(tonumber)) | last' + )" + fi +fi + TMP_DIR="/tmp/ghostty-build" APP_DIR="${TMP_DIR}/ghostty.AppDir" PUB_KEY="RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV" -UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync" +UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY:-no-user/no-repo}" | tr '/' '|')|latest|*$ARCH.AppImage.zsync" +APPDATA_FILE="${PWD}/assets/ghostty.appdata.xml" +DESKTOP_FILE="${PWD}/assets/ghostty.desktop" rm -rf "${TMP_DIR}" @@ -20,7 +34,7 @@ wget -q "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_ minisign -V -m "ghostty-${GHOSTTY_VERSION}.tar.gz" -P "${PUB_KEY}" -s "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" -rm ghostty-${GHOSTTY_VERSION}.tar.gz.minisig +rm "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" tar -xzmf "ghostty-${GHOSTTY_VERSION}.tar.gz" @@ -52,7 +66,7 @@ if ! mv ./usr/lib/ld-linux-x86-64.so.2 ./; then cp -v /lib64/ld-linux-x86-64.so.2 ./ fi -# prep appimage +# Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon. cat <<'EOF' >./AppRun #!/usr/bin/env sh @@ -66,33 +80,15 @@ EOF chmod +x AppRun -ln -s usr/share/applications/com.mitchellh.ghostty.desktop . -ln -s usr/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png . - -sed -i 's/;TerminalEmulator;/;TerminalEmulator;Utility;/' com.mitchellh.ghostty.desktop - -cat <<'EOF' >./usr/share/metainfo/com.mitchellh.ghostty.appdata.xml - - - - -

- 👻 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration. -

-
- - Mitchell Hashimoto - - https://raw.githubusercontent.com/ghostty-org/ghostty/refs/heads/main/images/icons/icon_256.png - com.mitchellh.ghostty - com.mitchellh.ghostty.desktop - MIT - Ghostty - MIT - A terminal emulator - https://ghostty.org -
-EOF +cp "${APPDATA_FILE}" "usr/share/metainfo/com.mitchellh.ghostty.appdata.xml" + +# Fix Gnome dock issues -- StartupWMClass attribute needs to be present. +cp "${DESKTOP_FILE}" "usr/share/applications/com.mitchellh.ghostty.desktop" +# WezTerm has this, it might be useful. +ln -s "com.mitchellh.ghostty.desktop" "usr/share/applications/ghostty.desktop" + +ln -s "usr/share/applications/com.mitchellh.ghostty.desktop" . +ln -s "usr/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" . cd "${TMP_DIR}" diff --git a/setup.sh b/setup.sh index df7422b..442a1e3 100755 --- a/setup.sh +++ b/setup.sh @@ -5,6 +5,22 @@ set -e export DEBIAN_FRONTEND="noninteractive" ZIG_VERSION="0.13.0" +MINISIGN_URL="https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz" + +# Detect latest version numbers when jq is available. +if command -v jq >/dev/null 2>&1; then + if [ "$1" = "latest" ]; then + ZIG_VERSION="$( + curl -s "https://ziglang.org/download/index.json" | + jq -r '[keys[] | select(. != "master" and contains("."))] | sort_by(split(".") | map(tonumber)) | last' + )" + MINISIGN_URL="$( + curl -s "https://api.github.com/repos/jedisct1/minisign/releases/latest" | + jq -r --arg prefix "minisign" --arg suffix "linux.tar.gz" \ + '.assets[] | select(.name | startswith($prefix) and endswith($suffix)) | .browser_download_url' + )" + fi +fi # update & install os base dependencies buildPkgs="build-essential libonig-dev libbz2-dev pandoc wget fuse libfuse2t64 file zsync appstream" @@ -17,8 +33,8 @@ wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/a install appimagetool-x86_64.AppImage /usr/local/bin/appimagetool # minisign: https://github.com/jedisct1/minisign -wget -q "https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz" -tar -xzf minisign-0.11-linux.tar.gz +wget -q "${MINISIGN_URL}" -O "minisign-linux.tar.gz" +tar -xzf "minisign-linux.tar.gz" mv minisign-linux/x86_64/minisign /usr/local/bin # zig: https://ziglang.org @@ -29,6 +45,6 @@ ln -s "/opt/zig-linux-x86_64-${ZIG_VERSION}/zig" /usr/local/bin/zig # cleanup rm -r \ "appimagetool-x86_64.AppImage" \ - "minisign-0.11-linux.tar.gz" \ + "minisign-linux.tar.gz" \ "minisign-linux" \ "zig-linux-x86_64-${ZIG_VERSION}.tar.xz"