Compare commits
No commits in common. "f4f6ede2a7691c60d6f752c3e6c76013d9e3f65e" and "324dda05485a77be1f2e3116860baaba58f1620f" have entirely different histories.
f4f6ede2a7
...
324dda0548
@ -1,11 +1,5 @@
|
|||||||
# Decisions
|
# Decisions
|
||||||
|
|
||||||
## 2026-04-19 – moonup i18n: reuse pacman gettext catalog + inline fallback
|
|
||||||
- **Who**: Dominik, ClaudeCode
|
|
||||||
- **Why**: moonup prompts looked foreign next to pacman/paru output (`[y/N]` vs `[J/n]`, English strings on a German system). User wanted consistency with the rest of the pacman UX.
|
|
||||||
- **Tradeoffs**: Full `.po`/`.mo` build-chain for moonarch was overkill for ~15 strings. gettext-only approach misses most moonarch-specific strings (no matching msgids in pacman catalog). Chose hybrid: `TEXTDOMAIN=pacman` for strings that match upstream msgids (prompts like `Proceed with installation?`, `Do you want to remove these packages?`, `[Y/n]`, `Starting full system upgrade...`), inline `_t()` helper for moonarch-specific strings.
|
|
||||||
- **How**: `moonarch-update` sets `TEXTDOMAIN=pacman`/`TEXTDOMAINDIR=/usr/share/locale`. `_t "en" "de"` picks by `${LANG%%.*}` matching `de_*`. `confirm()` now uses `::` prefix, default Y, accepts `y/Y/j/J`. No PKGBUILD change — `gettext` is in `base`. pacman msgids with trailing `\n` (e.g. `Starting full system upgrade...\n`) require ANSI-C quoting `$'...\n'` to match.
|
|
||||||
|
|
||||||
## 2026-04-08 – Battery conservation mode: udev + sysfs + Waybar toggle
|
## 2026-04-08 – Battery conservation mode: udev + sysfs + Waybar toggle
|
||||||
- **Who**: Dominik, ClaudeCode
|
- **Who**: Dominik, ClaudeCode
|
||||||
- **Why**: Laptops with `charge_control_end_threshold` support benefit from limiting charge to 80% to extend battery lifespan. Needed a user-friendly toggle without requiring sudo.
|
- **Why**: Laptops with `charge_control_end_threshold` support benefit from limiting charge to 80% to extend battery lifespan. Needed a user-friendly toggle without requiring sudo.
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
// ABOUTME: Allow the greeter user to reboot and power off without authentication.
|
|
||||||
// ABOUTME: Required because greetd's greeter session is inactive in logind.
|
|
||||||
|
|
||||||
polkit.addRule(function(action, subject) {
|
|
||||||
if (subject.user === "greeter" &&
|
|
||||||
(action.id === "org.freedesktop.login1.reboot" ||
|
|
||||||
action.id === "org.freedesktop.login1.reboot-multiple-sessions" ||
|
|
||||||
action.id === "org.freedesktop.login1.power-off" ||
|
|
||||||
action.id === "org.freedesktop.login1.power-off-multiple-sessions")) {
|
|
||||||
return polkit.Result.YES;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@ -12,7 +12,6 @@ Type=simple
|
|||||||
# Give kanshi time to configure all outputs before wlsunset captures them
|
# Give kanshi time to configure all outputs before wlsunset captures them
|
||||||
ExecStartPre=/bin/sleep 2
|
ExecStartPre=/bin/sleep 2
|
||||||
ExecStart=/usr/bin/wlsunset -T 6500 -t 5000 -S 00:00 -s 00:01
|
ExecStart=/usr/bin/wlsunset -T 6500 -t 5000 -S 00:00 -s 00:01
|
||||||
ExecStartPost=/usr/bin/pkill -RTMIN+11 waybar
|
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
|
|
||||||
|
|||||||
@ -4,21 +4,6 @@
|
|||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# --- i18n ---
|
|
||||||
# Reuse pacman's gettext catalog for prompts that match upstream msgids.
|
|
||||||
# For moonarch-specific strings fall back to _t() inline translation.
|
|
||||||
export TEXTDOMAIN=pacman
|
|
||||||
export TEXTDOMAINDIR=/usr/share/locale
|
|
||||||
YN=$(gettext "[Y/n]")
|
|
||||||
|
|
||||||
_t() {
|
|
||||||
# _t "english" "deutsch" — picks by $LANG
|
|
||||||
case "${LANG%%.*}" in
|
|
||||||
de_*) printf '%s' "$2" ;;
|
|
||||||
*) printf '%s' "$1" ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# --- Helper functions ---
|
# --- Helper functions ---
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
@ -34,8 +19,8 @@ read_packages() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
confirm() {
|
confirm() {
|
||||||
read -r -p ":: $1 $YN " response
|
read -r -p "$1 [y/N] " response
|
||||||
[[ -z "$response" || "$response" =~ ^[yYjJ]$ ]]
|
[[ "$response" =~ ^[yY]$ ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
OFFICIAL_PACKAGES="/usr/share/moonarch/official.txt"
|
OFFICIAL_PACKAGES="/usr/share/moonarch/official.txt"
|
||||||
@ -44,85 +29,85 @@ AUR_PACKAGES="/usr/share/moonarch/aur.txt"
|
|||||||
# --- Prerequisites ---
|
# --- Prerequisites ---
|
||||||
|
|
||||||
if [[ $EUID -eq 0 ]]; then
|
if [[ $EUID -eq 0 ]]; then
|
||||||
err "$(_t "Do NOT run as root. The script uses sudo where needed." "Nicht als root ausführen. Das Script verwendet sudo wo nötig.")"
|
err "Do NOT run as root. The script uses sudo where needed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# --- 1. Update system packages ---
|
# --- 1. Update system packages ---
|
||||||
|
|
||||||
log "=== $(gettext $'Starting full system upgrade...\n' | tr -d '\n.') ==="
|
log "=== Update system packages ==="
|
||||||
|
|
||||||
if confirm "$(_t "Run pacman -Syu?" "pacman -Syu ausführen?")"; then
|
if confirm "Run pacman -Syu?"; then
|
||||||
sudo pacman -Syu
|
sudo pacman -Syu
|
||||||
else
|
else
|
||||||
log "$(_t "System update skipped." "Systemaktualisierung übersprungen.")"
|
log "System update skipped."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v paru &>/dev/null; then
|
if command -v paru &>/dev/null; then
|
||||||
if confirm "$(_t "Update AUR packages (paru -Sua)?" "AUR-Pakete aktualisieren (paru -Sua)?")"; then
|
if confirm "Update AUR packages (paru -Sua)?"; then
|
||||||
paru -Sua
|
paru -Sua
|
||||||
else
|
else
|
||||||
log "$(_t "AUR update skipped." "AUR-Aktualisierung übersprungen.")"
|
log "AUR update skipped."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# --- 2. Reconcile package lists ---
|
# --- 2. Reconcile package lists ---
|
||||||
|
|
||||||
log "=== $(_t "Reconcile package lists" "Paketlisten abgleichen") ==="
|
log "=== Reconcile package lists ==="
|
||||||
|
|
||||||
if [[ -f "$OFFICIAL_PACKAGES" ]]; then
|
if [[ -f "$OFFICIAL_PACKAGES" ]]; then
|
||||||
MISSING_OFFICIAL=$(comm -23 <(read_packages "$OFFICIAL_PACKAGES" | sort) <(pacman -Qq | sort) || true)
|
MISSING_OFFICIAL=$(comm -23 <(read_packages "$OFFICIAL_PACKAGES" | sort) <(pacman -Qq | sort) || true)
|
||||||
if [[ -n "$MISSING_OFFICIAL" ]]; then
|
if [[ -n "$MISSING_OFFICIAL" ]]; then
|
||||||
log "$(_t "Missing official packages:" "Fehlende offizielle Pakete:")"
|
log "Missing official packages:"
|
||||||
echo "$MISSING_OFFICIAL"
|
echo "$MISSING_OFFICIAL"
|
||||||
if confirm "$(gettext 'Proceed with installation?')"; then
|
if confirm "Install?"; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
sudo pacman -S --needed --noconfirm $MISSING_OFFICIAL
|
sudo pacman -S --needed --noconfirm $MISSING_OFFICIAL
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
log "$(_t "All official packages installed." "Alle offiziellen Pakete installiert.")"
|
log "All official packages installed."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "$AUR_PACKAGES" ]] && command -v paru &>/dev/null; then
|
if [[ -f "$AUR_PACKAGES" ]] && command -v paru &>/dev/null; then
|
||||||
MISSING_AUR=$(comm -23 <(read_packages "$AUR_PACKAGES" | sort) <(pacman -Qq | sort) || true)
|
MISSING_AUR=$(comm -23 <(read_packages "$AUR_PACKAGES" | sort) <(pacman -Qq | sort) || true)
|
||||||
if [[ -n "$MISSING_AUR" ]]; then
|
if [[ -n "$MISSING_AUR" ]]; then
|
||||||
log "$(_t "Missing AUR packages:" "Fehlende AUR-Pakete:")"
|
log "Missing AUR packages:"
|
||||||
echo "$MISSING_AUR"
|
echo "$MISSING_AUR"
|
||||||
if confirm "$(gettext 'Proceed with installation?')"; then
|
if confirm "Install?"; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
paru -S --needed --noconfirm $MISSING_AUR
|
paru -S --needed --noconfirm $MISSING_AUR
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
log "$(_t "All AUR packages installed." "Alle AUR-Pakete installiert.")"
|
log "All AUR packages installed."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# --- 3. Orphaned packages ---
|
# --- 3. Orphaned packages ---
|
||||||
|
|
||||||
log "=== $(_t "Orphaned packages" "Verwaiste Pakete") ==="
|
log "=== Orphaned packages ==="
|
||||||
|
|
||||||
ORPHANS=$(pacman -Qdtq 2>/dev/null || true)
|
ORPHANS=$(pacman -Qdtq 2>/dev/null || true)
|
||||||
if [[ -n "$ORPHANS" ]]; then
|
if [[ -n "$ORPHANS" ]]; then
|
||||||
log "$(_t "Orphaned packages found:" "Verwaiste Pakete gefunden:")"
|
log "Orphaned packages found:"
|
||||||
echo "$ORPHANS"
|
echo "$ORPHANS"
|
||||||
if confirm "$(gettext 'Do you want to remove these packages?')"; then
|
if confirm "Remove?"; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
sudo pacman -Rsn --noconfirm $ORPHANS
|
sudo pacman -Rsn --noconfirm $ORPHANS
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
log "$(_t "No orphaned packages." "Keine verwaisten Pakete.")"
|
log "No orphaned packages."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# --- Done ---
|
# --- Done ---
|
||||||
|
|
||||||
log ""
|
log ""
|
||||||
log "============================================"
|
log "============================================"
|
||||||
log " $(_t "Moonarch update complete!" "Moonarch-Aktualisierung abgeschlossen!")"
|
log " Moonarch update complete!"
|
||||||
log "============================================"
|
log "============================================"
|
||||||
|
|
||||||
# Keep terminal open when launched from a GUI (e.g. Waybar on-click)
|
# Keep terminal open when launched from a GUI (e.g. Waybar on-click)
|
||||||
if [[ -t 0 ]]; then
|
if [[ -t 0 ]]; then
|
||||||
echo
|
echo
|
||||||
read -n 1 -s -r -p "$(_t "Press any key to close..." "Beliebige Taste drücken zum Schließen …")"
|
read -n 1 -s -r -p "Press any key to close..."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user