Skip to content

Commit

Permalink
add auto-apply to "Disable Device Control" for chroma
Browse files Browse the repository at this point in the history
  • Loading branch information
Aytackydln committed Aug 29, 2023
1 parent a5639cb commit 7dbac9d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Project-Aurora/Project-Aurora/Modules/RazerSdkModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Threading.Tasks;
using Aurora.Modules.Razer;
using Aurora.Profiles;
using Aurora.Utils;
using Lombok.NET;
using RazerSdkReader;

Expand Down Expand Up @@ -29,6 +30,17 @@ protected override async Task Initialize()
{
await _lsm; //wait for ChromaApplication.Settings to load
TryLoadChroma();
if (Global.Configuration.ChromaDisableDeviceControl)
{
try
{
await RazerChromaUtils.DisableDeviceControlAsync();
}
catch (Exception e)
{
Global.logger.Error(e, "Error disabling device control automatically");
}
}

Global.logger.Information("RazerSdkManager loaded successfully!");
_sdkTaskSource.SetResult(_razerSdkManager);
Expand Down
1 change: 1 addition & 0 deletions Project-Aurora/Project-Aurora/Settings/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ public class Configuration : INotifyPropertyChanged
[JsonProperty("close_on_exception")] public bool CloseProgramOnException { get; set; } = true;
[JsonProperty("allow_wrappers_in_background")] public bool AllowWrappersInBackground { get; set; } = true;
public bool AllowTransparency { get; set; } = true;
public bool ChromaDisableDeviceControl { get; set; } = false;

[JsonProperty("use_volume_as_brightness")] public bool UseVolumeAsBrightness { get; set; }
[JsonProperty("global_brightness")] public float GlobalBrightness { get; set; } = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:a="clr-namespace:Aurora"
xmlns:utils="clr-namespace:Aurora.Utils"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
d:DesignHeight="600" d:DesignWidth="900">
<Grid DataContext="{x:Static a:Global.Configuration}">
<Grid.ColumnDefinitions>
<ColumnDefinition />
Expand Down Expand Up @@ -130,7 +130,7 @@
ToolTip="Disabling device control will stop ChromaSDK from controlling Razer Devices.&#x0a;After this you have to control them with OpenRGB. To enable it back reinstall ChromaSDK&#x0a;Synapse still needs to be closed completely"
VerticalAlignment="Center"
Click="razer_wrapper_disable_device_control_button_Click" />
<CheckBox
<CheckBox IsChecked="{Binding ChromaDisableDeviceControl}"
ToolTipService.InitialShowDelay="0"
ToolTip="Automatically reapply"
VerticalAlignment="Center">
Expand Down

0 comments on commit 7dbac9d

Please sign in to comment.