From ac4ef78c022dc9be63a88ad33adc48efbf1b8de9 Mon Sep 17 00:00:00 2001 From: TomiEckert Date: Sat, 28 Feb 2026 14:08:00 +0100 Subject: [PATCH] feat: dynamically suggest typing backend based on XDG_SESSION_TYPE detection --- Commands/OnboardCommand.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Commands/OnboardCommand.cs b/Commands/OnboardCommand.cs index 985811f..a6f9c81 100644 --- a/Commands/OnboardCommand.cs +++ b/Commands/OnboardCommand.cs @@ -50,10 +50,14 @@ public static class OnboardCommand return ValidationResult.Success(); })); + var sessionType = Environment.GetEnvironmentVariable("XDG_SESSION_TYPE")?.ToLowerInvariant(); + var defaultBackend = sessionType == "wayland" ? "wtype" : "xdotool"; + var otherBackend = defaultBackend == "wtype" ? "xdotool" : "wtype"; + config.TypingBackend = AnsiConsole.Prompt( new SelectionPrompt() - .Title("Select [green]Typing Backend[/]:") - .AddChoices(new[] { "wtype", "xdotool" })); + .Title($"Select [green]Typing Backend[/] (Detected: {sessionType}):") + .AddChoices(new[] { defaultBackend, otherBackend })); var availableSkills = SkillRegistry.AllSkills.Select(s => s.Name).ToList();