NoSignal-OS/os updates/install-keybinds-help.sh
28allday 19fd794b6b NoSignal — fully-offline Arch → Hyprland desktop installer
Single-script builder (nosignal.sh) that turns a stock Arch Linux ISO into a
fully-offline installer for a themed Hyprland + caelestia (Quickshell) desktop:
matching SDDM greeter, Btrfs/Limine bootable snapshots, chwd-style GPU
detection, and a curated "os updates" layer (keybind cheatsheet, settings
panels, system polish, on-box management skill). See README.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 11:03:10 +01:00

55 lines
2 KiB
Bash
Executable file

#!/bin/sh
# install-keybinds-help.sh — install the NoSignal on-screen keybinding cheatsheet.
#
# This component lives entirely in this folder (Downloads) so it survives a
# system wipe. Run this after rebuilding to put the pieces back in place:
# - nosignal-keybinds-gen, nosignal-keybinds -> ~/.local/bin/
# - NoSignal-keybindings.md (source of truth) -> ~/.local/share/nosignal/
# - Super+/ and Super+F1 binds -> ~/.config/caelestia/hypr-user.conf
#
# Safe to re-run (idempotent). Deps: awk, fuzzel, optional wl-copy.
set -eu
SRC=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
BIN="$HOME/.local/bin"
SHARE="$HOME/.local/share/nosignal"
HYPRUSER="$HOME/.config/caelestia/hypr-user.conf"
mkdir -p "$BIN" "$SHARE"
install -m 0755 "$SRC/nosignal-keybinds-gen" "$BIN/nosignal-keybinds-gen"
install -m 0755 "$SRC/nosignal-keybinds" "$BIN/nosignal-keybinds"
echo "installed scripts -> $BIN"
# Canonical copy of the single source of truth, so the help works even if the
# Downloads doc is later moved/removed.
if [ -f "$SRC/NoSignal-keybindings.md" ]; then
cp "$SRC/NoSignal-keybindings.md" "$SHARE/NoSignal-keybindings.md"
echo "installed keymap doc -> $SHARE/NoSignal-keybindings.md"
fi
# Add the binds, only if not already present.
if [ -f "$HYPRUSER" ]; then
if grep -q 'nosignal-keybinds' "$HYPRUSER"; then
echo "binds already present in $HYPRUSER"
else
printf '\n' >> "$HYPRUSER"
cat "$SRC/hyprland-keybinds-help.conf" >> "$HYPRUSER"
echo "appended binds -> $HYPRUSER"
fi
else
echo "NOTE: $HYPRUSER not found — add the lines from hyprland-keybinds-help.conf to your Hyprland user config."
fi
# PATH sanity.
case ":$PATH:" in
*":$BIN:"*) ;;
*) echo "NOTE: $BIN is not on PATH — add it (e.g. in ~/.bash_profile)." ;;
esac
# Apply immediately if Hyprland is running.
if command -v hyprctl >/dev/null 2>&1 && hyprctl version >/dev/null 2>&1; then
hyprctl reload >/dev/null 2>&1 && echo "reloaded Hyprland"
fi
echo "Done. Press Super+/ to open the cheatsheet."