13 unstable releases

new 0.7.0 Mar 23, 2024
0.6.1 Apr 14, 2023
0.6.0 Mar 27, 2023
0.5.0 Jun 12, 2021
0.3.2 Nov 15, 2018

#30 in Operating systems

Download history 68678/week @ 2023-12-06 67619/week @ 2023-12-13 58178/week @ 2023-12-20 54224/week @ 2023-12-27 70806/week @ 2024-01-03 69297/week @ 2024-01-10 72534/week @ 2024-01-17 73016/week @ 2024-01-24 81770/week @ 2024-01-31 90281/week @ 2024-02-07 90471/week @ 2024-02-14 92470/week @ 2024-02-21 106329/week @ 2024-02-28 103430/week @ 2024-03-06 106702/week @ 2024-03-13 86196/week @ 2024-03-20

418,384 downloads per month
Used in 352 crates (62 directly)

MIT/Apache

26KB
570 lines

Opener

This crate provides the ability to open a file or link with the default program configured on the system.

See the docs for more details:

Docs

License

Licensed under either of

at your option.

Third party software

See LICENSE-THIRD-PARTY

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

This crate provides the open function, which opens a file or link with the default program configured on the system:

// open a website
opener::open("https://www.rust-lang.org")?;

// open a file
opener::open("../Cargo.toml")?;

An open_browser function is also provided, for when you intend on opening a file or link in a browser, specifically. This function works like the open function, but explicitly allows overriding the browser launched by setting the $BROWSER environment variable.

Crate features

  • reveal - Enables usage of the reveal function. On Linux this will pull in the dbus crate. If the dbus-vendored feature is enabled (which it is by default), dbus will use static linking. Otherwise it will be dynamically linked, and some system dependencies will be required to build dbus and also to run any built binaries. Refer to the dbus docs for the specifics.
  • dbus-vendored - See the reveal feature.

Dependencies

~0–12MB
~105K SLoC