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