A library to get information about menubar.
This lib requires a Rust version of at least 1.64
There are three general methods of installation that we can recommend.
- Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
- Pull sources directly from Github using git tags / revision hashes (most secure)
- Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)
Install the Core plugin by adding the following to your Cargo.toml
file:
src-tauri/Cargo.toml
[dependencies]
menubar = { git = "https://github.com/ahkohd/tauri-toolkit", branch = "v2" }
use menubar::get_menubar;
fn main() {
let menubar = get_menubar();
}
get_menubar() -> Menubar
: Get info about the system-wide Menubar.
The struct Menubar provides properties are defined as follows:
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Menubar {
height: f64,
}
It includes the following fields:
height
: the height of the menubar
Menubar
struct provides the following methods to fetch its attributes:
height(&self) -> f64
: This method returns the height.
To use any of these methods, you need to have an instance of a Menubar
.
For example:
let menubar_height = menubar.height();
PRs accepted. Please make sure to read the Contributing Guide before making a pull request.
MIT or MIT/Apache 2.0 where applicable