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.
This commit is contained in:
Sealgair
2024-12-27 19:55:43 +10:00
parent a8e5eef11c
commit ca635bb2f9
2 changed files with 57 additions and 0 deletions

26
install_linux.nu Executable file
View File

@ -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

31
install_linux.sh Executable file
View File

@ -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