Files
davidandClaude Opus 5.5 9dc5eb193d
shellcheck / shellcheck (push) Failing after 19s
Add upgrade safeguards, hardware setup, sign-in options and Taildrop from Omarchy
Adapted from Omarchy (github.com/omacom/omarchy) for Arch with GNOME:

- A pacman hook stops a full upgrade run without update (pacman -Syu,
  yay -Syu), which would skip the snapshot and update's checks. update
  and install.sh set COREDESKTOP_ALLOW_PACMAN=1, which the hook finds on
  pacman or any process above it; you can set it too.
- When the Arch upgrade stops on files no package owns, update lists
  them and asks to move them to /var/lib/coredesktop/replaced and try
  again, putting back what the retry didn't replace. When packages
  conflict, it runs pacman again so you can choose.
- update and install keep the computer from sleeping until they finish.
- system/hardware.sh (install, and a migration): the Wi-Fi country from
  the time zone, thermald and intel-lpmd on Intel laptops, and Wi-Fi 6
  on Intel BE200/BE211 cards, whose driver gets Wi-Fi 7 wrong.
- configure security-key and configure fingerprint: touch a FIDO2 key
  or a finger instead of typing your password for sudo and polkit,
  falling back to the password. Each shows only when the hardware is
  there. The fingerprint skips to the password with the lid shut.
- webapp: put a website in the app grid as its own app window.
- Taildrop: Files' Scripts > Send with Tailscale, and a user service
  that saves files sent here to Downloads, started when configure
  tailscale joins.
- A NetworkManager dispatcher script pauses a Tailscale exit node while
  you sign in to a captive portal, and resumes it once online.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:08:06 -07:00

39 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
#
# Purpose : Install the pacman hook that stops a full system upgrade not run by
# CoreDesktop's update (system/pacman-guard). Run by install.sh and
# on every update (updates.d/11-pacman-guard.sh), so changes to it
# reach existing machines.
set -e
COREDESKTOP="${COREDESKTOP:-$HOME/.local/share/coredesktop}"
# For the tests
ROOT="${PACMAN_GUARD_ROOT:-}"
GUARD="$ROOT/usr/local/lib/coredesktop/pacman-guard"
HOOK="$ROOT/etc/pacman.d/hooks/00-coredesktop-guard.hook"
# The hook runs the copy in /usr/local as root, so it mustn't be one you can
# edit without sudo
if ! cmp -s "$COREDESKTOP/system/pacman-guard" "$GUARD"; then
echo "Installing the pacman upgrade guard..."
sudo install -D -m 755 "$COREDESKTOP/system/pacman-guard" "$GUARD"
fi
HOOK_TEXT="[Trigger]
Operation = Upgrade
Type = Package
Target = *
[Action]
Description = Checking this upgrade is run by CoreDesktop's update...
When = PreTransaction
Exec = /usr/local/lib/coredesktop/pacman-guard
AbortOnFail"
if [ "$(cat "$HOOK" 2> /dev/null)" != "$HOOK_TEXT" ]; then
sudo install -d -m 755 "$(dirname "$HOOK")"
printf '%s\n' "$HOOK_TEXT" | sudo tee "$HOOK" > /dev/null
fi