diff --git a/.devcontainer/config.fish b/.devcontainer/config.fish index 4fc08bb70e..a8c3d11213 100644 --- a/.devcontainer/config.fish +++ b/.devcontainer/config.fish @@ -2939,8 +2939,60 @@ kill %1 2>/dev/null" end end -# Auto-start aesthetic when fish runs in the VS Code task context -# aesthetic-launch.sh sets AC_TASK_LAUNCH=1 before exec fish --login +# 🎮 Xbox helper - connect to Xbox on local network +function ac-xbox --description "Interact with Xbox on 1244 Innes Ave LAN" + set -l vault_path "$HOME/aesthetic-computer/aesthetic-computer-vault/machines.json" + if not test -f $vault_path + echo "❌ machines.json not found" + return 1 + end + + set -l xbox_ip (jq -r '.machines.xbox.ip' $vault_path) + set -l portal_port (jq -r '.machines.xbox.devicePortalPort' $vault_path) + + if test -z "$xbox_ip" -o "$xbox_ip" = "null" + echo "❌ Xbox not configured in machines.json" + return 1 + end + + switch $argv[1] + case ping + echo "🏓 Pinging Xbox at $xbox_ip..." + ssh jas@host.docker.internal "ping -c 3 $xbox_ip" + case portal + echo "🌐 Xbox Device Portal: https://$xbox_ip:$portal_port" + echo " Opening in browser..." + ssh jas@host.docker.internal "open 'https://$xbox_ip:$portal_port'" + case info + echo "🎮 Xbox Series X" + echo " IP: $xbox_ip" + echo " Device Portal: https://$xbox_ip:$portal_port" + echo " Network: 1244 Innes Ave Home LAN" + echo "" + echo "To deploy from Visual Studio:" + echo " 1. Debug → Remote Machine → $xbox_ip" + echo " 2. Enter PIN from Xbox Dev Home app" + echo " 3. F5 to deploy" + case tunnel + echo "🚇 Creating SSH tunnel to Xbox Device Portal..." + echo " Local: https://localhost:11443 → Xbox: $xbox_ip:$portal_port" + echo " Press Ctrl+C to stop" + ssh -L 11443:$xbox_ip:$portal_port jas@host.docker.internal -N + case '*' + echo "🎮 Xbox Helper (1244 Innes Ave LAN)" + echo "" + echo "Usage: ac-xbox " + echo "" + echo "Commands:" + echo " ac-xbox ping - Check if Xbox is reachable" + echo " ac-xbox portal - Open Device Portal in browser" + echo " ac-xbox info - Show connection info" + echo " ac-xbox tunnel - Create SSH tunnel to Device Portal" + echo "" + echo "Xbox IP: $xbox_ip" + end +end + if set -q AC_TASK_LAUNCH set -e AC_TASK_LAUNCH # Clear it so nested shells don't re-trigger aesthetic diff --git a/xbox/AestheticComputer.sln b/xbox/AestheticComputer.sln new file mode 100644 index 0000000000..e605dd7037 --- /dev/null +++ b/xbox/AestheticComputer.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AestheticComputer", "AestheticComputer\AestheticComputer.csproj", "{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|ARM.ActiveCfg = Debug|ARM + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|ARM.Build.0 = Debug|ARM + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|ARM64.Build.0 = Debug|ARM64 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|x64.ActiveCfg = Debug|x64 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|x64.Build.0 = Debug|x64 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|x86.ActiveCfg = Debug|x86 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|x86.Build.0 = Debug|x86 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|ARM.ActiveCfg = Release|ARM + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|ARM.Build.0 = Release|ARM + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|ARM64.ActiveCfg = Release|ARM64 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|ARM64.Build.0 = Release|ARM64 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|x64.ActiveCfg = Release|x64 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|x64.Build.0 = Release|x64 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|x86.ActiveCfg = Release|x86 + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/xbox/AestheticComputer/AestheticComputer.csproj b/xbox/AestheticComputer/AestheticComputer.csproj new file mode 100644 index 0000000000..a022544110 --- /dev/null +++ b/xbox/AestheticComputer/AestheticComputer.csproj @@ -0,0 +1,38 @@ + + + WinExe + net6.0-windows10.0.22621.0 + 10.0.17763.0 + AestheticComputer + app.manifest + x86;x64;ARM64 + win10-x86;win10-x64;win10-arm64 + true + true + MSIX + true + win10-$(Platform).pubxml + False + True + SHA256 + True + False + True + Always + x64|ARM64 + 0 + + + + + PreserveNewest + + + + + + + + + + diff --git a/xbox/AestheticComputer/App.xaml b/xbox/AestheticComputer/App.xaml new file mode 100644 index 0000000000..84bfe0c86b --- /dev/null +++ b/xbox/AestheticComputer/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/xbox/AestheticComputer/App.xaml.cs b/xbox/AestheticComputer/App.xaml.cs new file mode 100644 index 0000000000..9464db3a47 --- /dev/null +++ b/xbox/AestheticComputer/App.xaml.cs @@ -0,0 +1,19 @@ +using Microsoft.UI.Xaml; + +namespace AestheticComputer; + +public partial class App : Application +{ + private Window? m_window; + + public App() + { + this.InitializeComponent(); + } + + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + m_window.Activate(); + } +} diff --git a/xbox/AestheticComputer/MainWindow.xaml b/xbox/AestheticComputer/MainWindow.xaml new file mode 100644 index 0000000000..31dd4085f6 --- /dev/null +++ b/xbox/AestheticComputer/MainWindow.xaml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/xbox/AestheticComputer/MainWindow.xaml.cs b/xbox/AestheticComputer/MainWindow.xaml.cs new file mode 100644 index 0000000000..67cc77c157 --- /dev/null +++ b/xbox/AestheticComputer/MainWindow.xaml.cs @@ -0,0 +1,111 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Input; +using Microsoft.Web.WebView2.Core; +using System; +using Windows.Gaming.Input; +using Windows.System; + +namespace AestheticComputer; + +public sealed partial class MainWindow : Window +{ + private Gamepad? _gamepad; + + public MainWindow() + { + this.InitializeComponent(); + + // Make window fullscreen on Xbox + var appWindow = this.AppWindow; + appWindow.SetPresenter(Microsoft.UI.Windowing.AppWindowPresenterKind.FullScreen); + + // Initialize WebView2 + InitializeWebView(); + + // Setup gamepad handling + SetupGamepad(); + } + + private async void InitializeWebView() + { + try + { + await webView.EnsureCoreWebView2Async(); + + // Configure WebView2 for optimal Xbox experience + var settings = webView.CoreWebView2.Settings; + settings.IsZoomControlEnabled = false; + settings.AreDefaultContextMenusEnabled = false; + settings.IsStatusBarEnabled = false; + settings.AreBrowserAcceleratorKeysEnabled = false; + + // Inject Xbox-specific info + webView.CoreWebView2.AddScriptToExecuteOnDocumentCreatedAsync(@" + window.isXboxApp = true; + window.isDeviceMode = true; + console.log('🎮 Aesthetic Computer Xbox App'); + "); + + // Handle navigation errors + webView.CoreWebView2.NavigationCompleted += (sender, args) => + { + if (!args.IsSuccess) + { + // Show offline message or retry + webView.CoreWebView2.NavigateToString(@" + + +
+

📡 Connecting...

+

Please check your internet connection

+ +
+ + + "); + } + }; + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine($"WebView2 init failed: {ex.Message}"); + } + } + + private void SetupGamepad() + { + // Watch for gamepad connections + Gamepad.GamepadAdded += (sender, gamepad) => + { + _gamepad = gamepad; + }; + + Gamepad.GamepadRemoved += (sender, gamepad) => + { + if (_gamepad == gamepad) + _gamepad = null; + }; + + // Check for already connected gamepads + if (Gamepad.Gamepads.Count > 0) + { + _gamepad = Gamepad.Gamepads[0]; + } + } + + // Handle keyboard/gamepad navigation + private void OnKeyDown(object sender, KeyRoutedEventArgs e) + { + // Map Xbox controller buttons to web events + switch (e.Key) + { + case VirtualKey.GamepadMenu: + case VirtualKey.Escape: + // Could show an overlay menu + break; + case VirtualKey.GamepadView: + // Toggle fullscreen or info + break; + } + } +} diff --git a/xbox/AestheticComputer/Package.appxmanifest b/xbox/AestheticComputer/Package.appxmanifest new file mode 100644 index 0000000000..415452d275 --- /dev/null +++ b/xbox/AestheticComputer/Package.appxmanifest @@ -0,0 +1,61 @@ + + + + + + + + + Aesthetic Computer + Whistlegraph + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xbox/AestheticComputer/app.manifest b/xbox/AestheticComputer/app.manifest new file mode 100644 index 0000000000..11f43fa69d --- /dev/null +++ b/xbox/AestheticComputer/app.manifest @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/xbox/README.md b/xbox/README.md new file mode 100644 index 0000000000..aa62389532 --- /dev/null +++ b/xbox/README.md @@ -0,0 +1,157 @@ +# Aesthetic Computer Xbox App + +A UWP/WinUI3 app that wraps aesthetic.computer for Xbox and Windows Store. + +## Prerequisites + +- Windows 10/11 +- Visual Studio 2022 with: + - .NET Desktop Development workload + - Universal Windows Platform development workload + - Windows 10/11 SDK (10.0.22621.0 or later) +- Xbox in Developer Mode ($19 one-time fee at [partner.microsoft.com](https://partner.microsoft.com)) + +## Setup + +### 1. Open in Visual Studio + +``` +Open xbox/AestheticComputer.sln in Visual Studio 2022 +``` + +### 2. Generate Assets + +You'll need these icon sizes in `Assets/`: +- `StoreLogo.png` - 50x50 +- `Square44x44Logo.png` - 44x44 +- `Square71x71Logo.png` - 71x71 (SmallTile) +- `Square150x150Logo.png` - 150x150 +- `Square310x310Logo.png` - 310x310 +- `Wide310x150Logo.png` - 310x150 +- `SplashScreen.png` - 620x300 + +Use your purple pal logo. VS can also auto-generate these from a single source. + +### 3. Configure Signing + +For testing: +- Right-click project → Properties → Package → Create test certificate + +For Store: +- Associate with your Partner Center app +- Project → Publish → Associate App with the Store + +## Deploy to Xbox + +### Enable Xbox Dev Mode + +1. On Xbox: **Settings → System → Console info** +2. Activate **Developer mode** (needs Partner Center registration) +3. Xbox restarts into Dev Mode + +### Find Xbox IP + +**Settings → General → Network settings → Advanced settings** + +### Deploy from Visual Studio + +1. **Debug → Remote Machine** +2. Enter Xbox IP address +3. First time: enter PIN shown on Xbox Dev Home +4. Press F5 to deploy and run + +### Deploy via Device Portal + +1. Open `https://:11443` in browser +2. Accept certificate warning +3. Go to **My games & apps → Add** +4. Upload the `.msix` package + +### Command Line Deploy + +```powershell +# Build first, then: +WinAppDeployCmd install -file "AestheticComputer.msix" -ip -pin +``` + +## Store Submission + +### 1. Partner Center Setup + +1. Go to [partner.microsoft.com](https://partner.microsoft.com) +2. Create new app: "Aesthetic Computer" +3. Reserve the name + +### 2. Associate App + +In Visual Studio: +- **Project → Publish → Associate App with the Store** +- Sign in and select your app + +### 3. Create Package + +- **Project → Publish → Create App Packages** +- Select "Microsoft Store (new app)" +- Choose x64 and ARM64 architectures +- Upload `.msixupload` to Partner Center + +### 4. Xbox Certification + +For Xbox, your app must: +- ✅ Work with gamepad only (no mouse required) +- ✅ Support 1080p and 4K +- ✅ Handle TV safe zones +- ✅ Pass Xbox Requirements Tests (XR) + +Run **Windows App Cert Kit** before submitting. + +## Gamepad Support + +The app injects `window.isXboxApp = true` into the page. + +In aesthetic.computer, you can check this: +```javascript +if (window.isXboxApp) { + // Xbox-specific UI adjustments +} +``` + +Standard gamepad API works - Xbox controller maps to browser Gamepad API. + +## Troubleshooting + +### "Cannot connect to remote machine" +- Ensure Xbox and PC are on same network +- Check Xbox IP in Dev Home app +- Disable any VPN + +### "Package deployment failed" +- Match package architecture to Xbox (usually x64) +- Check certificate is valid +- Ensure Xbox has enough storage + +### WebView2 issues +- Xbox includes Edge WebView2 runtime +- If issues, check Xbox OS is updated + +## Architecture + +``` +xbox/ +├── AestheticComputer.sln # Solution file +├── AestheticComputer/ +│ ├── AestheticComputer.csproj # Project file +│ ├── Package.appxmanifest # App manifest (icons, capabilities) +│ ├── App.xaml(.cs) # App entry point +│ ├── MainWindow.xaml(.cs) # WebView2 window +│ ├── app.manifest # Windows manifest +│ └── Assets/ # Icons and splash screens +└── README.md +``` + +## Links + +- [Xbox Dev Mode setup](https://learn.microsoft.com/en-us/windows/uwp/xbox-apps/devkit-activation) +- [Partner Center](https://partner.microsoft.com) +- [WebView2 docs](https://learn.microsoft.com/en-us/microsoft-edge/webview2/) +- [Xbox app requirements](https://learn.microsoft.com/en-us/windows/uwp/xbox-apps/system-resource-allocation)