Skip to content

Check aurhelper#12

Merged
Firstp1ck merged 14 commits intomainfrom
check-aurhelper
Nov 21, 2025
Merged

Check aurhelper#12
Firstp1ck merged 14 commits intomainfrom
check-aurhelper

Conversation

@Firstp1ck
Copy link
Owner

Summary

This PR enhances AUR helper detection and support in the setup script, adding support for both paru and yay with preference for paru. It also improves the Rust UI to display warning and error states visually, and includes various improvements to directory detection, PAM configuration handling, and script reliability.

The main improvements include:

  • AUR Helper Support: Now checks for and prefers paru over yay, with proper state tracking to avoid duplicate checks
  • UI Enhancements: Added severity tracking (warnings/errors) with color-coded visual indicators in the setup progress UI
  • Script Reliability: Improved directory detection, PAM configuration handling, and better error handling throughout

Type of change

  • feat (new feature)
  • fix (bug fix)
  • docs (documentation only)
  • refactor (no functional change)
  • perf (performance)
  • test (add/update tests)
  • chore (build/infra/CI)
  • ui (visual/interaction changes)
  • breaking change (incompatible behavior)

How to test

List exact steps and commands to verify the change. Include flags like --dry-run when appropriate.

# Test AUR helper detection (with paru installed)
./setup.sh --dry-run

# Test AUR helper detection (with yay installed, no paru)
./setup.sh --dry-run

# Test AUR helper detection (neither installed - should install yay)
./setup.sh --dry-run

# Test Rust UI with severity indicators
cargo run

# Verify script changes
bash -n setup.sh
shellcheck setup.sh

# For Rust code (if applicable)
cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
cargo test -- --test-threads=1

Checklist

  • Code compiles locally
  • cargo fmt --all ran without changes (if Rust changes)
  • cargo clippy --all-targets --all-features -- -D warnings is clean (if Rust changes)
  • cargo test -- --test-threads=1 passes (if Rust changes)
  • Added or updated tests where it makes sense
  • Updated docs if behavior, options, or keybinds changed (README, config examples)
  • For UI changes: included screenshots and updated Images/ if applicable
  • Changes respect --dry-run and degrade gracefully if pacman/paru/yay are unavailable
  • Not a packaging change for AUR (otherwise propose in hyprland-simple-setup-git repos)

Notes for reviewers

  • The AUR_HELPER_CHECKED flag prevents duplicate AUR helper checks within a single script run, improving performance
  • The preference order is: paru (if available) → yay (if available) → install yay (if neither available)
  • All hardcoded yay references have been replaced with the $AUR_HELPER variable for consistency
  • The severity tracking in the Rust UI parses log output for [error], [warning], [!] patterns to determine step severity
  • Windows detection properly skips AUR helper installation and sets AUR_HELPER_CHECKED=true to prevent errors
  • The new check_setup_warnings.sh script provides additional setup validation

Breaking changes

None. This is backward compatible - existing setups using yay will continue to work, and the script will now also support paru if available.

Additional context

  • Commit history shows this branch includes multiple enhancements: AUR helper checks, PAM configuration improvements, directory detection enhancements, and UI improvements
  • The changes affect both the shell script (setup.sh) and the Rust TUI application (src/main.rs)
  • A new script check_setup_warnings.sh has been added to the dotfiles configuration

Firstp1ck and others added 11 commits November 8, 2025 18:39
- Introduced AUR_HELPER variable to prefer 'paru' if available, falling back to 'yay'.
- Updated package installation and verification functions to utilize the selected AUR helper.
- Improved error handling and user feedback during AUR package operations.
- Added checks for required packages before attempting to install AUR helpers.
- Added AUR_HELPER_CHECKED variable to prevent duplicate checks and installations of AUR helpers within a single run.
- Updated check_yay function to set AUR_HELPER_CHECKED after determining the available AUR helper.
- Improved user feedback during AUR helper detection and installation process.
- Added support for Manjaro by using pacman-mirrors for mirror updates.
- Implemented checks for the installation of pacman-mirrors and provided user feedback.
- Updated the existing reflector command to remove hardcoded country specifications for improved flexibility.
…dling

- Added support for explicit directory overrides via environment variables for Hyprland setup.
- Improved directory search logic to include additional common user directories and increased search depth.
- Implemented checks to skip Timeshift installation and configuration if CachyOS Snapper support is detected, providing user feedback accordingly.
… obsolete script

- Changed warning messages in setup script to use print_message for consistency.
- Enhanced PAM configuration warning to include detailed instructions.
- Removed deprecated check_gnome_keyring_pam.sh script and updated autostart configuration to use check_setup_warnings.sh instead.
- Introduced StepSeverity enum in the UI to categorize setup section statuses (None, Warning, Error) for better visual feedback.
- Updated log handling to follow output and reflect severity in the UI.
- Implemented a mechanism to follow the PAM include chain for gnome-keyring configuration, ensuring modifications are made to the deepest relevant file.
- Updated verification logic to check PAM configurations across all candidate files.
- Improved UI layout in the menu by adjusting widget rendering and adding a legend for better user guidance.
…ity and safety

- Simplified the logic for determining PAM include candidates, reducing complexity while maintaining functionality.
- Updated the warning message to specify preferred configuration files for gnome-keyring, enhancing user guidance.
- Ensured safer write target selection for PAM configurations, prioritizing system-local-login if available.
…p script

- Changed the pacman update command from `-Syu` to `-Syyu` for better handling of package database synchronization.
- Refactored the method of appending PAM configurations for gnome-keyring to use `printf` instead of `echo`, enhancing safety and reliability in file modifications.
@Firstp1ck Firstp1ck self-assigned this Nov 20, 2025
@Firstp1ck Firstp1ck added bug Something isn't working enhancement New feature or request labels Nov 20, 2025
@Firstp1ck Firstp1ck requested a review from Copilot November 20, 2025 14:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances AUR helper detection to support both paru and yay (preferring paru), adds visual severity indicators (warnings/errors) to the Rust TUI, and includes improvements to directory detection, PAM configuration handling, and Manjaro/CachyOS support.

Key changes:

  • AUR helper detection now checks for paru first, falls back to yay, and sets AUR_HELPER variable with state tracking to avoid duplicate checks
  • Rust UI now tracks and displays step severity (Error/Warning/None) with color-coded indicators and a legend
  • Enhanced directory detection with multiple fallback strategies including git root, environment variables, and deeper search paths

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
setup.sh Implements AUR helper detection (check_yay), replaces hardcoded yay with $AUR_HELPER, improves directory detection, enhances PAM configuration handling, adds Manjaro/CachyOS-specific logic
src/main.rs Adds StepSeverity enum and tracking, implements color-coded severity display in UI, adds legend for severity indicators, enables auto-follow for output pane
dotfiles/.config/hypr/scripts/check_setup_warnings.sh New script to parse setup logs and notify users of warnings via desktop notifications
dotfiles/.config/hypr/sources_example/autostart.conf Adds autostart entry for the new warning check script
.github/PULL_REQUEST_TEMPLATE.md New PR template with standardized sections
.github/ISSUE_TEMPLATE/bug_report.md Updated bug report template fields
.gitignore Added Documents/* to ignore list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…logic. Added checks for AUR helper presence before executing commands and updated logging for better clarity. Adjusted indentation for consistency.
… script for Windows and dry-run modes, while ensuring AUR helper checks are still performed. Enhanced logging for clarity on skipped operations.
@Firstp1ck Firstp1ck marked this pull request as ready for review November 21, 2025 23:14
@Firstp1ck Firstp1ck merged commit f628617 into main Nov 21, 2025
5 checks passed
@Firstp1ck Firstp1ck deleted the check-aurhelper branch November 21, 2025 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant