Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Push v1.2.220
Browse files Browse the repository at this point in the history
  • Loading branch information
Belim committed May 28, 2022
1 parent 9b24643 commit 902b72e
Show file tree
Hide file tree
Showing 24 changed files with 1,165 additions and 1,023 deletions.
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
using Microsoft.Win32;

namespace ThisIsWin11.OpenTweaks.Assessment.Personalization
{
internal class AppsTheme : AssessmentBase
{
private static readonly ErrorHelper logger = ErrorHelper.Instance;

private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
private const int desiredValue = 0;

public override string ID()
{
return "Use Apps dark theme";
}

public override string Info()
{
return "This will also enable dark theme for ThisIsWin11.";
}

public override bool CheckAssessment()
{
return !(
RegistryHelper.IntEquals(keyName, "AppsUseLightTheme", desiredValue)
);
}

public override bool DoAssessment()
{
try
{
Registry.SetValue(keyName, "AppsUseLightTheme", desiredValue, RegistryValueKind.DWord);

logger.Log("- Apps dark theme has been successfully enabled.");
logger.Log(keyName);

logger.Log("\n\nDark theme will also be enabled for ThisIsWin11.\nPlease restart the app for the changes to take effect.");

return true;
}
catch
{ }

return false;
}

public override bool UndoAssessment()
{
try
{
Registry.SetValue(keyName, "AppsUseLightTheme", "1", RegistryValueKind.DWord);
logger.Log("- Apps light theme has been successfully enabled.");
return true;
}
catch
{ }

return false;
}
}
using Microsoft.Win32;

namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
{
internal class AppsTheme : AssessmentBase
{
private static readonly ErrorHelper logger = ErrorHelper.Instance;

private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
private const int desiredValue = 0;

public override string ID()
{
return "Use Apps dark theme";
}

public override string Info()
{
return "This will also enable dark theme for ThisIsWin11.";
}

public override bool CheckAssessment()
{
return !(
RegistryHelper.IntEquals(keyName, "AppsUseLightTheme", desiredValue)
);
}

public override bool DoAssessment()
{
try
{
Registry.SetValue(keyName, "AppsUseLightTheme", desiredValue, RegistryValueKind.DWord);

logger.Log("- Apps dark theme has been successfully enabled.");
logger.Log(keyName);

logger.Log("\n\nDark theme will also be enabled for ThisIsWin11.\nPlease restart the app for the changes to take effect.");

return true;
}
catch
{ }

return false;
}

public override bool UndoAssessment()
{
try
{
Registry.SetValue(keyName, "AppsUseLightTheme", "1", RegistryValueKind.DWord);
logger.Log("- Apps light theme has been successfully enabled.");
return true;
}
catch
{ }

return false;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
using Microsoft.Win32;
using System;

namespace ThisIsWin11.OpenTweaks.Assessment.Personalization
{
internal class SnapAssistFlyout : AssessmentBase
{
private static readonly ErrorHelper logger = ErrorHelper.Instance;

private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
private const int desiredValue = 0;

public override string ID()
{
return "Disable Snap Assist";
}

public override string Info()
{
return "When you hover over the maximize button in apps, this feature gives you a flyout to display possible layouts.";
}

public override bool CheckAssessment()
{
return !(
RegistryHelper.IntEquals(keyName, "EnableSnapAssistFlyout", desiredValue)
);
}

public override bool DoAssessment()
{
try
{
Registry.SetValue(keyName, "EnableSnapAssistFlyout", desiredValue, RegistryValueKind.DWord);

logger.Log("- Snap Assist Layout has been disabled.\nPlease restart your PC for the changes to take effect.");
logger.Log(keyName);
return true;
}
catch (Exception ex)
{ logger.Log("Could not disable Snap Assist {0}", ex.Message); }

return false;
}

public override bool UndoAssessment()
{
try
{
Registry.SetValue(keyName, "EnableSnapAssistFlyout", 1, RegistryValueKind.DWord);
logger.Log("- Snap Assist has been enabled.\nPlease restart your PC for the changes to take effect.");
return true;
}
catch
{ }

return false;
}
}
using Microsoft.Win32;
using System;

namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
{
internal class SnapAssistFlyout : AssessmentBase
{
private static readonly ErrorHelper logger = ErrorHelper.Instance;

private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
private const int desiredValue = 0;

public override string ID()
{
return "Disable Snap Assist";
}

public override string Info()
{
return "When you hover over the maximize button in apps, this feature gives you a flyout to display possible layouts.";
}

public override bool CheckAssessment()
{
return !(
RegistryHelper.IntEquals(keyName, "EnableSnapAssistFlyout", desiredValue)
);
}

public override bool DoAssessment()
{
try
{
Registry.SetValue(keyName, "EnableSnapAssistFlyout", desiredValue, RegistryValueKind.DWord);

logger.Log("- Snap Assist Layout has been disabled.\nPlease restart your PC for the changes to take effect.");
logger.Log(keyName);
return true;
}
catch (Exception ex)
{ logger.Log("Could not disable Snap Assist {0}", ex.Message); }

return false;
}

public override bool UndoAssessment()
{
try
{
Registry.SetValue(keyName, "EnableSnapAssistFlyout", 1, RegistryValueKind.DWord);
logger.Log("- Snap Assist has been enabled.\nPlease restart your PC for the changes to take effect.");
return true;
}
catch
{ }

return false;
}
}
}
59 changes: 59 additions & 0 deletions src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Stickers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using Microsoft.Win32;

namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
{
internal class Stickers : AssessmentBase
{
private static readonly ErrorHelper logger = ErrorHelper.Instance;

private const string keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device\Stickers";
private const int desiredValue = 1;

public override string ID()
{
return "Enable Desktop Stickers";
}

public override string Info()
{
return "";
}

public override bool CheckAssessment()
{
return !(
RegistryHelper.IntEquals(keyName, "EnableStickers", desiredValue)
);
}

public override bool DoAssessment()
{
try
{
Registry.SetValue(keyName, "EnableStickers", desiredValue, RegistryValueKind.DWord);

logger.Log("- Desktop Stickers has been enabled (ONLY available in 22H2 Build 22621 and higher).");
logger.Log(keyName);
return true;
}
catch
{ }

return false;
}

public override bool UndoAssessment()
{
try
{
Registry.SetValue(keyName, "EnableStickers", "0", RegistryValueKind.DWord);
logger.Log("- Desktop Sticker feature has been disabled.");
return true;
}
catch
{ }

return false;
}
}
}
Loading

0 comments on commit 902b72e

Please sign in to comment.