NoSignal-OS/os updates/screenshots/install-screenshots.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

58 lines
2.3 KiB
Bash
Executable file

#!/bin/sh
# install-screenshots.sh — Print = region screenshot; all screenshots saved to
# ~/Pictures/Screenshots AND copied to clipboard. Idempotent.
#
# - nosignal-screenshot -> ~/.local/bin
# - swappy save_dir -> ~/Pictures/Screenshots (caelestia region/freeze
# binds pipe into swappy; this makes them save there)
# - hypr-user.conf binds: Print = region, Super+Print = full screen
# (the stock Print = full-screen-to-clipboard bind is unbound first)
set -eu
SRC=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
BIN="$HOME/.local/bin"
HYPRUSER="$HOME/.config/caelestia/hypr-user.conf"
SWAPPY="$HOME/.config/swappy/config"
PICS="${XDG_PICTURES_DIR:-$HOME/Pictures}/Screenshots"
MARK='nosignal screenshots'
mkdir -p "$BIN" "$PICS"
install -m 0755 "$SRC/nosignal-screenshot" "$BIN/nosignal-screenshot"
# swappy save dir (only write if absent or previously written by us; don't
# clobber a user's hand-tuned config).
if [ ! -f "$SWAPPY" ] || grep -q "NoSignal: make swappy" "$SWAPPY"; then
mkdir -p "$(dirname "$SWAPPY")"
cp "$SRC/swappy-config" "$SWAPPY"
echo ":: swappy save_dir -> $PICS"
else
echo ":: swappy config already customised — left as-is (set save_dir to $PICS yourself if wanted)"
fi
# Hyprland binds.
if [ ! -f "$HYPRUSER" ]; then
echo "NOTE: $HYPRUSER not found — add the Print binds manually."
elif grep -q "$MARK" "$HYPRUSER"; then
echo ":: binds already present in $HYPRUSER"
else
cat >> "$HYPRUSER" <<'EOF'
# >>> nosignal screenshots >>>
# Print = select a region (crosshair) -> clipboard + ~/Pictures/Screenshots.
# Shift+Print = whole screen. Both also save a PNG; swappy (region/freeze
# binds) saves to the same folder. unbind removes the stock full-screen Print.
# (Super+Print stays the color picker / hyprpicker -a.)
unbind = , Print
bind = , Print, exec, nosignal-screenshot region # Screenshot: region
bind = SHIFT, Print, exec, nosignal-screenshot full # Screenshot: full screen
# <<< nosignal screenshots <<<
EOF
echo ":: appended Print/Super+Print screenshot binds -> $HYPRUSER"
fi
# 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. Print = region screenshot; saved to $PICS and copied to clipboard."