A lot of things

This commit is contained in:
2025-10-28 19:02:19 +01:00
parent 393ef60c82
commit 47cff5e7f6
21 changed files with 794 additions and 60 deletions

View File

@@ -0,0 +1,71 @@
using Microsoft.Win32;
using Perfect11.TweaksInterface;
namespace Perfect11.Inbox.Widgets
{
public class Tweak : IPlugin
{
public string Name => "Enable/Disable Widgets";
public string Description => "Enable or Disable Windows 11 Widgets";
public string Category => "Annoyances";
public string Execute()
{
bool Enabled()
{
try
{
using (var key = Registry.CurrentUser.OpenSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"))
{
object value = key?.GetValue("TaskbarDa");
if (value is int intValue)
return intValue == 1;
}
}
catch { }
return true;
}
if (Enabled())
{
using (var key = Registry.CurrentUser.CreateSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"))
{
key?.SetValue("TaskbarDa", 0, RegistryValueKind.DWord);
}
using (var policyKey = Registry.LocalMachine.CreateSubKey(
@"SOFTWARE\Policies\Microsoft\Dsh"))
{
policyKey?.SetValue("AllowNewsAndInterests", 0, RegistryValueKind.DWord);
}
using (var taskbarKey = Registry.CurrentUser.CreateSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Feeds"))
{
taskbarKey?.SetValue("ShellFeedsTaskbarViewMode", 2, RegistryValueKind.DWord);
}
return "Widgets have been disabled successfully! Please consider to restart File Explorer or log off and log back in for changes to apply.";
}
else
{
using (var key = Registry.CurrentUser.CreateSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"))
{
key?.SetValue("TaskbarDa", 1, RegistryValueKind.DWord);
}
using (var policyKey = Registry.LocalMachine.CreateSubKey(
@"SOFTWARE\Policies\Microsoft\Dsh"))
{
policyKey?.SetValue("AllowNewsAndInterests", 1, RegistryValueKind.DWord);
}
using (var taskbarKey = Registry.CurrentUser.CreateSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Feeds"))
{
taskbarKey?.SetValue("ShellFeedsTaskbarViewMode", 0, RegistryValueKind.DWord);
}
return "Widgets have been enabled successfully! Please consider to restart File Explorer or log off and log back in for changes to apply.";
}
}
}
}