#linux #macos #windows

selection

Get the text selected by the cursor

4 stable releases

1.2.0 May 5, 2024
1.1.1 Dec 23, 2023
1.1.0 Nov 14, 2023
1.0.0 Sep 7, 2023
0.1.0 Sep 7, 2023

#362 in GUI

Download history 48/week @ 2024-04-01 89/week @ 2024-04-08 99/week @ 2024-04-15 58/week @ 2024-04-22 228/week @ 2024-04-29 75/week @ 2024-05-06 13/week @ 2024-05-13 21/week @ 2024-05-20 8/week @ 2024-05-27 51/week @ 2024-06-03 70/week @ 2024-06-10 267/week @ 2024-06-17 246/week @ 2024-06-24 67/week @ 2024-07-01 62/week @ 2024-07-08 101/week @ 2024-07-15

581 downloads per month

GPL-3.0-only

17KB
310 lines

Selection

Get the text selected by the cursor

Example

selection = "1.2.0"
use selection::get_text;

fn main() {
    // Return the selected text on success
    // Otherwise return the empty string
    let text = get_text();
    println!("{}", text);
}

Support Platform

  • Windows
  • MacOS
  • Linux
    • X11
    • Wayland

Implementation details

Windows

  • Automation API
  • Clipboard

MacOS

  • Accessibility API
  • Clipboard

Linux

  • Primary Clipboard
    • X11: x11-clipboard
    • Wayland: wl-clipboard

Dependencies

~0–47MB
~701K SLoC