Commit bab1a3819172

Vincent Demeester <vincent@sbr.pm>
2026-07-30 09:44:21
feat(kyushu): configure tuned-ppd for AC/battery switching
Replaced static balanced-battery profile with tuned-ppd configuration: latency-performance on AC for dev work, powersave on battery for power savings.
1 parent 8d6e66e
Changed files (1)
imperative
imperative/kyushu/bootstrap.sh
@@ -378,16 +378,26 @@ setup_power() {
 		log_info "powertop service already exists"
 	fi
 
-	# Set tuned profile for battery life
+	# Configure tuned-ppd for dev performance:
+	# AC → latency-performance (max speed), battery → powersave
 	if command -v tuned-adm &>/dev/null; then
-		local current
-		current=$(tuned-adm active 2>/dev/null | sed 's/.*: //')
-		if [[ "$current" != "balanced-battery" ]]; then
-			log_info "Setting tuned profile to balanced-battery (was: $current)..."
-			sudo tuned-adm profile balanced-battery
-		else
-			log_info "tuned profile already balanced-battery"
-		fi
+		log_info "Configuring tuned-ppd for dev performance..."
+		sudo tee /etc/tuned/ppd.conf >/dev/null <<-'EOF'
+			[main]
+			default=performance
+			battery_detection=true
+			sysfs_acpi_monitor=true
+
+			[profiles]
+			power-saver=powersave
+			balanced=balanced
+			performance=latency-performance
+
+			[battery]
+			performance=powersave
+		EOF
+		sudo systemctl restart tuned
+		log_info "tuned-ppd configured: AC→latency-performance, battery→powersave"
 	fi
 }