Lyo.Desktop
3.0.0
dotnet add package Lyo.Desktop --version 3.0.0
NuGet\Install-Package Lyo.Desktop -Version 3.0.0
<PackageReference Include="Lyo.Desktop" Version="3.0.0" />
<PackageVersion Include="Lyo.Desktop" Version="3.0.0" />
<PackageReference Include="Lyo.Desktop" />
paket add Lyo.Desktop --version 3.0.0
#r "nuget: Lyo.Desktop, 3.0.0"
#:package Lyo.Desktop@3.0.0
#addin nuget:?package=Lyo.Desktop&version=3.0.0
#tool nuget:?package=Lyo.Desktop&version=3.0.0
Lyo.Desktop
HotkeyChord parses a settings string such as Ctrl+Shift+W. GlobalHotkeys.Create grabs those chords on the X root window or with RegisterHotKey, so they fire while another
window is focused. Bind replaces the whole set. An empty list releases every grab. Caps Lock and Num Lock do not change which chord matches. Call
GlobalHotkeys.InitializeThreading before any other X11 use, including Avalonia startup. DesktopClipboard reads and writes text, and writes a PNG. DesktopWindows lists, finds,
and raises top-level windows. DesktopInput moves the pointer, clicks, and sends keys. Linux uses X11 and XTest. Windows uses Win32. Wayland without DISPLAY can still use the
clipboard tools. X11WindowPlace moves a mapped window when a plain configure would be dropped. DesktopConfig.File is the path of a JSON file under $XDG_CONFIG_HOME/lyo or
%AppData%\Lyo.
Features
- Chords.
HotkeyChord.Parseaccepts modifiers in any order. A single-letter key is stored in upper case.ToStringwrites Ctrl, Shift, Alt, then Meta. - Grab.
IGlobalHotkeys.Bindreplaces the grabbed chords. The same chord cannot appear twice. A chord another program already owns throws. The message is that the shortcut is already in use. - Clipboard.
DesktopClipboard.SetTextAsyncpreferswl-copy, thenxclip, thenxsel. Windows writes withclip.exeand reads with Win32.SetPngAsyncoffersimage/pngon Linux and a bitmap on Windows. - Windows.
DesktopWindows.Listreturns top-level windows.Findmatches a title substring and skips a blank title.Activateraises the window. An id of 0 throws. - Input.
DesktopInput.Clickmoves, presses, and releases.Sendtypes text or one chord. Modifiers go down first and come up last. - Place.
X11WindowPlace.TryPlacesends_NET_MOVERESIZE_WINDOW. A width or height of 0 leaves that axis alone.HasTitleBarreads_NET_FRAME_EXTENTS. - Config.
DesktopConfig.File("screenshot.json")is%AppData%\Lyo\screenshot.jsonon Windows. Elsewhere it is$XDG_CONFIG_HOME/lyo/screenshot.json, or~/.config/lyo/screenshot.jsonwhen that variable is unset.
Examples
Parse a hotkey
var chord = HotkeyChord.Parse("Ctrl+Shift+W");
Console.WriteLine(chord);
Grab start and stop
GlobalHotkeys.InitializeThreading();
using var keys = GlobalHotkeys.Create();
keys.Bind([
new(HotkeyChord.Parse("Ctrl+Shift+W"), Start),
new(HotkeyChord.Parse("Ctrl+Shift+Q"), Stop)
]);
Copy text
await DesktopClipboard.SetTextAsync("hello");
var text = await DesktopClipboard.GetTextAsync();
Find and click
var editor = DesktopWindows.Find(DesktopWindows.List(), "Editor");
if (editor is not null)
{
DesktopWindows.Activate(editor.Value.Id);
DesktopInput.Click(editor.Value.Bounds.X + 8, editor.Value.Bounds.Y + 8);
}
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Exceptions(direct, lyo)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Lyo.Exceptions (>= 3.0.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Lyo.Desktop:
| Package | Downloads |
|---|---|
|
Lyo.Avalonia.Components
Shared Avalonia controls for Lyo desktop apps. Tool windows dock inside a window. A window can dock to a screen edge. |
|
|
Lyo.FileManager
Desktop file manager session for a remote FileStorage API or a local disk store. |
|
|
Lyo.Screenshot
Region screen capture for Linux and Windows, with still PNG, animated GIF, and scrolling receipt stitch. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 50 | 10/23/2026 |