15 releases

0.7.2 Aug 6, 2024
0.7.1 May 18, 2024
0.7.0 Mar 23, 2024
0.6.1 Apr 14, 2023
0.3.2 Nov 15, 2018

#21 in Operating systems

Download history 102314/week @ 2024-07-18 106308/week @ 2024-07-25 105396/week @ 2024-08-01 107244/week @ 2024-08-08 101445/week @ 2024-08-15 110330/week @ 2024-08-22 106105/week @ 2024-08-29 122277/week @ 2024-09-05 106153/week @ 2024-09-12 106328/week @ 2024-09-19 113747/week @ 2024-09-26 116114/week @ 2024-10-03 124432/week @ 2024-10-10 128387/week @ 2024-10-17 126651/week @ 2024-10-24 115399/week @ 2024-10-31

515,338 downloads per month
Used in 409 crates (76 directly)

MIT/Apache

27KB
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–9.5MB
~89K SLoC