This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,165 additions
and
1,023 deletions.
There are no files selected for viewing
122 changes: 61 additions & 61 deletions
122
.../Assessments/Personalization/AppsTheme.cs → ...enTweaks/Assessments/Desktop/AppsTheme.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
118 changes: 59 additions & 59 deletions
118
...ments/Personalization/SnapAssistFlyout.cs → ...s/Assessments/Desktop/SnapAssistFlyout.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
59
src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Stickers.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
Oops, something went wrong.