feat(linux): X11 support for the Rust/iced rewrite#54
Open
aweigold wants to merge 3 commits into
Open
Conversation
Add a Linux (X11) platform layer mirroring the win32/macos interface so the Rust/iced rewrite builds and runs on Linux. - src/linux.rs: X11 window focus + synthetic paste (XTEST) via x11rb; keyboard input by translating iced key events into HookKeyEvent (no global hook needed); cursor/screen queries and geometry. - Show/hide the window through iced's window commands (set_mode/move_to/ gain_focus) so winit actually renders it — mapping the window directly via X11 leaves the transparent window unrendered and invisible. - Gate the system tray off on Linux (tray-icon pulls GTK, which does not co-exist with the winit/iced event loop) and add a Settings -> Exit button as the quit affordance. - Cargo.toml: x11rb (xtest feature) for Linux; tray-icon restricted to non-Linux targets. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Configuration was stored under %APPDATA%, which is unset on Linux and macOS and silently fell back to the current working directory, so settings did not persist reliably. - Resolve the config directory per-platform: %APPDATA% on Windows, ~/Library/Application Support on macOS, and $XDG_CONFIG_HOME (or ~/.config) on Linux. - Implement launch-at-startup on Linux via an XDG autostart entry at $XDG_CONFIG_HOME/autostart/flemozi.desktop (created on enable, removed on disable). Windows keeps its Start Menu shortcut; macOS is a no-op for now (needs a LaunchAgent). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #53
What
Adds a Linux (X11) platform layer so Flemozi builds and runs on Linux (previously Windows/macOS only).
Changes
src/linux.rs(new) — X11 platform module mirroringwin32/macos:HookKeyEvent.windowcommands (set_mode/move_to/gain_focus) so winit renders the window.x11rb).tray-iconrestricted to non-Linux targets (it pulls GTK, which doesn't co-exist with the winit/iced loop); added a Settings → Exit button.src/config.rs: XDG config path (~/.config/flemozi) and an XDG autostart entry for launch-at-startup; also fixes the unset-%APPDATA%fallback on macOS.Cargo.toml:x11rb(xtest) for Linux;tray-iconfor non-Linux.docs/linux-support.md: design, limitations, and test plan.Testing (KDE Plasma / X11)
~/.config/autostart/flemozi.desktop(passesdesktop-file-validate); config persists to~/.config/flemozi/config.jsonKnown limitations (documented)
file://URI as text rather than embedding the file)🤖 Generated with Claude Code