Skip to content

feat: add initial Linux platform support - #145

Merged
lambdalisue merged 3 commits into
arto-app:mainfrom
natsukium:feat/linux-support
Feb 23, 2026
Merged

feat: add initial Linux platform support#145
lambdalisue merged 3 commits into
arto-app:mainfrom
natsukium:feat/linux-support

Conversation

@natsukium

@natsukium natsukium commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add aarch64-linux and x86_64-linux targets to the Nix flake with WebKit, GTK, and XDG Portal dependencies
  • Patch dioxus-sdk-window to fix overlapping cfg conditions that cause duplicate function definitions on Linux (DioxusLabs/sdk#103)
  • Add #[cfg(target_os = "macos")] guards for macOS-specific code (tracing-oslog, window tabbing, Finder reveal)
  • Handle dark_light theme detection panic on Linux (D-Bus requires Tokio runtime, but detection runs before runtime starts)
  • Extend CI build matrix to include ubuntu-latest
  • Add platform-specific [linux] / [macos] markers to justfile recipes
  • Update README to document Linux experimental support and Nix installation for Linux

Note

This is experimental Linux support. Basic file browsing works, but some features (e.g. keybindings, automatic theme detection) still need development. Tested on NixOS with Wayland.

Current limitations

  • Linux installation is Nix-only for now
  • Binary distribution (deb, AppImage) and Homebrew/Linuxbrew are not yet available
  • Some features are macOS-specific and not yet ported (see below)

Known issues / not yet ported

  • Keybindings (platform-specific shortcuts)
  • Automatic theme detection (D-Bus runtime dependency)
  • Window tabbing (macOS-native feature)
  • Finder reveal (macOS-specific, needs xdg-open equivalent)

Future work (separate PRs)

  • Binary distribution for Linux (deb, AppImage) — just build can generate deb packages, but needs validation with dependencies
  • Homebrew/Linuxbrew support
  • Track and fix Linux-specific issues in Support Linux #16

Test plan

  • Verify nix build succeeds on Linux (aarch64-linux, x86_64-linux)
  • Verify nix build still succeeds on macOS (aarch64-darwin, x86_64-darwin)
  • Launch the app on Linux and confirm basic markdown file viewing works
  • Confirm CI passes on both ubuntu-latest and macos-latest

Related issues

Add aarch64-linux and x86_64-linux targets to flake with WebKit, GTK, and
XDG Portal dependencies. Patch dioxus-sdk-window to fix cfg condition
overlaps on Linux. Add macOS cfg guards for platform-specific code. Handle
dark_light theme detection before async runtime initialization.

Note: Linux support is early-stage. Keybinding and theme auto-detection
features still need development.
Enable build, open, and install tasks to support both Linux and macOS
by using just recipe markers [linux] and [macos]. This allows each
platform to use its native build commands and output paths.
Now that Linux platform support has been added, ensure the Nix build
works correctly on both platforms by testing in the CI matrix.
Copilot AI review requested due to automatic review settings February 23, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds initial Linux platform support to Arto, enabling the application to build and run on aarch64-linux and x86_64-linux systems. The changes focus on cross-platform compatibility by adding platform-specific build configurations, dependencies, and code guards while maintaining existing macOS functionality.

Changes:

  • Extended Nix flake to support Linux builds with WebKit, GTK, and XDG Portal dependencies
  • Added platform guards (#[cfg(target_os = "macos")]) for macOS-specific code (oslog, window tabbing, Finder operations)
  • Implemented workaround for Linux theme detection panic using catch_unwind
  • Extended CI build matrix to include ubuntu-latest

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
flake.nix Added Linux platform detection, build dependencies (WebKit, GTK, libsoup, glib, openssl, xdotool), and platform-specific build paths
desktop/src/lib.rs Added #[cfg(target_os = "macos")] guard for tracing-oslog dependency
desktop/src/menu.rs Added platform guard for NSWindow automatic tabbing disable function
desktop/src/utils/file_operations.rs Guarded std::process::Command import with macOS-only cfg attribute
desktop/src/theme.rs Added catch_unwind workaround for D-Bus panic when detecting theme on Linux before Tokio runtime starts
desktop/Cargo.toml Added xdg-portal feature to rfd and patched dioxus-sdk-window for Linux compatibility
desktop/Dioxus.toml Added PNG icon for Linux alongside existing macOS ICNS icon
desktop/justfile Added platform-specific [linux] and [macos] markers for build, open, and install recipes
justfile Added [macos] marker to install recipe
.github/workflows/build.yml Extended build-nix job with matrix strategy for ubuntu-latest and macos-latest

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread desktop/src/theme.rs
Comment on lines +32 to +34
Theme::Auto => match std::panic::catch_unwind(dark_light::detect)
.ok()
.and_then(|r| r.ok())

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using catch_unwind to handle the D-Bus panic on Linux is a workaround that masks the underlying issue. A more robust approach would be to use platform-specific implementations: on Linux, skip automatic theme detection if called before the Tokio runtime starts, or check if the runtime is available before calling dark_light::detect. This would avoid the overhead and uncertainty of panic catching. Consider adding a #[cfg(target_os = "linux")] guard to return a default theme or check runtime availability.

Copilot uses AI. Check for mistakes.
Comment thread flake.nix
@natsukium natsukium mentioned this pull request Feb 23, 2026
@lambdalisue
lambdalisue merged commit ecc2a7f into arto-app:main Feb 23, 2026
10 of 11 checks passed
@lambdalisue

Copy link
Copy Markdown
Member

Thanks 🎉

@natsukium
natsukium deleted the feat/linux-support branch February 23, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants