mirror of
https://github.com/archlinux/aur.git
synced 2026-03-05 01:22:44 +01:00
Fix critical post_install user context issues
- Run setup as actual user instead of root - Proper user detection with fallback - Fixes run.sh permissions and systemd service paths - Ensures proper group membership for /dev/uinput access
This commit is contained in:
parent
3e3cd0e079
commit
79ee98db6e
1 changed files with 20 additions and 2 deletions
|
|
@ -1,6 +1,24 @@
|
|||
post_install() {
|
||||
# Run setup with Waybar integration enabled by default
|
||||
HYPRWHSPR_WAYBAR_AUTO=1 hyprwhspr-setup
|
||||
# Detect the actual user (not root)
|
||||
if [ -n "$SUDO_USER" ]; then
|
||||
ACTUAL_USER="$SUDO_USER"
|
||||
else
|
||||
# Fallback: find first non-root user
|
||||
ACTUAL_USER=$(stat -c '%U' /home 2>/dev/null | head -1 || echo "")
|
||||
fi
|
||||
|
||||
if [ -n "$ACTUAL_USER" ] && [ "$ACTUAL_USER" != "root" ]; then
|
||||
# Run setup as the actual user
|
||||
sudo -u "$ACTUAL_USER" bash -c 'HYPRWHSPR_WAYBAR_AUTO=1 hyprwhspr-setup' || {
|
||||
echo "Warning: Could not run setup as user $ACTUAL_USER. Please run manually:"
|
||||
echo " hyprwhspr-setup"
|
||||
echo " HYPRWHSPR_WAYBAR_AUTO=1 hyprwhspr-setup"
|
||||
}
|
||||
else
|
||||
echo "Warning: Could not determine user. Please run setup manually:"
|
||||
echo " hyprwhspr-setup"
|
||||
echo " HYPRWHSPR_WAYBAR_AUTO=1 hyprwhspr-setup"
|
||||
fi
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue