Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
698f3ef
feat(macutil): add Install tab and delete the script runner
Cryptokid92 Aug 29, 2026
576e886
feat(macutil): bind Install checkboxes to BrewClient
Cryptokid92 Aug 29, 2026
c0715a1
feat(macutil): show the Install tab in MainWindow
Cryptokid92 Aug 29, 2026
abc747c
feat(macutil): style the Install search box
Cryptokid92 Aug 29, 2026
dae157b
chore(macutil): delete ScriptService.fs
Cryptokid92 Aug 29, 2026
ef23e15
chore(macutil): delete ScriptInfo.fs
Cryptokid92 Aug 29, 2026
9523191
chore(macutil): delete ScriptCategory.fs
Cryptokid92 Aug 29, 2026
8f8b911
chore(macutil): delete ScriptService TTY notes
Cryptokid92 Aug 29, 2026
7ae9490
chore(macutil): delete scripts/tabs.toml
Cryptokid92 Aug 29, 2026
b080d0c
chore(macutil): delete applications-setup tab_data.toml
Cryptokid92 Aug 29, 2026
fbbc659
chore(macutil): delete system-setup tab_data.toml
Cryptokid92 Aug 29, 2026
bd86a2b
chore(macutil): delete common-script.sh
Cryptokid92 Aug 29, 2026
5b3b467
chore(macutil): delete system-setup/dev-setup.sh
Cryptokid92 Aug 29, 2026
6753f48
chore(macutil): delete system-setup/fix-finder.sh
Cryptokid92 Aug 29, 2026
9b35420
chore(macutil): delete system-setup/remove-animations.sh
Cryptokid92 Aug 29, 2026
aa138f4
chore(macutil): delete system-setup/system-cleanup.sh
Cryptokid92 Aug 29, 2026
8348b52
chore(macutil): delete alacritty-setup.sh
Cryptokid92 Aug 29, 2026
24cad16
chore(macutil): delete android-debloat.sh
Cryptokid92 Aug 29, 2026
badb4d8
chore(macutil): delete browsers/brave.sh
Cryptokid92 Aug 29, 2026
4dafb5d
chore(macutil): delete browsers/chromium.sh
Cryptokid92 Aug 29, 2026
f8f02b6
chore(macutil): delete browsers/firefox.sh
Cryptokid92 Aug 29, 2026
4a105dc
chore(macutil): delete browsers/google-chrome.sh
Cryptokid92 Aug 29, 2026
7136d91
chore(macutil): delete browsers/librewolf.sh
Cryptokid92 Aug 29, 2026
3930064
chore(macutil): delete browsers/thorium.sh
Cryptokid92 Aug 29, 2026
06cb5b1
chore(macutil): delete browsers/vivaldi.sh
Cryptokid92 Aug 29, 2026
e455199
chore(macutil): delete browsers/waterfox.sh
Cryptokid92 Aug 29, 2026
015c81e
chore(macutil): delete browsers/zen-browser.sh
Cryptokid92 Aug 29, 2026
21559fd
chore(macutil): delete discord-setup.sh
Cryptokid92 Aug 29, 2026
158c6fb
chore(macutil): delete signal-setup.sh
Cryptokid92 Aug 29, 2026
a84a555
chore(macutil): delete slack-setup.sh
Cryptokid92 Aug 29, 2026
9754096
chore(macutil): delete telegram-setup.sh
Cryptokid92 Aug 29, 2026
fa3d25f
chore(macutil): delete thunderbird-setup.sh
Cryptokid92 Aug 29, 2026
62a8793
chore(macutil): delete whatsapp-setup.sh
Cryptokid92 Aug 29, 2026
2e97595
chore(macutil): delete githubdesktop.sh
Cryptokid92 Aug 29, 2026
faec7f2
chore(macutil): delete jetbrains-toolbox.sh
Cryptokid92 Aug 29, 2026
2e784bc
chore(macutil): delete neovim.sh
Cryptokid92 Aug 29, 2026
4ff35cc
chore(macutil): delete sublime.sh
Cryptokid92 Aug 29, 2026
be1e3e4
chore(macutil): delete vscode.sh
Cryptokid92 Aug 29, 2026
901bb53
chore(macutil): delete vscodium.sh
Cryptokid92 Aug 29, 2026
693af17
chore(macutil): delete zed.sh
Cryptokid92 Aug 29, 2026
0f98efe
chore(macutil): delete fastfetch-setup.sh
Cryptokid92 Aug 29, 2026
bde0821
chore(macutil): delete kitty-setup.sh
Cryptokid92 Aug 29, 2026
304eea9
chore(macutil): delete zsh-setup.sh
Cryptokid92 Aug 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions MacUtilGUI.Tests/InstallTabTests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
namespace MacUtilGUI.Tests

open Xunit
open MacUtilGUI.Services
open MacUtilGUI.ViewModels

module InstallTabTests =

let private catalog () =
ConfigLoader.load (ConfigSchemaTests.findConfigDir ())

let private makeVm (brew: BrewClientTests.FakeBrew) =
let client = FakeDefaultsClient()
let killer = FakeProcessKiller()
MainWindowViewModel(catalog (), client :> IDefaultsClient, killer :> IProcessKiller, brew.Exec)

let private findApp (rows: AppRowViewModel seq) id =
rows |> Seq.find (fun row -> row.Id = id)

let private uncheckAll (vm: MainWindowViewModel) =
for row in vm.AllApps do
row.IsChecked <- false

[<Fact>]
let InstallDetectChecksBox () =
let brew = BrewClientTests.FakeBrew([ "visual-studio-code" ], [ "neovim" ])
let vm = makeVm brew
let vscode = findApp vm.AllApps "visual-studio-code"
let neovim = findApp vm.AllApps "neovim"
let discord = findApp vm.AllApps "discord"

Assert.Equal("Visual Studio Code", vscode.Content)
Assert.True(BrewClient.installed brew.Exec vscode.App)
Assert.True(vscode.IsChecked)
Assert.True(neovim.IsChecked)
Assert.False(discord.IsChecked)
Assert.Equal(26, Seq.length vm.AllApps)
Assert.Equal(26, vm.Apps.Count)
Assert.NotEmpty(vm.SafeTweaks)

let pathBar = vm.SafeTweaks |> Seq.find (fun row -> row.Id = "finder-path-bar")
Assert.False(pathBar.IsChecked)

[<Fact>]
let EmptyInstallWritesNothing () =
let brew = BrewClientTests.FakeBrew([ "visual-studio-code" ], [])
let vm = makeVm brew
uncheckAll vm

vm.InstallSelected()
Assert.Empty(brew.InstallCalls)
Assert.Equal("Nothing is selected.", vm.StatusText)
Assert.Empty(vm.SelectedAppIds)

[<Fact>]
let SearchFiltersList () =
let brew = BrewClientTests.FakeBrew([], [])
let vm = makeVm brew

vm.SearchText <- "brave"
Assert.Equal(1, vm.Apps.Count)
Assert.Equal("brave-browser", Seq.exactlyOne vm.Apps |> fun row -> row.Id)
Assert.Equal(26, Seq.length vm.AllApps)

vm.SearchText <- ""
Assert.Equal(26, vm.Apps.Count)
1 change: 1 addition & 0 deletions MacUtilGUI.Tests/MacUtilGUI.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<Compile Include="BrewClientTests.fs" />
<Compile Include="FirstWaveTweaksTests.fs" />
<Compile Include="TweakTabTests.fs" />
<Compile Include="InstallTabTests.fs" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions MacUtilGUI/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,13 @@
<Style Selector="Button.macos-quiet:pointerover">
<Setter Property="Background" Value="#48484A"/>
</Style>

<Style Selector="TextBox.macos-search">
<Setter Property="Foreground" Value="#FFFFFF"/>
<Setter Property="Background" Value="#3A3A3C"/>
<Setter Property="BorderBrush" Value="#48484A"/>
<Setter Property="CaretBrush" Value="#FFFFFF"/>
<Setter Property="Padding" Value="10,8"/>
</Style>
</Application.Styles>
</Application>
10 changes: 1 addition & 9 deletions MacUtilGUI/MacUtilGUI.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@

<ItemGroup>
<Folder Include="Models\" />
<Compile Include="Models\ScriptInfo.fs" />
<Compile Include="Models\ScriptCategory.fs" />
<Compile Include="Models\Pref.fs" />
<Compile Include="Models\Action.fs" />
<Compile Include="Services\ConfigLoader.fs" />
<Compile Include="Services\DefaultsClient.fs" />
<Compile Include="Services\ActionEngine.fs" />
<Compile Include="Services\BrewClient.fs" />
<Compile Include="Services\ScriptService.fs" />
<Compile Include="ViewModels\ViewModelBase.fs" />
<Compile Include="ViewModels\TweakRowViewModel.fs" />
<Compile Include="ViewModels\AppRowViewModel.fs" />
<Compile Include="ViewModels\MainWindowViewModel.fs" />
<Compile Include="Views\MainWindow.axaml.fs" />
<Compile Include="Program.fs" />
Expand All @@ -61,7 +59,6 @@
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.10" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" />
<PackageReference Include="Tomlyn" Version="0.17.0" />
<PackageReference Include="Dotnet.Bundle" Version="*" />
</ItemGroup>

Expand All @@ -75,11 +72,6 @@
<AvaloniaResource Include="Assets\**" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="../scripts/**/*.sh" />
<EmbeddedResource Include="../scripts/**/*.toml" />
</ItemGroup>

<ItemGroup>
<Content Include="..\config\*.json" CopyToOutputDirectory="PreserveNewest" Link="config\%(Filename)%(Extension)" />
</ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions MacUtilGUI/Models/ScriptCategory.fs

This file was deleted.

9 changes: 0 additions & 9 deletions MacUtilGUI/Models/ScriptInfo.fs

This file was deleted.

89 changes: 5 additions & 84 deletions MacUtilGUI/README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,11 @@
# MacUtil GUI

A cross-platform GUI application built with F# and Avalonia UI to run the shell scripts from the MacUtil project.
Avalonia UI for MacUtil. The window is opaque `#1C1C1E`. The menu bar name is MacUtil.

## Features
Tweaks binds `config/tweaks.json` checkboxes to `ActionEngine`. Install binds `config/applications.json` checkboxes to `BrewClient`. Search filters the Install list.

- **Script Browser**: Browse and categorize scripts from the `scripts/` directory
- **Script Details**: View detailed information about each script including description, category, and file path
- **One-Click Execution**: Run scripts with a single button click
- **Cross-Platform**: Works on macOS, Windows, and Linux
- **Modern UI**: Built with Avalonia UI using the Fluent theme
Run from the repo root:

## Project Structure

```
MacUtilGUI/
├── MacUtilGUI.fsproj # Project file
├── App.axaml # Application XAML
├── Program.fs # Application entry point
├── Models/
│ ├── ScriptInfo.fs # Script information model
│ └── ScriptCategory.fs # Script category model
├── Services/
│ └── ScriptService.fs # Script loading and execution service
├── ViewModels/
│ ├── ViewModelBase.fs # Base view model class
│ └── MainWindowViewModel.fs # Main window view model
└── Views/
├── MainWindow.axaml # Main window XAML
└── MainWindow.axaml.fs # Main window code-behind
```bash
dotnet run --project MacUtilGUI/MacUtilGUI.fsproj
```

## Prerequisites

- .NET 9.0 SDK or later
- F# support

## Building and Running

1. Navigate to the MacUtilGUI directory:
```bash
cd MacUtilGUI
```

2. Restore dependencies:
```bash
dotnet restore
```

3. Build the project:
```bash
dotnet build
```

4. Run the application:
```bash
dotnet run
```

## How It Works

1. **Script Discovery**: The application scans the `../scripts/` directory for TOML configuration files and shell scripts
2. **TOML Parsing**: Uses the `tab_data.toml` files to organize scripts into categories with descriptions
3. **Dynamic Loading**: Scripts are organized by category and loaded dynamically from the file system
4. **Execution**: When a script is selected and "Run Script" is clicked, it executes the shell script in a new terminal process

## Configuration

The application reads configuration from:
- `scripts/tabs.toml` - Main configuration listing script directories
- `scripts/*/tab_data.toml` - Category-specific script configurations

## Dependencies

- **Avalonia**: Cross-platform .NET UI framework
- **Tomlyn**: TOML parsing library for .NET

## Extending

To add new script categories:
1. Create a new directory under `scripts/`
2. Add the directory name to `scripts/tabs.toml`
3. Create a `tab_data.toml` file in the new directory with script definitions
4. The GUI will automatically discover and display the new scripts

## Troubleshooting

- Ensure the `scripts/` directory is one level up from the executable location
- Check that shell scripts have execute permissions (`chmod +x script.sh`)
- Verify TOML files are properly formatted
Loading
Loading