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

45 lines
1.8 KiB
Bash
Executable file

#!/bin/sh
# install-super-clipboard.sh — bind Super+C/Super+V to universal copy/paste.
#
# - super-copy / super-paste -> ~/.local/bin (class-aware sendshortcut)
# - appends an idempotent block to ~/.config/caelestia/hypr-user.conf that:
# * unbinds the stock Super+V (clipboard history)
# * binds Super+C -> super-copy, Super+V -> super-paste
# - clipboard history stays on Super+Ctrl+V (and Super+Alt+V delete-mode).
# Idempotent: safe to re-run; the conf block is added at most once.
set -eu
SRC=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
BIN="$HOME/.local/bin"
HYPRUSER="$HOME/.config/caelestia/hypr-user.conf"
MARK='super-clipboard copy/paste'
mkdir -p "$BIN"
install -m 0755 "$SRC/super-copy" "$BIN/super-copy"
install -m 0755 "$SRC/super-paste" "$BIN/super-paste"
if [ ! -f "$HYPRUSER" ]; then
echo "NOTE: $HYPRUSER not found — add the Super+C/Super+V binds manually."
elif grep -q "$MARK" "$HYPRUSER"; then
echo ":: binds already present in $HYPRUSER"
else
cat >> "$HYPRUSER" <<'EOF'
# >>> super-clipboard copy/paste >>>
# Super+C / Super+V = universal copy/paste. Terminals get Ctrl+Shift+C/V,
# GUI apps get Ctrl+C/V (class-aware, via Hyprland sendshortcut).
# Clipboard history moves to Super+Ctrl+V; Super+Alt+V = history delete-mode.
unbind = SUPER, V
bind = SUPER, C, exec, super-copy # Copy (universal)
bind = SUPER, V, exec, super-paste # Paste (universal)
# <<< super-clipboard copy/paste <<<
EOF
echo ":: appended Super+C/Super+V copy-paste 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. Super+C copies, Super+V pastes; history on Super+Ctrl+V."