Merge branch 'release/0.5.0'
This commit is contained in:
commit
44cff9187a
7 changed files with 602 additions and 383 deletions
729
Cargo.lock
generated
729
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
28
Cargo.toml
28
Cargo.toml
|
@ -1,26 +1,26 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ha-now-playing"
|
name = "ha-now-playing"
|
||||||
description = "Retrieves the state of a media_player entity from Home Assistant"
|
description = "Retrieves the state of a media_player entity from Home Assistant"
|
||||||
version = "0.4.7"
|
version = "0.5.0"
|
||||||
authors = ["Erwin Boskma <erwin@datarift.nl>"]
|
authors = ["Erwin Boskma <erwin@datarift.nl>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
include = ["src/**/*"]
|
include = ["src/**/*"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.56"
|
anyhow = "1.0.71"
|
||||||
async-tungstenite = { version = "0.18.0", features = ["tokio-rustls-native-certs"] }
|
async-tungstenite = { version = "0.22.2", features = ["tokio-rustls-native-certs"] }
|
||||||
clap = { version = "4.0.27", features = ["cargo", "unicode", "derive", "env", "wrap_help"] }
|
clap = { version = "4.3.10", features = ["cargo", "unicode", "derive", "env", "wrap_help"] }
|
||||||
color-eyre = "0.6.1"
|
color-eyre = "0.6.2"
|
||||||
futures = "0.3.21"
|
futures = "0.3.28"
|
||||||
reqwest = { version = "0.11.10", features = ["blocking", "json"] }
|
reqwest = { version = "0.11.18", features = ["blocking", "json"] }
|
||||||
serde = { version = "1.0.136", features = ["derive"] }
|
serde = { version = "1.0.165", features = ["derive"] }
|
||||||
serde_json = "1.0.79"
|
serde_json = "1.0.99"
|
||||||
thiserror = "1.0.30"
|
thiserror = "1.0.40"
|
||||||
tokio = { version = "1.17.0", features = ["full"] }
|
tokio = { version = "1.29.1", features = ["full"] }
|
||||||
tracing = "0.1.32"
|
tracing = "0.1.37"
|
||||||
tracing-error = "0.2.0"
|
tracing-error = "0.2.0"
|
||||||
tracing-subscriber = { version = "0.3.9", features = ["env-filter", "registry"] }
|
tracing-subscriber = { version = "0.3.17", features = ["env-filter", "registry"] }
|
||||||
tracing-tree = "0.2.0"
|
tracing-tree = "0.2.3"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = "z"
|
opt-level = "z"
|
||||||
|
|
130
flake.lock
130
flake.lock
|
@ -1,13 +1,56 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"crane": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": [
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-overlay": [
|
||||||
|
"rust-overlay"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681680516,
|
||||||
|
"narHash": "sha256-EB8Adaeg4zgcYDJn9sR6UMjN/OHdIiMMK19+3LmmXQY=",
|
||||||
|
"owner": "ipetkov",
|
||||||
|
"repo": "crane",
|
||||||
|
"rev": "54b63c8eae4c50172cb50b612946ff1d2bc1c75c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "ipetkov",
|
||||||
|
"repo": "crane",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668681692,
|
"lastModified": 1673956053,
|
||||||
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_2": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1673956053,
|
||||||
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -17,12 +60,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1681202837,
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -52,34 +98,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"naersk": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1662220400,
|
|
||||||
"narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=",
|
|
||||||
"owner": "nmattia",
|
|
||||||
"repo": "naersk",
|
|
||||||
"rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nmattia",
|
|
||||||
"ref": "master",
|
|
||||||
"repo": "naersk",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1669542132,
|
"lastModified": 1681737997,
|
||||||
"narHash": "sha256-DRlg++NJAwPh8io3ExBJdNW7Djs3plVI5jgYQ+iXAZQ=",
|
"narHash": "sha256-pHhjgsIkRMu80LmVe8QoKIZB6VZGRRxFmIvsC5S89k4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a115bb9bd56831941be3776c8a94005867f316a7",
|
"rev": "f00994e78cd39e6fc966f0c4103f908e63284780",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -91,27 +116,27 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668984258,
|
"lastModified": 1678872516,
|
||||||
"narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=",
|
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a",
|
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-22.05",
|
"ref": "nixos-22.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668994630,
|
"lastModified": 1681303793,
|
||||||
"narHash": "sha256-1lqx6HLyw6fMNX/hXrrETG1vMvZRGm2XVC9O/Jt0T6c=",
|
"narHash": "sha256-JEdQHsYuCfRL2PICHlOiH/2ue3DwoxUX7DJ6zZxZXFk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "af50806f7c6ab40df3e6b239099e8f8385f6c78b",
|
"rev": "fe2ecaf706a5907b5e54d979fbde4924d84b65fc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -123,7 +148,7 @@
|
||||||
},
|
},
|
||||||
"pre-commit-hooks": {
|
"pre-commit-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat_2",
|
||||||
"flake-utils": [
|
"flake-utils": [
|
||||||
"flake-utils"
|
"flake-utils"
|
||||||
],
|
],
|
||||||
|
@ -132,11 +157,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1669152228,
|
"lastModified": 1681831107,
|
||||||
"narHash": "sha256-FEDReoTLWJHXcNso7aaAlAUU7uOqIR6Hc/C/nqlfooE=",
|
"narHash": "sha256-pXl3DPhhul9NztSetUJw2fcN+RI3sGOYgKu29xpgnqw=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "078b0dee35e2da01334af682ec347463b70a9986",
|
"rev": "b7ca8f6fff42f6af75c17f9438fed1686b7d855d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -147,8 +172,8 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"crane": "crane",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"naersk": "naersk",
|
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"pre-commit-hooks": "pre-commit-hooks",
|
"pre-commit-hooks": "pre-commit-hooks",
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
|
@ -164,11 +189,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1669602829,
|
"lastModified": 1681870826,
|
||||||
"narHash": "sha256-I3LBvBiVui4Rf0iQvTqUIgBovaLDzpOzsoNEzCsDowg=",
|
"narHash": "sha256-1YEXIdr5wwG8PWntvcjjoVpsAKOKuKEaFIy3vR0FGpo=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "b9da8e68a08707115be750c0cf7ade33f49d8ec4",
|
"rev": "e2f975856a48ebecba4f95846b8f368f3808d4e7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -176,6 +201,21 @@
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
81
flake.nix
81
flake.nix
|
@ -3,10 +3,7 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
naersk = {
|
|
||||||
url = "github:nmattia/naersk/master";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
rust-overlay = {
|
rust-overlay = {
|
||||||
url = "github:oxalica/rust-overlay";
|
url = "github:oxalica/rust-overlay";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
@ -16,48 +13,46 @@
|
||||||
url = "github:cachix/pre-commit-hooks.nix";
|
url = "github:cachix/pre-commit-hooks.nix";
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
crane = {
|
||||||
|
url = "github:ipetkov/crane";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
|
inputs.rust-overlay.follows = "rust-overlay";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, naersk, rust-overlay, pre-commit-hooks }:
|
outputs = { self, nixpkgs, flake-utils, rust-overlay, pre-commit-hooks, crane }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
overlays = [ (import rust-overlay) ];
|
overlays = [ (import rust-overlay) ];
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
pkgs = import nixpkgs { inherit system overlays; };
|
||||||
naersk-lib = pkgs.callPackage naersk { };
|
|
||||||
rustToolchain =
|
rustToolchain =
|
||||||
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||||
|
|
||||||
|
crane-lib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
|
||||||
|
src = crane-lib.cleanCargoSource ./.;
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
openssl
|
||||||
|
] ++ lib.optionals pkgs.stdenv.isDarwin [ pkgs.libiconv ];
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
pkgconf
|
||||||
|
];
|
||||||
|
|
||||||
|
cargoArtifacts = crane-lib.buildDepsOnly {
|
||||||
|
inherit src buildInputs nativeBuildInputs;
|
||||||
|
};
|
||||||
|
|
||||||
|
ha-now-playing = crane-lib.buildPackage {
|
||||||
|
inherit cargoArtifacts src buildInputs nativeBuildInputs;
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
formatter = pkgs.nixpkgs-fmt;
|
formatter = pkgs.nixpkgs-fmt;
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
ha-now-playing = (naersk-lib.override {
|
inherit ha-now-playing;
|
||||||
cargo = rustToolchain;
|
|
||||||
rustc = rustToolchain;
|
|
||||||
}).buildPackage
|
|
||||||
{
|
|
||||||
pname = "ha-now-playing";
|
|
||||||
root = ./.;
|
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
rustToolchain
|
|
||||||
openssl
|
|
||||||
];
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
pkgconf
|
|
||||||
cargo-edit
|
|
||||||
cargo-expand
|
|
||||||
cargo-diet
|
|
||||||
cargo-feature
|
|
||||||
cargo-outdated
|
|
||||||
rust-analyzer
|
|
||||||
pre-commit
|
|
||||||
jq
|
|
||||||
gitflow
|
|
||||||
yaml-language-server
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
packages.default = self.packages.${system}.ha-now-playing;
|
packages.default = self.packages.${system}.ha-now-playing;
|
||||||
|
|
||||||
|
@ -71,6 +66,17 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
checks = {
|
checks = {
|
||||||
|
inherit ha-now-playing;
|
||||||
|
|
||||||
|
ha-now-playing-clippy = crane-lib.cargoClippy {
|
||||||
|
inherit cargoArtifacts src buildInputs nativeBuildInputs;
|
||||||
|
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||||
|
};
|
||||||
|
|
||||||
|
ha-now-playing-fmt = crane-lib.cargoFmt {
|
||||||
|
inherit src;
|
||||||
|
};
|
||||||
|
|
||||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
hooks = {
|
hooks = {
|
||||||
|
@ -97,6 +103,17 @@
|
||||||
|
|
||||||
name = "ha-now-playing";
|
name = "ha-now-playing";
|
||||||
inputsFrom = [ self.packages.${system}.ha-now-playing ];
|
inputsFrom = [ self.packages.${system}.ha-now-playing ];
|
||||||
|
packages = [
|
||||||
|
rustToolchain
|
||||||
|
cargo-edit
|
||||||
|
cargo-diet
|
||||||
|
cargo-feature
|
||||||
|
cargo-outdated
|
||||||
|
pre-commit
|
||||||
|
rust-analyzer
|
||||||
|
taplo
|
||||||
|
gitflow
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -427,6 +427,7 @@ impl HomeAssistant {
|
||||||
OutputFormat::Waybar => Waybar::builder()
|
OutputFormat::Waybar => Waybar::builder()
|
||||||
.text(text)
|
.text(text)
|
||||||
.percentage((volume_raw * 100.) as u8)
|
.percentage((volume_raw * 100.) as u8)
|
||||||
|
.muted(is_muted)
|
||||||
.build()
|
.build()
|
||||||
.to_string(),
|
.to_string(),
|
||||||
OutputFormat::I3Blocks => I3Blocks::builder().text(text).build().to_string(),
|
OutputFormat::I3Blocks => I3Blocks::builder().text(text).build().to_string(),
|
||||||
|
|
|
@ -103,11 +103,15 @@ async fn main() -> Result<()> {
|
||||||
let token = if let Some(token) = token {
|
let token = if let Some(token) = token {
|
||||||
Some(token)
|
Some(token)
|
||||||
} else if let Some(token_file) = token_file {
|
} else if let Some(token_file) = token_file {
|
||||||
if let Ok(mut file) = std::fs::File::open(token_file) {
|
if let Ok(mut file) = std::fs::File::open(token_file.clone()) {
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
file.read_to_string(&mut buf).ok();
|
file.read_to_string(&mut buf).ok();
|
||||||
Some(buf)
|
Some(buf)
|
||||||
} else {
|
} else {
|
||||||
|
println!(
|
||||||
|
"Error reading API token file '{}'",
|
||||||
|
token_file.as_path().display()
|
||||||
|
);
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -130,7 +134,7 @@ async fn main() -> Result<()> {
|
||||||
.insecure(insecure)
|
.insecure(insecure)
|
||||||
.format(format)
|
.format(format)
|
||||||
.build();
|
.build();
|
||||||
ha.open_connection().await.unwrap();
|
ha.open_connection().await.unwrap_or(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -11,6 +11,7 @@ pub(crate) struct WaybarBuilder {
|
||||||
tooltip: String,
|
tooltip: String,
|
||||||
class: String,
|
class: String,
|
||||||
percentage: u8,
|
percentage: u8,
|
||||||
|
muted: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WaybarBuilder {
|
impl WaybarBuilder {
|
||||||
|
@ -43,6 +44,11 @@ impl WaybarBuilder {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn muted(mut self, muted: bool) -> Self {
|
||||||
|
self.muted = muted;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn build(self) -> Waybar {
|
pub(crate) fn build(self) -> Waybar {
|
||||||
Waybar {
|
Waybar {
|
||||||
text: self.text,
|
text: self.text,
|
||||||
|
@ -50,6 +56,7 @@ impl WaybarBuilder {
|
||||||
tooltip: self.tooltip,
|
tooltip: self.tooltip,
|
||||||
class: self.class,
|
class: self.class,
|
||||||
percentage: self.percentage,
|
percentage: self.percentage,
|
||||||
|
muted: self.muted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +68,7 @@ pub(crate) struct Waybar {
|
||||||
tooltip: String,
|
tooltip: String,
|
||||||
class: String,
|
class: String,
|
||||||
percentage: u8,
|
percentage: u8,
|
||||||
|
muted: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Waybar {
|
impl Waybar {
|
||||||
|
|
Loading…
Reference in a new issue