termuxapi 0.1.1

Termux:Api Wrapper
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::*;

/// Get the system clipboard text.
pub fn get() -> io::Result<String> {
    run_api_cmd("Clipboard")
}

/// Set the system clipboard text.
pub fn set(text: &str) -> io::Result<()> {
    run_cmd("termux-clipboard-set", text)
}

#[test]
fn test_set_and_get() {
    let _ = set("Some text...\nSome more text...");
    assert_eq!(&get().unwrap(), "Some text...\nSome more text...")
}