Skip to content
This repository was archived by the owner on Feb 13, 2026. It is now read-only.

Commit 72aaceb

Browse files
committed
fix: polkit rule for tuned - specify user to avoid auth prompts
- Change polkit rule to explicitly allow specific user - Fixes authentication popup on every profile change - Add quick fix script for immediate deployment
1 parent 9a0c12e commit 72aaceb

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

omarchy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 1e859d37cb7fef6ac687442dc1fe515d01d1302d

unix/fedora/install/config/hardware/asus.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ sudo -u "$REAL_USER" systemctl --user enable asus-profile-sync.service
4444
sudo -u "$REAL_USER" systemctl --user start asus-profile-sync.service
4545

4646
# Configure polkit for profile switching
47-
sudo tee /etc/polkit-1/rules.d/49-asus-profile.rules > /dev/null <<'EOF'
48-
// Allow switching TuneD profiles from user sessions
47+
# Allow the current user to switch tuned profiles without authentication
48+
sudo tee /etc/polkit-1/rules.d/49-asus-profile.rules > /dev/null <<EOF
49+
// Allow user '$REAL_USER' to switch TuneD profiles without password
4950
polkit.addRule(function(action, subject) {
50-
if (action.id == "com.redhat.tuned.switch_profile") {
51+
if (action.id == "com.redhat.tuned.switch_profile" &&
52+
subject.user == "$REAL_USER") {
5153
return polkit.Result.YES;
5254
}
5355
});
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
# Quick fix: Update polkit rule for ASUS profile sync to not require authentication
3+
4+
echo "Updating polkit rule for tuned profile switching..."
5+
6+
CURRENT_USER="${SUDO_USER:-$USER}"
7+
8+
sudo tee /etc/polkit-1/rules.d/49-asus-profile.rules > /dev/null <<EOF
9+
// Allow user '$CURRENT_USER' to switch TuneD profiles without password
10+
polkit.addRule(function(action, subject) {
11+
if (action.id == "com.redhat.tuned.switch_profile" &&
12+
subject.user == "$CURRENT_USER") {
13+
return polkit.Result.YES;
14+
}
15+
});
16+
EOF
17+
18+
echo "Restarting polkit..."
19+
sudo systemctl restart polkit
20+
21+
echo "✓ Polkit rule updated for user: $CURRENT_USER"
22+
echo ""
23+
echo "Restarting asus-profile-sync service..."
24+
systemctl --user restart asus-profile-sync.service
25+
26+
echo ""
27+
echo "✓ Done! Press Fn+F5 to test - should not ask for password anymore"

0 commit comments

Comments
 (0)