Skip to content

Commit

Permalink
Add option to restart explorer.exe after ‘UserOnce’ scripts have run
Browse files Browse the repository at this point in the history
  • Loading branch information
cschneegans committed Nov 5, 2024
1 parent b376e7a commit ab1a10d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ CompactOsModes CompactOsMode
Components: ImmutableDictionary.Create<string, ImmutableSortedSet<Pass>>(),
Bloatwares: [],
ExpressSettings: ExpressSettingsMode.DisableAll,
ScriptSettings: new ScriptSettings([]),
ScriptSettings: new ScriptSettings(Scripts: [], RestartExplorer: false),
KeySettings: new SkipKeySettings(),
WallpaperSettings: new DefaultWallpaperSettings(),
ColorSettings: new DefaultColorSettings(),
Expand Down
8 changes: 7 additions & 1 deletion modifier/Script.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public static string FileExtension(this ScriptType type)
}

public record class ScriptSettings(
IEnumerable<Script> Scripts
IEnumerable<Script> Scripts,
bool RestartExplorer
);

public class Script
Expand Down Expand Up @@ -119,6 +120,11 @@ class ScriptModifier(ModifierContext context) : Modifier(context)
{
public override void Process()
{
if (Configuration.ScriptSettings.RestartExplorer)
{
UserOnceScript.RestartExplorer();
}

var infos = Configuration.ScriptSettings.Scripts.Select(ScriptInfo.Create).ToImmutableList();
if (infos.IsEmpty)
{
Expand Down

0 comments on commit ab1a10d

Please sign in to comment.