### Create Shortcut to Launch FanControl with Specific Config (CMD) Source: https://github.com/rem0o/fancontrol.releases/wiki/Hotkeys---Automate-config-changes-(V136-and-up) This demonstrates how to create a Windows shortcut to launch FanControl with a specific configuration file. The 'Start in' directory must be set to the folder containing FanControl.exe and the configuration file for the shortcut to function correctly. This enables easy switching between different fan profiles. ```cmd C:\FanControlFolder\FanControl.exe -c Default.json ``` -------------------------------- ### Set 'Start in' Directory for FanControl Shortcut (CMD) Source: https://github.com/rem0o/fancontrol.releases/wiki/Hotkeys---Automate-config-changes-(V136-and-up) This specifies the 'Start in' directory for a FanControl shortcut. This setting is crucial for the executable to locate its associated files, including configuration files, correctly. It should point to the directory where FanControl.exe and the desired configuration file reside. ```cmd C:\FanControlFolder\ ``` -------------------------------- ### Install Fan Control via Package Managers Source: https://context7.com/rem0o/fancontrol.releases/llms.txt Commands to install Fan Control on Windows using common package managers like Scoop and Winget. These tools simplify the installation process by handling dependencies automatically. ```bash scoop bucket add extras scoop install fancontrol winget install Rem0o.FanControl ``` -------------------------------- ### Execute FanControl with Custom Configuration (CMD) Source: https://github.com/rem0o/fancontrol.releases/wiki/Hotkeys---Automate-config-changes-(V136-and-up) This command executes FanControl.exe and applies a specified configuration file. If FanControl is not running, it starts a new instance with the given config. If an instance is already running, it sends a message to that instance to load the new configuration. Ensure the path to FanControl.exe and the config file are correct. ```cmd FanControl.exe -c myCustomConfig.json ``` -------------------------------- ### Automate Configuration Switching via Command Line Source: https://context7.com/rem0o/fancontrol.releases/llms.txt Demonstrates how to launch Fan Control with specific configuration files using command-line arguments. This is useful for creating shortcuts or automated scripts to toggle between different cooling profiles. ```cmd FanControl.exe -c myCustomConfig.json ``` ```powershell $hour = (Get-Date).Hour if ($hour -ge 22 -or $hour -lt 7) { Start-Process "C:\FanControl\FanControl.exe" -ArgumentList "-c", "NightMode.json" } else { Start-Process "C:\FanControl\FanControl.exe" -ArgumentList "-c", "Default.json" } ``` -------------------------------- ### Optimize Plugin Performance with IPlugin2 Source: https://context7.com/rem0o/fancontrol.releases/llms.txt Demonstrates the IPlugin2 interface, which provides a centralized Update method. This is more efficient for plugins that poll hardware data from a single source, as it reduces the overhead of multiple individual sensor updates. ```csharp using FanControl.Plugins; namespace FanControl.HWInfoPlugin { public class HWInfoPlugin : IPlugin2 { public string Name => "HWInfo Integration"; private List _sensors = new List(); private SharedMemoryReader _sharedMemory; public void Initialize() => _sharedMemory = new SharedMemoryReader("HWiNFO_SENS_SM2"); public void Load(IPluginSensorsContainer container) { foreach (var sensorData in _sharedMemory.GetSensors()) { var sensor = new HWInfoSensor(sensorData); _sensors.Add(sensor); container.TempSensors.Add(sensor); } } public void Update() { var allData = _sharedMemory.ReadAllSensors(); foreach (var sensor in _sensors) { sensor.UpdateFromData(allData); } } public void Close() { _sharedMemory?.Dispose(); _sensors.Clear(); } } } ``` -------------------------------- ### Implement Custom Plugins with IPlugin Source: https://context7.com/rem0o/fancontrol.releases/llms.txt Shows the basic structure for creating a Fan Control plugin by implementing the IPlugin interface. This allows developers to inject custom sensors and controls into the application. ```csharp using FanControl.Plugins; namespace FanControl.MyPlugin { public class MyPlugin : IPlugin { public string Name => "My Custom Plugin"; private readonly IPluginLogger _logger; private readonly IPluginDialog _dialog; public MyPlugin(IPluginLogger logger, IPluginDialog dialog) { _logger = logger; _dialog = dialog; } public void Initialize() => _logger.Log("Plugin initializing..."); public void Load(IPluginSensorsContainer container) { container.TempSensors.Add(new MyTemperatureSensor()); container.FanSensors.Add(new MyFanSpeedSensor()); container.ControlSensors.Add(new MyFanControlSensor()); } public void Close() => _logger.Log("Plugin closing..."); } } ``` -------------------------------- ### Implement IPluginSensor for Hardware Monitoring Source: https://context7.com/rem0o/fancontrol.releases/llms.txt Demonstrates how to implement the IPluginSensor interface to provide temperature or fan speed data to FanControl. The Update method is invoked periodically to refresh the sensor value. ```csharp using FanControl.Plugins; namespace FanControl.MyPlugin { public class MyTemperatureSensor : IPluginSensor { public string Id => "MyPlugin/CPUTemp"; public string Name => "My CPU Temperature"; public float? Value { get; private set; } private HardwareInterface _hardware; public MyTemperatureSensor() { _hardware = new HardwareInterface(); } public void Update() { Value = _hardware.ReadCpuTemperature(); } } } ``` -------------------------------- ### Sensor and Control Implementation Source: https://github.com/rem0o/fancontrol.releases/wiki/Plugins Defines how to implement custom sensors and control sensors within a plugin. ```APIDOC ## Sensor Interfaces ### IPluginSensor - **Id** (string) - Unique identifier. - **Name** (string) - Display name. - **Value** (float) - Current sensor reading. - **Update()** (void) - Called at 1 Hz to refresh the sensor value. ### IPluginControlSensor - **Set(val)** (void) - Applies a value between 0 and 100 to the hardware. - **Reset()** (void) - Reverts the control to its default state. ### IPluginControlSensor2 - **PairedFanSensorId** (string) - Associates a speed (RPM) sensor with the control sensor for automatic pairing. ``` -------------------------------- ### Plugin Interface Implementation Source: https://github.com/rem0o/fancontrol.releases/wiki/Plugins Defines the core lifecycle and structural requirements for a Fan Control plugin. ```APIDOC ## Plugin Lifecycle Interfaces ### Description Plugins must implement IPlugin or IPlugin2 to be discovered by Fan Control at startup. The lifecycle follows Initialize() -> Load(container) -> Close(). ### Requirements - Must be a .NET assembly (dll) named FanControl.[YourPluginName].dll. - Must reference FanControl.Plugins.dll. ### IPlugin Members - **Name** (string) - Plugin identifier. - **Initialize()** (void) - Setup routine. - **Load(container)** (void) - Load sensors into the provided container. - **Close()** (void) - Cleanup resources. ### IPlugin2 Additions - **Update()** (void) - Optional hook to update all sensors from a single method. ### IPlugin3 Additions - **RefreshRequested** (event) - Signals the need for a full refresh or indicates a crash. ``` -------------------------------- ### Implement IPluginControlSensor for Fan Speed Control Source: https://context7.com/rem0o/fancontrol.releases/llms.txt Shows how to implement IPluginControlSensor to allow FanControl to adjust hardware fan speeds. It includes methods for setting speed percentages and resetting the controller to default states. ```csharp using FanControl.Plugins; namespace FanControl.MyPlugin { public class MyFanControlSensor : IPluginControlSensor { public string Id => "MyPlugin/FanControl1"; public string Name => "My Fan Controller"; public float? Value { get; private set; } private FanController _controller; public MyFanControlSensor() { _controller = new FanController(); } public void Update() { Value = _controller.GetCurrentSpeed(); } public void Set(float val) { _controller.Enable(); _controller.SetSpeed(val); Value = val; } public void Reset() { _controller.Disable(); _controller.ReturnToDefault(); } } } ``` -------------------------------- ### Implement IPluginControlSensor2 for Paired Fan Control Source: https://context7.com/rem0o/fancontrol.releases/llms.txt Utilizes IPluginControlSensor2 to associate a control sensor with a specific RPM sensor. This enables automatic pairing within the FanControl UI. ```csharp using FanControl.Plugins; namespace FanControl.MyPlugin { public class MyPairedFanControl : IPluginControlSensor2 { public string Id => "MyPlugin/FanControl1"; public string Name => "My Fan Controller"; public float? Value { get; private set; } public string PairedFanSensorId => "MyPlugin/FanRPM1"; private FanController _controller; public void Update() { Value = _controller.GetCurrentDutyCycle(); } public void Set(float val) { _controller.SetDutyCycle(val); Value = val; } public void Reset() { _controller.ReturnToAuto(); } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.