Skip to content

Conversation

@RyderFreeman4Logos
Copy link

This pull request updates the conditional compilation settings in Cargo.toml, src/lib.rs, and src/platform/mod.rs. By removing Android from the exclusion list, the arboard library (and dependent applications such as sendme) can now compile successfully in Termux environments on Android.

Please note that this change is intended solely to enable the software to compile on Termux. If full clipboard functionality is required on Termux, it can be implemented relatively easily since Termux provides its own clipboard API.

Remove Android from the exclusion list in conditional configurations to allow successful compilation on Termux.
Note: This change is solely to enable compilation; if clipboard functionality is desired on Termux, it can be implemented easily using Termux’s API.
@complexspaces
Copy link
Member

Hi there,

Do you happen to know if the native Android ClipboardManager APIs (Java/Kotlin) work when running inside a Termux environment on Android, or do you need to use Termux's specific ones?

@RyderFreeman4Logos
Copy link
Author

Hi there,

Do you happen to know if the native Android ClipboardManager APIs (Java/Kotlin) work when running inside a Termux environment on Android, or do you need to use Termux's specific ones?

Hi there,

That's a great question regarding the clipboard implementation on Termux.

Based on my understanding, programs running within the standard Termux environment generally cannot directly invoke the native Android ClipboardManager APIs (Java/Kotlin). This necessitates using the Termux-specific mechanisms, such as the termux-clipboard-get and termux-clipboard-set commands, which I alluded to in the PR description.

Furthermore, it's important to note that even for these Termux commands (termux-clipboard-get/set) to function, the end-user must have the separate termux-api apk installed (available here: https://github.com/termux/termux-api) and grant it the appropriate permissions via the Android system. So, while using the Termux APIs is the path forward for clipboard interaction within this environment, it does come with this external dependency and user setup requirement.

Just to reiterate, my current PR focuses only on enabling compilation within Termux. The actual implementation of clipboard functionality using these Termux APIs (and handling the termux-api dependency) would be a separate, subsequent step.

Hope this information is helpful! Let me know if you have any other questions.

@complexspaces
Copy link
Member

Sorry for my delay, thanks for the additional information and context since I was very unfamiliar with Termux.

Please see #191 which describes the pre-requesties for Termux support getting merged, similar to #171. As mentioned there, my intent is to have pending platform backend additions all wrapped up no later then end of summer.

Hope this information is helpful! Let me know if you have any other questions.

I think you answered everything, thanks!

Just to reiterate, my current PR focuses only on enabling compilation within Termux. The actual implementation of clipboard functionality using these Termux APIs (and handling the termux-api dependency) would be a separate, subsequent step.

Under my current plan of making Termux an arboard tier 3 platform, this would be perfectly since it still compiles.

With that said, if the PRs will be split up, my strong preference would be to introduce the Cargo feature flagging required, or some other reliable mechanism for Termux detection, in this PR so its clear ahead of time how this backend will interact with the native app-hosted implementation. It may be good to draw some inspiration from how the Wayland and X11 split is done on Linux today.

@complexspaces complexspaces added O-Android Work related to an Android-supported clipboard implementation waiting on review The change is currently waiting on an arboard maintainer for a review or larger-scale update enhancement New feature or request labels Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request O-Android Work related to an Android-supported clipboard implementation waiting on review The change is currently waiting on an arboard maintainer for a review or larger-scale update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants