1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-27 17:07:44 +00:00

treewide: finish renaming to Watt

This commit is contained in:
diniamo 2025-06-06 14:59:22 +02:00
parent da07011b02
commit 5a197951d9
14 changed files with 132 additions and 132 deletions

View file

@ -8,7 +8,7 @@ use std::time::Duration;
/// Prints comprehensive debug information about the system
pub fn run_debug(config: &AppConfig) -> Result<(), AppError> {
println!("=== SUPERFREQ DEBUG INFORMATION ===");
println!("=== WATT DEBUG INFORMATION ===");
println!("Version: {}", env!("CARGO_PKG_VERSION"));
// Current date and time
@ -190,11 +190,11 @@ pub fn run_debug(config: &AppConfig) -> Result<(), AppError> {
println!("\n--- DAEMON STATUS ---");
// Simple check for daemon status - can be expanded later
let daemon_status = fs::metadata("/var/run/superfreq.pid").is_ok();
let daemon_status = fs::metadata("/var/run/watt.pid").is_ok();
println!("Daemon Running: {daemon_status}");
// Check for systemd service status
if let Ok(systemd_status) = is_systemd_service_active("superfreq") {
if let Ok(systemd_status) = is_systemd_service_active("watt") {
println!("Systemd Service Active: {systemd_status}");
}

View file

@ -32,26 +32,26 @@ pub fn load_config_from_path(specific_path: Option<&str>) -> Result<AppConfig, C
)));
}
// Check for SUPERFREQ_CONFIG environment variable
if let Ok(env_path) = std::env::var("SUPERFREQ_CONFIG") {
// Check for WATT_CONFIG environment variable
if let Ok(env_path) = std::env::var("WATT_CONFIG") {
let env_path = Path::new(&env_path);
if env_path.exists() {
println!(
"Loading config from SUPERFREQ_CONFIG: {}",
"Loading config from WATT_CONFIG: {}",
env_path.display()
);
return load_and_parse_config(env_path);
}
eprintln!(
"Warning: Config file specified by SUPERFREQ_CONFIG not found: {}",
"Warning: Config file specified by WATT_CONFIG not found: {}",
env_path.display()
);
}
// System-wide paths
let config_paths = vec![
PathBuf::from("/etc/xdg/superfreq/config.toml"),
PathBuf::from("/etc/superfreq.toml"),
PathBuf::from("/etc/xdg/watt/config.toml"),
PathBuf::from("/etc/watt.toml"),
];
for path in config_paths {

View file

@ -1,4 +1,4 @@
// Configuration types and structures for superfreq
// Configuration types and structures for Watt
use crate::core::TurboSetting;
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;

View file

@ -152,7 +152,7 @@ fn get_available_governors() -> Result<Vec<String>> {
// First try the traditional path with cpu0. This is the most common case
// and will usually catch early, but we should try to keep the code to handle
// "edge" cases lightweight, for the (albeit smaller) number of users that
// run Superfreq on unusual systems.
// run Watt on unusual systems.
let cpu0_path = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors";
if Path::new(cpu0_path).exists() {
let content = fs::read_to_string(cpu0_path).map_err(|e| {
@ -546,12 +546,12 @@ pub fn get_platform_profiles() -> Result<Vec<String>> {
}
/// Path for storing the governor override state
const GOVERNOR_OVERRIDE_PATH: &str = "/etc/xdg/superfreq/governor_override";
const GOVERNOR_OVERRIDE_PATH: &str = "/etc/xdg/watt/governor_override";
/// Force a specific CPU governor or reset to automatic mode
pub fn force_governor(mode: GovernorOverrideMode) -> Result<()> {
// Create directory if it doesn't exist
let dir_path = Path::new("/etc/xdg/superfreq");
let dir_path = Path::new("/etc/xdg/watt");
if !dir_path.exists() {
fs::create_dir_all(dir_path).map_err(|e| {
if e.kind() == io::ErrorKind::PermissionDenied {
@ -605,7 +605,7 @@ pub fn force_governor(mode: GovernorOverrideMode) -> Result<()> {
println!(
"Governor override set to '{governor}'. This setting will persist across reboots."
);
println!("To reset, use: superfreq force-governor reset");
println!("To reset, use: watt force-governor reset");
Ok(())
}
}

View file

@ -421,7 +421,7 @@ pub fn run_daemon(config: AppConfig, verbose: bool) -> Result<(), AppError> {
// Update the log level filter if needed, without re-initializing the logger
log::set_max_level(level_filter);
info!("Starting superfreq daemon...");
info!("Starting Watt daemon...");
// Validate critical configuration values before proceeding
if let Err(err) = validate_poll_intervals(

View file

@ -228,7 +228,7 @@ pub fn determine_and_apply_settings(
manage_auto_turbo(report, selected_profile_config, on_ac_power)?;
} else {
debug!(
"Superfreq's dynamic turbo management is disabled by configuration. Ensuring system uses its default behavior for automatic turbo control."
"Watt's dynamic turbo management is disabled by configuration. Ensuring system uses its default behavior for automatic turbo control."
);
// Make sure the system is set to its default automatic turbo mode.
// This is important if turbo was previously forced off.

View file

@ -413,7 +413,7 @@ fn main() -> Result<(), AppError> {
Some(Commands::Daemon { verbose }) => daemon::run_daemon(config, verbose),
Some(Commands::Debug) => cli::debug::run_debug(&config),
None => {
info!("Welcome to superfreq! Use --help for commands.");
info!("Welcome to Watt! Use --help for commands.");
debug!("Current effective configuration: {config:?}");
Ok(())
}