#!/bin/sh # curl pipes the script on stdin; reopen the terminal for confirmations. { [ -t 0 ] || { if ! (: /dev/null; then echo "init: no controlling terminal; run init.sh from an interactive terminal" >&2 exit 2 fi exec &2 exit 2 } require_commands() { missing="" for command in "$@"; do if ! command -v "$command" >/dev/null 2>&1; then missing="$missing $command" fi done [ -z "$missing" ] || die "missing prerequisites:$missing" } short_host() { host=$(hostname -s 2>/dev/null || uname -n) printf '%s\n' "${host%%.*}" } distro_id() { [ -r "$OS_RELEASE" ] || return 0 ( # shellcheck disable=SC1090 . "$OS_RELEASE" printf '%s\n' "${ID:-}" ) } [ "$(id -u)" -ne 0 ] || die "refusing to run as root; run init.sh as your user" HOST=$(short_host) if [ "$HOST" = archlinux ]; then die "hostname is still 'archlinux'; set it first: sudo hostnamectl set-hostname " fi if [ ! -e "$REPO" ]; then command -v git >/dev/null 2>&1 || die "missing prerequisite: git; install it with: sudo pacman -S --needed git" git clone "$REPO_URL" "$REPO" else echo "Leaving existing $REPO unchanged." fi cat </dev/null 2>&1 || die "missing prerequisite: dms; aconf.sh apply should install dms-shell" dms setup || die "dms setup failed or was aborted" [ -d "$HOME/.config/hypr" ] || die "dms setup completed without creating a Hyprland configuration" fi fi require_commands awk bash curl fish git jq python3 (cd "$REPO" && ./install.sh) cat <