From ca635bb2f9d9121274c52580adecf5675a1215df Mon Sep 17 00:00:00 2001 From: Sealgair Date: Fri, 27 Dec 2024 19:55:43 +1000 Subject: [PATCH] Linux: Added install scripts for bash and nushell Added two scripts to help users install ghostty before it's available from a user's preferred package manager. --- install_linux.nu | 26 ++++++++++++++++++++++++++ install_linux.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 install_linux.nu create mode 100755 install_linux.sh diff --git a/install_linux.nu b/install_linux.nu new file mode 100755 index 000000000..d44e6148b --- /dev/null +++ b/install_linux.nu @@ -0,0 +1,26 @@ +#!/usr/bin/env nu + +# Check if running as root +if ((id -u | into int) != 0) { + echo "Please run as root (sudo)" + exit 1 +} + +# Build and install (errors will automatically cause exit in nu) +zig build -Doptimize=ReleaseFast --prefix /usr install + +# Create desktop entry +$"[Desktop Entry] +Version=1.0 +Type=Application +Name=ghostty +Comment=Ghostty is a terminal emulator that differentiates itself by being fast, feature-rich, and native. +Exec=/usr/bin/ghostty +Categories=Development; +Terminal=false" | save --force /usr/share/applications/ghostty.desktop + +# Set proper permissions +chmod 644 /usr/share/applications/ghostty.desktop + +# Update desktop database +update-desktop-database /usr/share/applications diff --git a/install_linux.sh b/install_linux.sh new file mode 100755 index 000000000..53fd8601f --- /dev/null +++ b/install_linux.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Exit on any error +set -e + +# Check if running as root +if [ "$EUID" -ne 0 ]; then + echo "Please run as root (sudo)" + exit 1 +fi + +# Build and install +zig build -Doptimize=ReleaseFast --prefix /usr install + +# Create desktop entry +cat > /usr/share/applications/ghostty.desktop << 'EOL' +[Desktop Entry] +Version=1.0 +Type=Application +Name=ghostty +Comment=Ghostty is a terminal emulator that differentiates itself by being fast, feature-rich, and native. +Exec=/usr/bin/ghostty +Categories=Development; +Terminal=false +EOL + +# Set perms +chmod 644 /usr/share/applications/ghostty.desktop + +# Update desktop database +update-desktop-database /usr/share/applications