mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-04-19 11:24:24 +02:00
Merge branch 'master' into develop
This commit is contained in:
commit
3e7e7c0e94
16 changed files with 439 additions and 218 deletions
4
.github/workflows/update-nix-flake-lock.yml
vendored
4
.github/workflows/update-nix-flake-lock.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: update-nix-flake-lock
|
name: Update Nix Flake lock
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # allows manual triggering
|
workflow_dispatch: # allows manual triggering
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -19,7 +19,7 @@ jobs:
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Update flake.lock
|
- name: Update flake.lock
|
||||||
uses: DeterminateSystems/update-flake-lock@v15
|
uses: DeterminateSystems/update-flake-lock@v23
|
||||||
with:
|
with:
|
||||||
pr-title: "Update flake.lock" # Title of PR to be created
|
pr-title: "Update flake.lock" # Title of PR to be created
|
||||||
pr-labels: | # Labels to be set on the PR
|
pr-labels: | # Labels to be set on the PR
|
||||||
|
|
147
Cargo.lock
generated
147
Cargo.lock
generated
|
@ -435,6 +435,12 @@ version = "1.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg_aliases"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg_aliases"
|
name = "cfg_aliases"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
|
@ -456,9 +462,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.7"
|
version = "4.5.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f"
|
checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
|
@ -466,9 +472,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.7"
|
version = "4.5.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f"
|
checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
|
@ -478,9 +484,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "4.5.5"
|
version = "4.5.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6"
|
checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.5.0",
|
"heck 0.5.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
@ -616,11 +622,11 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ctrlc"
|
name = "ctrlc"
|
||||||
version = "3.4.2"
|
version = "3.4.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b"
|
checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nix 0.27.1",
|
"nix 0.28.0",
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -676,6 +682,15 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "deranged"
|
||||||
|
version = "0.3.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
|
||||||
|
dependencies = [
|
||||||
|
"powerfmt",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derivative"
|
name = "derivative"
|
||||||
version = "2.2.0"
|
version = "2.2.0"
|
||||||
|
@ -1014,9 +1029,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-signals"
|
name = "futures-signals"
|
||||||
version = "0.3.33"
|
version = "0.3.34"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3b175f2f6600dd81d92d20cf10872b03ea9df6b2513ca7f672341260dacb1ab2"
|
checksum = "70abe9c40a0dccd69bf7c59ba58714ebeb6c15a88143a10c6be7130e895f1696"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"discard",
|
"discard",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
|
@ -1268,9 +1283,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gtk-layer-shell"
|
name = "gtk-layer-shell"
|
||||||
version = "0.8.0"
|
version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "19fd93acba7b8ea8918fc564843a22cd1eeffe234b85a8c7d5732c611a425bb0"
|
checksum = "adb41643070b55cdda5a4a10a338520cff4345395e342b754c02f341e4107383"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.0",
|
||||||
"gdk",
|
"gdk",
|
||||||
|
@ -1382,9 +1397,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.3.1"
|
version = "0.3.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
|
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hex"
|
name = "hex"
|
||||||
|
@ -1581,9 +1596,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "indexmap"
|
||||||
version = "2.2.6"
|
version = "2.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
|
checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown",
|
"hashbrown",
|
||||||
|
@ -1625,7 +1640,7 @@ version = "1.0.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
|
checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi 0.3.1",
|
"hermit-abi 0.3.9",
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
@ -1672,6 +1687,7 @@ dependencies = [
|
||||||
"swayipc-async",
|
"swayipc-async",
|
||||||
"sysinfo",
|
"sysinfo",
|
||||||
"system-tray",
|
"system-tray",
|
||||||
|
"time",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-appender",
|
"tracing-appender",
|
||||||
|
@ -1815,9 +1831,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lua-src"
|
name = "lua-src"
|
||||||
version = "546.0.2"
|
version = "547.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2da0daa7eee611a4c30c8f5ee31af55266e26e573971ba9336d2993e2da129b2"
|
checksum = "1edaf29e3517b49b8b746701e5648ccb5785cde1c119062cbabbc5d5cd115e42"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
]
|
]
|
||||||
|
@ -1897,6 +1913,18 @@ dependencies = [
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mio"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi 0.3.9",
|
||||||
|
"libc",
|
||||||
|
"wasi",
|
||||||
|
"windows-sys 0.52.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mlua"
|
name = "mlua"
|
||||||
version = "0.9.9"
|
version = "0.9.9"
|
||||||
|
@ -2004,12 +2032,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nix"
|
name = "nix"
|
||||||
version = "0.27.1"
|
version = "0.28.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
|
checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.0",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
"cfg_aliases 0.1.1",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2021,7 +2050,7 @@ checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.0",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cfg_aliases",
|
"cfg_aliases 0.2.1",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2047,7 +2076,7 @@ dependencies = [
|
||||||
"kqueue",
|
"kqueue",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"mio",
|
"mio 0.8.11",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
@ -2071,6 +2100,12 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-conv"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-derive"
|
name = "num-derive"
|
||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
|
@ -2118,9 +2153,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl"
|
name = "openssl"
|
||||||
version = "0.10.64"
|
version = "0.10.66"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f"
|
checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.0",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
@ -2150,9 +2185,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl-sys"
|
name = "openssl-sys"
|
||||||
version = "0.9.101"
|
version = "0.9.103"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff"
|
checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
|
@ -2343,6 +2378,12 @@ dependencies = [
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "powerfmt"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ppv-lite86"
|
name = "ppv-lite86"
|
||||||
version = "0.2.17"
|
version = "0.2.17"
|
||||||
|
@ -2514,9 +2555,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.10.5"
|
version = "1.10.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
|
checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
|
@ -2802,18 +2843,18 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.203"
|
version = "1.0.204"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
|
checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.203"
|
version = "1.0.204"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
|
checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.35",
|
"quote 1.0.35",
|
||||||
|
@ -2833,11 +2874,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.117"
|
version = "1.0.122"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3"
|
checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
|
"memchr",
|
||||||
"ryu",
|
"ryu",
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
@ -3195,11 +3237,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.3.20"
|
version = "0.3.36"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890"
|
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"deranged",
|
||||||
"itoa",
|
"itoa",
|
||||||
|
"num-conv",
|
||||||
|
"powerfmt",
|
||||||
"serde",
|
"serde",
|
||||||
"time-core",
|
"time-core",
|
||||||
"time-macros",
|
"time-macros",
|
||||||
|
@ -3207,16 +3252,17 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time-core"
|
name = "time-core"
|
||||||
version = "0.1.0"
|
version = "0.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd"
|
checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time-macros"
|
name = "time-macros"
|
||||||
version = "0.2.8"
|
version = "0.2.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36"
|
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"num-conv",
|
||||||
"time-core",
|
"time-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3237,28 +3283,27 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.38.0"
|
version = "1.39.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
|
checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bytes",
|
"bytes",
|
||||||
"libc",
|
"libc",
|
||||||
"mio",
|
"mio 1.0.1",
|
||||||
"num_cpus",
|
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
"socket2 0.5.5",
|
"socket2 0.5.5",
|
||||||
"tokio-macros",
|
"tokio-macros",
|
||||||
"tracing",
|
"tracing",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-macros"
|
name = "tokio-macros"
|
||||||
version = "2.3.0"
|
version = "2.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
|
checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.35",
|
"quote 1.0.35",
|
||||||
|
@ -3602,9 +3647,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "1.9.1"
|
version = "1.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439"
|
checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom",
|
||||||
]
|
]
|
||||||
|
|
32
Cargo.toml
32
Cargo.toml
|
@ -20,7 +20,7 @@ default = [
|
||||||
"ipc",
|
"ipc",
|
||||||
"launcher",
|
"launcher",
|
||||||
"music+all",
|
"music+all",
|
||||||
"networkmanager",
|
"network_manager",
|
||||||
"notifications",
|
"notifications",
|
||||||
"sys_info",
|
"sys_info",
|
||||||
"tray",
|
"tray",
|
||||||
|
@ -62,7 +62,7 @@ music = ["regex"]
|
||||||
"music+mpris" = ["music", "mpris"]
|
"music+mpris" = ["music", "mpris"]
|
||||||
"music+mpd" = ["music", "mpd-utils"]
|
"music+mpd" = ["music", "mpd-utils"]
|
||||||
|
|
||||||
networkmanager = ["futures-lite", "futures-signals", "zbus"]
|
network_manager = ["futures-lite", "futures-signals", "zbus"]
|
||||||
|
|
||||||
notifications = ["zbus"]
|
notifications = ["zbus"]
|
||||||
|
|
||||||
|
@ -84,9 +84,9 @@ schema = ["dep:schemars"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# core
|
# core
|
||||||
gtk = "0.18.1"
|
gtk = "0.18.1"
|
||||||
gtk-layer-shell = "0.8.0"
|
gtk-layer-shell = "0.8.1"
|
||||||
glib = "0.18.5"
|
glib = "0.18.5"
|
||||||
tokio = { version = "1.38.0", features = [
|
tokio = { version = "1.39.2", features = [
|
||||||
"macros",
|
"macros",
|
||||||
"rt-multi-thread",
|
"rt-multi-thread",
|
||||||
"time",
|
"time",
|
||||||
|
@ -101,8 +101,8 @@ tracing-error = { version = "0.2.0" , default-features = false }
|
||||||
tracing-appender = "0.2.3"
|
tracing-appender = "0.2.3"
|
||||||
strip-ansi-escapes = "0.2.0"
|
strip-ansi-escapes = "0.2.0"
|
||||||
color-eyre = "0.6.3"
|
color-eyre = "0.6.3"
|
||||||
serde = { version = "1.0.203", features = ["derive"] }
|
serde = { version = "1.0.204", features = ["derive"] }
|
||||||
indexmap = "2.2.6"
|
indexmap = "2.3.0"
|
||||||
dirs = "5.0.1"
|
dirs = "5.0.1"
|
||||||
walkdir = "2.5.0"
|
walkdir = "2.5.0"
|
||||||
notify = { version = "6.1.1", default-features = false }
|
notify = { version = "6.1.1", default-features = false }
|
||||||
|
@ -112,20 +112,20 @@ smithay-client-toolkit = { version = "0.18.1", default-features = false, feature
|
||||||
"calloop",
|
"calloop",
|
||||||
] }
|
] }
|
||||||
universal-config = { version = "0.5.0", default-features = false }
|
universal-config = { version = "0.5.0", default-features = false }
|
||||||
ctrlc = "3.4.2"
|
ctrlc = "3.4.4"
|
||||||
cfg-if = "1.0.0"
|
cfg-if = "1.0.0"
|
||||||
|
|
||||||
# cli
|
# cli
|
||||||
clap = { version = "4.5.7", optional = true, features = ["derive"] }
|
clap = { version = "4.5.13", optional = true, features = ["derive"] }
|
||||||
|
|
||||||
# ipc
|
# ipc
|
||||||
serde_json = { version = "1.0.117", optional = true }
|
serde_json = { version = "1.0.122", optional = true }
|
||||||
|
|
||||||
# http
|
# http
|
||||||
reqwest = { version = "0.12.5", default-features = false, features = ["default-tls", "http2"], optional = true }
|
reqwest = { version = "0.12.5", default-features = false, features = ["default-tls", "http2"], optional = true }
|
||||||
|
|
||||||
# cairo
|
# cairo
|
||||||
lua-src = { version = "546.0.2", optional = true }
|
lua-src = { version = "547.0.0", optional = true }
|
||||||
mlua = { version = "0.9.9", optional = true, features = ["luajit"] }
|
mlua = { version = "0.9.9", optional = true, features = ["luajit"] }
|
||||||
cairo-rs = { version = "0.18.5", optional = true, features = ["png"] }
|
cairo-rs = { version = "0.18.5", optional = true, features = ["png"] }
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ chrono = { version = "0.4.38", optional = true, default-features = false, featur
|
||||||
mpd-utils = { version = "0.2.1", optional = true }
|
mpd-utils = { version = "0.2.1", optional = true }
|
||||||
mpris = { version = "2.0.1", optional = true }
|
mpris = { version = "2.0.1", optional = true }
|
||||||
|
|
||||||
# networkmanager
|
# network_manager
|
||||||
futures-signals = { version = "0.3.33", optional = true }
|
futures-signals = { version = "0.3.33", optional = true }
|
||||||
|
|
||||||
# sys_info
|
# sys_info
|
||||||
|
@ -160,11 +160,15 @@ hyprland = { version = "0.4.0-alpha.2", features = ["silent"], optional = true }
|
||||||
futures-util = { version = "0.3.30", optional = true }
|
futures-util = { version = "0.3.30", optional = true }
|
||||||
|
|
||||||
# shared
|
# shared
|
||||||
futures-lite = { version = "2.3.0", optional = true } # networkmanager, upower, workspaces
|
futures-lite = { version = "2.3.0", optional = true } # network_manager, upower, workspaces
|
||||||
regex = { version = "1.10.5", default-features = false, features = [
|
regex = { version = "1.10.6", default-features = false, features = [
|
||||||
"std",
|
"std",
|
||||||
], optional = true } # music, sys_info
|
], optional = true } # music, sys_info
|
||||||
zbus = { version = "3.15.2", default-features = false, features = ["tokio"], optional = true } # networkmanager, notifications, upower
|
zbus = { version = "3.15.2", default-features = false, features = ["tokio"], optional = true } # network_manager, notifications, upower
|
||||||
|
|
||||||
# schema
|
# schema
|
||||||
schemars = { version = "0.8.21", optional = true }
|
schemars = { version = "0.8.21", optional = true }
|
||||||
|
|
||||||
|
# -- PATCH --
|
||||||
|
# temp fix for tracing-appender/time
|
||||||
|
time = "0.3.36"
|
||||||
|
|
|
@ -93,6 +93,7 @@ cargo build --release --no-default-features \
|
||||||
| music+all | Enables the `music` module with support for all player types. |
|
| music+all | Enables the `music` module with support for all player types. |
|
||||||
| music+mpris | Enables the `music` module with MPRIS support. |
|
| music+mpris | Enables the `music` module with MPRIS support. |
|
||||||
| music+mpd | Enables the `music` module with MPD support. |
|
| music+mpd | Enables the `music` module with MPD support. |
|
||||||
|
| network_manager | Enables the `network_manager` module. |
|
||||||
| notifications | Enables the `notiications` module. |
|
| notifications | Enables the `notiications` module. |
|
||||||
| sys_info | Enables the `sys_info` module. |
|
| sys_info | Enables the `sys_info` module. |
|
||||||
| tray | Enables the `tray` module. |
|
| tray | Enables the `tray` module. |
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
- [Label](label)
|
- [Label](label)
|
||||||
- [Launcher](launcher)
|
- [Launcher](launcher)
|
||||||
- [Music](music)
|
- [Music](music)
|
||||||
|
- [Network Manager](network-manager)
|
||||||
- [Notifications](notifications)
|
- [Notifications](notifications)
|
||||||
- [Script](script)
|
- [Script](script)
|
||||||
- [Sys_Info](sys-info)
|
- [Sys_Info](sys-info)
|
||||||
|
|
77
docs/modules/Network-Manager.md
Normal file
77
docs/modules/Network-Manager.md
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
Displays the current network connection state of NetworkManager.
|
||||||
|
Supports wired ethernet, wifi, cellular data and VPN connections among others.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This module is currently a basic skeleton implementation and only offers the most basic functionality currently.
|
||||||
|
> It uses NetworkManager's so-called primary connection,
|
||||||
|
> and therefore inherits its limitation of only being able to display the "top-level" connection.
|
||||||
|
> For example, if we have a VPN connection over a wifi connection it will only display the former,
|
||||||
|
> until it is disconnected, at which point it will display the latter.
|
||||||
|
> A solution to this is currently in the works.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
> Type: `network_manager`
|
||||||
|
|
||||||
|
| Name | Type | Default | Description |
|
||||||
|
|-------------|-----------|---------|-------------------------|
|
||||||
|
| `icon_size` | `integer` | `24` | Size to render icon at. |
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>JSON</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"end": [
|
||||||
|
{
|
||||||
|
"type": "network_manager",
|
||||||
|
"icon_size": 32
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>TOML</summary>
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[[end]]
|
||||||
|
type = "network_manager"
|
||||||
|
icon_size = 32
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>YAML</summary>
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
end:
|
||||||
|
- type: "network_manager"
|
||||||
|
icon_size: 32
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Corn</summary>
|
||||||
|
|
||||||
|
```corn
|
||||||
|
{
|
||||||
|
end = [
|
||||||
|
{
|
||||||
|
type = "network_manager"
|
||||||
|
icon_size = 32
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Styling
|
||||||
|
|
||||||
|
| Selector | Description |
|
||||||
|
|--------------------------|----------------------------------|
|
||||||
|
| `.network_manager` | NetworkManager widget container. |
|
||||||
|
| `.network_manager .icon` | NetworkManager widget icon. |
|
||||||
|
|
||||||
|
For more information on styling, please see the [styling guide](styling-guide).
|
64
flake.lock
generated
64
flake.lock
generated
|
@ -7,11 +7,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717025063,
|
"lastModified": 1722704454,
|
||||||
"narHash": "sha256-dIubLa56W9sNNz0e8jGxrX3CAkPXsq7snuFA/Ie6dn8=",
|
"narHash": "sha256-lcut8uZMSa80z+aWpxg+9nM8BKWtpU59rtcpMXtHd1Q=",
|
||||||
"owner": "ipetkov",
|
"owner": "ipetkov",
|
||||||
"repo": "crane",
|
"repo": "crane",
|
||||||
"rev": "480dff0be03dac0e51a8dfc26e882b0d123a450e",
|
"rev": "852a59f9672c3413d75bca2b3e9cb4c661cacfc3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -20,34 +20,16 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1705309234,
|
|
||||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"naersk": {
|
"naersk": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717067539,
|
"lastModified": 1721727458,
|
||||||
"narHash": "sha256-oIs5EF+6VpHJRvvpVWuqCYJMMVW/6h59aYUv9lABLtY=",
|
"narHash": "sha256-r/xppY958gmZ4oTfLiHN0ZGuQ+RSTijDblVgVLFi1mw=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "naersk",
|
"repo": "naersk",
|
||||||
"rev": "fa19d8c135e776dc97f4dcca08656a0eeb28d5c0",
|
"rev": "3fb418eaf352498f6b6c30592e3beb63df42ef11",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -58,11 +40,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717112898,
|
"lastModified": 1722640603,
|
||||||
"narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=",
|
"narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0",
|
"rev": "81610abc161d4021b29199aa464d6a1a521e0cc9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -72,11 +54,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716948383,
|
"lastModified": 1722630782,
|
||||||
"narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=",
|
"narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ad57eef4ef0659193044870c731987a6df5cf56b",
|
"rev": "d04953086551086b44b6f3c6b7eeb26294f207da",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -96,17 +78,16 @@
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717121863,
|
"lastModified": 1722738111,
|
||||||
"narHash": "sha256-/3sxIe7MZqF/jw1RTQCSmgTjwVod43mmrk84m50MJQ4=",
|
"narHash": "sha256-cWD5pCs9AYb+512/yCx9D0Pl5KcmyuXHeJpsDw/D1vs=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "2a7b53172ed08f856b8382d7dcfd36a4e0cbd866",
|
"rev": "27ec296d93cb4b2d03e8cbd019b1b4cde8c34280",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -114,21 +95,6 @@
|
||||||
"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",
|
||||||
|
|
10
flake.nix
10
flake.nix
|
@ -162,7 +162,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
style = lib.mkOption {
|
style = lib.mkOption {
|
||||||
type = lib.types.lines;
|
type = lib.types.either (lib.types.lines) (lib.types.path);
|
||||||
default = "";
|
default = "";
|
||||||
description = "The stylesheet to apply to ironbar.";
|
description = "The stylesheet to apply to ironbar.";
|
||||||
};
|
};
|
||||||
|
@ -189,8 +189,12 @@
|
||||||
source = jsonFormat.generate "ironbar-config" cfg.config;
|
source = jsonFormat.generate "ironbar-config" cfg.config;
|
||||||
};
|
};
|
||||||
|
|
||||||
"ironbar/style.css" =
|
"ironbar/style.css" = lib.mkIf (cfg.style != "") (
|
||||||
lib.mkIf (cfg.style != "") { text = cfg.style; };
|
if builtins.isPath cfg.style || lib.isStorePath cfg.style then
|
||||||
|
{ source = cfg.style; }
|
||||||
|
else
|
||||||
|
{ text = cfg.style; }
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.ironbar = lib.mkIf cfg.systemd {
|
systemd.user.services.ironbar = lib.mkIf cfg.systemd {
|
||||||
|
|
10
src/bar.rs
10
src/bar.rs
|
@ -78,10 +78,6 @@ impl Bar {
|
||||||
let center = create_container("center", orientation);
|
let center = create_container("center", orientation);
|
||||||
let end = create_container("end", orientation);
|
let end = create_container("end", orientation);
|
||||||
|
|
||||||
content.add(&start);
|
|
||||||
content.set_center_widget(Some(¢er));
|
|
||||||
content.pack_end(&end, false, false, 0);
|
|
||||||
|
|
||||||
window.add(&content);
|
window.add(&content);
|
||||||
|
|
||||||
window.connect_destroy_event(|_, _| {
|
window.connect_destroy_event(|_, _| {
|
||||||
|
@ -273,16 +269,22 @@ impl Bar {
|
||||||
let popup = Rc::new(popup);
|
let popup = Rc::new(popup);
|
||||||
|
|
||||||
if let Some(modules) = config.start {
|
if let Some(modules) = config.start {
|
||||||
|
self.content.add(&self.start);
|
||||||
|
|
||||||
let info = info!(ModuleLocation::Left);
|
let info = info!(ModuleLocation::Left);
|
||||||
add_modules(&self.start, modules, &info, &self.ironbar, &popup)?;
|
add_modules(&self.start, modules, &info, &self.ironbar, &popup)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(modules) = config.center {
|
if let Some(modules) = config.center {
|
||||||
|
self.content.set_center_widget(Some(&self.center));
|
||||||
|
|
||||||
let info = info!(ModuleLocation::Center);
|
let info = info!(ModuleLocation::Center);
|
||||||
add_modules(&self.center, modules, &info, &self.ironbar, &popup)?;
|
add_modules(&self.center, modules, &info, &self.ironbar, &popup)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(modules) = config.end {
|
if let Some(modules) = config.end {
|
||||||
|
self.content.pack_end(&self.end, false, true, 0);
|
||||||
|
|
||||||
let info = info!(ModuleLocation::Right);
|
let info = info!(ModuleLocation::Right);
|
||||||
add_modules(&self.end, modules, &info, &self.ironbar, &popup)?;
|
add_modules(&self.end, modules, &info, &self.ironbar, &popup)?;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub mod compositor;
|
||||||
pub mod lua;
|
pub mod lua;
|
||||||
#[cfg(feature = "music")]
|
#[cfg(feature = "music")]
|
||||||
pub mod music;
|
pub mod music;
|
||||||
#[cfg(feature = "networkmanager")]
|
#[cfg(feature = "network_manager")]
|
||||||
pub mod networkmanager;
|
pub mod networkmanager;
|
||||||
#[cfg(feature = "notifications")]
|
#[cfg(feature = "notifications")]
|
||||||
pub mod swaync;
|
pub mod swaync;
|
||||||
|
@ -37,8 +37,8 @@ pub struct Clients {
|
||||||
lua: Option<Rc<lua::LuaEngine>>,
|
lua: Option<Rc<lua::LuaEngine>>,
|
||||||
#[cfg(feature = "music")]
|
#[cfg(feature = "music")]
|
||||||
music: std::collections::HashMap<music::ClientType, Arc<dyn music::MusicClient>>,
|
music: std::collections::HashMap<music::ClientType, Arc<dyn music::MusicClient>>,
|
||||||
#[cfg(feature = "networkmanager")]
|
#[cfg(feature = "network_manager")]
|
||||||
networkmanager: Option<Arc<networkmanager::Client>>,
|
network_manager: Option<Arc<networkmanager::Client>>,
|
||||||
#[cfg(feature = "notifications")]
|
#[cfg(feature = "notifications")]
|
||||||
notifications: Option<Arc<swaync::Client>>,
|
notifications: Option<Arc<swaync::Client>>,
|
||||||
#[cfg(feature = "tray")]
|
#[cfg(feature = "tray")]
|
||||||
|
@ -100,13 +100,13 @@ impl Clients {
|
||||||
.clone()
|
.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "networkmanager")]
|
#[cfg(feature = "network_manager")]
|
||||||
pub fn networkmanager(&mut self) -> ClientResult<networkmanager::Client> {
|
pub fn network_manager(&mut self) -> ClientResult<networkmanager::Client> {
|
||||||
match &self.networkmanager {
|
match &self.network_manager {
|
||||||
Some(client) => Ok(client.clone()),
|
Some(client) => Ok(client.clone()),
|
||||||
None => {
|
None => {
|
||||||
let client = networkmanager::create_client()?;
|
let client = networkmanager::create_client()?;
|
||||||
self.networkmanager = Some(client.clone());
|
self.network_manager = Some(client.clone());
|
||||||
Ok(client)
|
Ok(client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
169
src/clients/networkmanager.rs
Normal file
169
src/clients/networkmanager.rs
Normal file
|
@ -0,0 +1,169 @@
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use color_eyre::Result;
|
||||||
|
use futures_signals::signal::{Mutable, MutableSignalCloned};
|
||||||
|
use tracing::error;
|
||||||
|
use zbus::blocking::fdo::PropertiesProxy;
|
||||||
|
use zbus::blocking::Connection;
|
||||||
|
use zbus::{
|
||||||
|
dbus_proxy,
|
||||||
|
names::InterfaceName,
|
||||||
|
zvariant::{ObjectPath, Str},
|
||||||
|
};
|
||||||
|
|
||||||
|
use crate::{register_fallible_client, spawn_blocking};
|
||||||
|
|
||||||
|
const DBUS_BUS: &str = "org.freedesktop.NetworkManager";
|
||||||
|
const DBUS_PATH: &str = "/org/freedesktop/NetworkManager";
|
||||||
|
const DBUS_INTERFACE: &str = "org.freedesktop.NetworkManager";
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Client {
|
||||||
|
client_state: Mutable<ClientState>,
|
||||||
|
interface_name: InterfaceName<'static>,
|
||||||
|
dbus_connection: Connection,
|
||||||
|
props_proxy: PropertiesProxy<'static>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub enum ClientState {
|
||||||
|
WiredConnected,
|
||||||
|
WifiConnected,
|
||||||
|
CellularConnected,
|
||||||
|
VpnConnected,
|
||||||
|
WifiDisconnected,
|
||||||
|
Offline,
|
||||||
|
Unknown,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[dbus_proxy(
|
||||||
|
default_service = "org.freedesktop.NetworkManager",
|
||||||
|
interface = "org.freedesktop.NetworkManager",
|
||||||
|
default_path = "/org/freedesktop/NetworkManager"
|
||||||
|
)]
|
||||||
|
trait NetworkManagerDbus {
|
||||||
|
#[dbus_proxy(property)]
|
||||||
|
fn active_connections(&self) -> Result<Vec<ObjectPath>>;
|
||||||
|
|
||||||
|
#[dbus_proxy(property)]
|
||||||
|
fn devices(&self) -> Result<Vec<ObjectPath>>;
|
||||||
|
|
||||||
|
#[dbus_proxy(property)]
|
||||||
|
fn networking_enabled(&self) -> Result<bool>;
|
||||||
|
|
||||||
|
#[dbus_proxy(property)]
|
||||||
|
fn primary_connection(&self) -> Result<ObjectPath>;
|
||||||
|
|
||||||
|
#[dbus_proxy(property)]
|
||||||
|
fn primary_connection_type(&self) -> Result<Str>;
|
||||||
|
|
||||||
|
#[dbus_proxy(property)]
|
||||||
|
fn wireless_enabled(&self) -> Result<bool>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Client {
|
||||||
|
fn new() -> Result<Self> {
|
||||||
|
let client_state = Mutable::new(ClientState::Unknown);
|
||||||
|
let dbus_connection = Connection::system()?;
|
||||||
|
let interface_name = InterfaceName::from_static_str(DBUS_INTERFACE)?;
|
||||||
|
let props_proxy = PropertiesProxy::builder(&dbus_connection)
|
||||||
|
.destination(DBUS_BUS)?
|
||||||
|
.path(DBUS_PATH)?
|
||||||
|
.build()?;
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
client_state,
|
||||||
|
interface_name,
|
||||||
|
dbus_connection,
|
||||||
|
props_proxy,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn run(&self) -> Result<()> {
|
||||||
|
let proxy = NetworkManagerDbusProxyBlocking::new(&self.dbus_connection)?;
|
||||||
|
|
||||||
|
let mut primary_connection = proxy.primary_connection()?;
|
||||||
|
let mut primary_connection_type = proxy.primary_connection_type()?;
|
||||||
|
let mut wireless_enabled = proxy.wireless_enabled()?;
|
||||||
|
|
||||||
|
self.client_state.set(determine_state(
|
||||||
|
&primary_connection,
|
||||||
|
&primary_connection_type,
|
||||||
|
wireless_enabled,
|
||||||
|
));
|
||||||
|
|
||||||
|
for change in self.props_proxy.receive_properties_changed()? {
|
||||||
|
let args = change.args()?;
|
||||||
|
if args.interface_name != self.interface_name {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let changed_props = args.changed_properties;
|
||||||
|
let mut relevant_prop_changed = false;
|
||||||
|
|
||||||
|
if changed_props.contains_key("PrimaryConnection") {
|
||||||
|
primary_connection = proxy.primary_connection()?;
|
||||||
|
relevant_prop_changed = true;
|
||||||
|
}
|
||||||
|
if changed_props.contains_key("PrimaryConnectionType") {
|
||||||
|
primary_connection_type = proxy.primary_connection_type()?;
|
||||||
|
relevant_prop_changed = true;
|
||||||
|
}
|
||||||
|
if changed_props.contains_key("WirelessEnabled") {
|
||||||
|
wireless_enabled = proxy.wireless_enabled()?;
|
||||||
|
relevant_prop_changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if relevant_prop_changed {
|
||||||
|
self.client_state.set(determine_state(
|
||||||
|
&primary_connection,
|
||||||
|
&primary_connection_type,
|
||||||
|
wireless_enabled,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn subscribe(&self) -> MutableSignalCloned<ClientState> {
|
||||||
|
self.client_state.signal_cloned()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn create_client() -> Result<Arc<Client>> {
|
||||||
|
let client = Arc::new(Client::new()?);
|
||||||
|
{
|
||||||
|
let client = client.clone();
|
||||||
|
spawn_blocking(move || {
|
||||||
|
if let Err(error) = client.run() {
|
||||||
|
error!("{}", error);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Ok(client)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn determine_state(
|
||||||
|
primary_connection: &str,
|
||||||
|
primary_connection_type: &str,
|
||||||
|
wireless_enabled: bool,
|
||||||
|
) -> ClientState {
|
||||||
|
if primary_connection == "/" {
|
||||||
|
if wireless_enabled {
|
||||||
|
ClientState::WifiDisconnected
|
||||||
|
} else {
|
||||||
|
ClientState::Offline
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
match primary_connection_type {
|
||||||
|
"802-3-ethernet" | "adsl" | "pppoe" => ClientState::WiredConnected,
|
||||||
|
"802-11-olpc-mesh" | "802-11-wireless" | "wifi-p2p" => ClientState::WifiConnected,
|
||||||
|
"cdma" | "gsm" | "wimax" => ClientState::CellularConnected,
|
||||||
|
"vpn" | "wireguard" => ClientState::VpnConnected,
|
||||||
|
_ => ClientState::Unknown,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
register_fallible_client!(Client, network_manager);
|
|
@ -10,11 +10,12 @@ use zbus::export::ordered_stream::OrderedStreamExt;
|
||||||
use zbus::zvariant::Type;
|
use zbus::zvariant::Type;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Type, Deserialize)]
|
#[derive(Debug, Clone, Copy, Type, Deserialize)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct Event {
|
pub struct Event {
|
||||||
pub count: u32,
|
pub count: u32,
|
||||||
pub dnd: bool,
|
pub dnd: bool,
|
||||||
pub cc_open: bool,
|
pub cc_open: bool,
|
||||||
// pub inhibited: bool,
|
pub inhibited: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetSubscribeData = (bool, bool, u32, bool);
|
type GetSubscribeData = (bool, bool, u32, bool);
|
||||||
|
@ -22,12 +23,12 @@ type GetSubscribeData = (bool, bool, u32, bool);
|
||||||
/// Converts the data returned from
|
/// Converts the data returned from
|
||||||
/// `get_subscribe_data` into an event for convenience.
|
/// `get_subscribe_data` into an event for convenience.
|
||||||
impl From<GetSubscribeData> for Event {
|
impl From<GetSubscribeData> for Event {
|
||||||
fn from((dnd, cc_open, count, _inhibited): (bool, bool, u32, bool)) -> Self {
|
fn from((dnd, cc_open, count, inhibited): (bool, bool, u32, bool)) -> Self {
|
||||||
Self {
|
Self {
|
||||||
count,
|
count,
|
||||||
dnd,
|
dnd,
|
||||||
cc_open,
|
cc_open,
|
||||||
// inhibited,
|
inhibited,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
use super::manager::DataControlDeviceManagerState;
|
use super::manager::DataControlDeviceManagerState;
|
||||||
use crate::lock;
|
use crate::lock;
|
||||||
use nix::fcntl::OFlag;
|
use nix::fcntl::OFlag;
|
||||||
use nix::unistd::{close, pipe2};
|
use nix::unistd::pipe2;
|
||||||
use smithay_client_toolkit::data_device_manager::data_offer::DataOfferError;
|
use smithay_client_toolkit::data_device_manager::data_offer::DataOfferError;
|
||||||
use smithay_client_toolkit::data_device_manager::ReadPipe;
|
use smithay_client_toolkit::data_device_manager::ReadPipe;
|
||||||
use std::ops::DerefMut;
|
use std::ops::DerefMut;
|
||||||
use std::os::fd::{AsFd, AsRawFd};
|
use std::os::fd::AsFd;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use tracing::{trace, warn};
|
use tracing::trace;
|
||||||
use wayland_client::{Connection, Dispatch, Proxy, QueueHandle};
|
use wayland_client::{Connection, Dispatch, Proxy, QueueHandle};
|
||||||
use wayland_protocols_wlr::data_control::v1::client::zwlr_data_control_offer_v1::{
|
use wayland_protocols_wlr::data_control::v1::client::zwlr_data_control_offer_v1::{
|
||||||
Event, ZwlrDataControlOfferV1,
|
Event, ZwlrDataControlOfferV1,
|
||||||
|
@ -178,9 +178,5 @@ pub unsafe fn receive(
|
||||||
|
|
||||||
offer.receive(mime_type, writefd.as_fd());
|
offer.receive(mime_type, writefd.as_fd());
|
||||||
|
|
||||||
if let Err(err) = close(writefd.as_raw_fd()) {
|
|
||||||
warn!("Failed to close write pipe: {}", err);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(ReadPipe::from(readfd))
|
Ok(ReadPipe::from(readfd))
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ use crate::modules::label::LabelModule;
|
||||||
use crate::modules::launcher::LauncherModule;
|
use crate::modules::launcher::LauncherModule;
|
||||||
#[cfg(feature = "music")]
|
#[cfg(feature = "music")]
|
||||||
use crate::modules::music::MusicModule;
|
use crate::modules::music::MusicModule;
|
||||||
#[cfg(feature = "networkmanager")]
|
#[cfg(feature = "network_manager")]
|
||||||
use crate::modules::networkmanager::NetworkManagerModule;
|
use crate::modules::networkmanager::NetworkManagerModule;
|
||||||
#[cfg(feature = "notifications")]
|
#[cfg(feature = "notifications")]
|
||||||
use crate::modules::notifications::NotificationsModule;
|
use crate::modules::notifications::NotificationsModule;
|
||||||
|
@ -62,7 +62,7 @@ pub enum ModuleConfig {
|
||||||
Launcher(Box<LauncherModule>),
|
Launcher(Box<LauncherModule>),
|
||||||
#[cfg(feature = "music")]
|
#[cfg(feature = "music")]
|
||||||
Music(Box<MusicModule>),
|
Music(Box<MusicModule>),
|
||||||
#[cfg(feature = "networkmanager")]
|
#[cfg(feature = "network_manager")]
|
||||||
NetworkManager(Box<NetworkManagerModule>),
|
NetworkManager(Box<NetworkManagerModule>),
|
||||||
#[cfg(feature = "notifications")]
|
#[cfg(feature = "notifications")]
|
||||||
Notifications(Box<NotificationsModule>),
|
Notifications(Box<NotificationsModule>),
|
||||||
|
@ -107,7 +107,7 @@ impl ModuleConfig {
|
||||||
Self::Launcher(module) => create!(module),
|
Self::Launcher(module) => create!(module),
|
||||||
#[cfg(feature = "music")]
|
#[cfg(feature = "music")]
|
||||||
Self::Music(module) => create!(module),
|
Self::Music(module) => create!(module),
|
||||||
#[cfg(feature = "networkmanager")]
|
#[cfg(feature = "network_manager")]
|
||||||
Self::NetworkManager(module) => create!(module),
|
Self::NetworkManager(module) => create!(module),
|
||||||
#[cfg(feature = "notifications")]
|
#[cfg(feature = "notifications")]
|
||||||
Self::Notifications(module) => create!(module),
|
Self::Notifications(module) => create!(module),
|
||||||
|
|
|
@ -36,7 +36,7 @@ pub mod label;
|
||||||
pub mod launcher;
|
pub mod launcher;
|
||||||
#[cfg(feature = "music")]
|
#[cfg(feature = "music")]
|
||||||
pub mod music;
|
pub mod music;
|
||||||
#[cfg(feature = "networkmanager")]
|
#[cfg(feature = "network_manager")]
|
||||||
pub mod networkmanager;
|
pub mod networkmanager;
|
||||||
#[cfg(feature = "notifications")]
|
#[cfg(feature = "notifications")]
|
||||||
pub mod notifications;
|
pub mod notifications;
|
||||||
|
@ -287,6 +287,8 @@ pub trait ModuleFactory {
|
||||||
let id = Ironbar::unique_id();
|
let id = Ironbar::unique_id();
|
||||||
let common = module.take_common();
|
let common = module.take_common();
|
||||||
|
|
||||||
|
debug!("adding module {} (id: {})", TModule::name(), id);
|
||||||
|
|
||||||
let (ui_tx, ui_rx) = mpsc::channel::<ModuleUpdateEvent<TSend>>(64);
|
let (ui_tx, ui_rx) = mpsc::channel::<ModuleUpdateEvent<TSend>>(64);
|
||||||
let (controller_tx, controller_rx) = mpsc::channel::<TRev>(64);
|
let (controller_tx, controller_rx) = mpsc::channel::<TRev>(64);
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
use color_eyre::Result;
|
use color_eyre::Result;
|
||||||
use futures_lite::StreamExt;
|
use futures_lite::StreamExt;
|
||||||
use futures_signals::signal::SignalExt;
|
use futures_signals::signal::SignalExt;
|
||||||
use gtk::prelude::{ContainerExt, WidgetExt};
|
use gtk::prelude::ContainerExt;
|
||||||
use gtk::{Box as GtkBox, Image, Orientation};
|
use gtk::{Box as GtkBox, Image, Orientation};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use tokio::sync::mpsc::Receiver;
|
use tokio::sync::mpsc::Receiver;
|
||||||
|
|
||||||
use crate::clients::networkmanager::state::{
|
use crate::clients::networkmanager::{Client, ClientState};
|
||||||
CellularState, State, VpnState, WifiState, WiredState,
|
|
||||||
};
|
|
||||||
use crate::clients::networkmanager::Client;
|
|
||||||
use crate::config::CommonConfig;
|
use crate::config::CommonConfig;
|
||||||
use crate::gtk_helpers::IronbarGtkExt;
|
use crate::gtk_helpers::IronbarGtkExt;
|
||||||
use crate::image::ImageProvider;
|
use crate::image::ImageProvider;
|
||||||
|
@ -31,13 +28,15 @@ const fn default_icon_size() -> i32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Module<GtkBox> for NetworkManagerModule {
|
impl Module<GtkBox> for NetworkManagerModule {
|
||||||
type SendMessage = State;
|
type SendMessage = ClientState;
|
||||||
type ReceiveMessage = ();
|
type ReceiveMessage = ();
|
||||||
|
|
||||||
|
module_impl!("network_manager");
|
||||||
|
|
||||||
fn spawn_controller(
|
fn spawn_controller(
|
||||||
&self,
|
&self,
|
||||||
_: &ModuleInfo,
|
_: &ModuleInfo,
|
||||||
context: &WidgetContext<State, ()>,
|
context: &WidgetContext<ClientState, ()>,
|
||||||
_: Receiver<()>,
|
_: Receiver<()>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let client = context.try_client::<Client>()?;
|
let client = context.try_client::<Client>()?;
|
||||||
|
@ -55,81 +54,35 @@ impl Module<GtkBox> for NetworkManagerModule {
|
||||||
|
|
||||||
fn into_widget(
|
fn into_widget(
|
||||||
self,
|
self,
|
||||||
context: WidgetContext<State, ()>,
|
context: WidgetContext<ClientState, ()>,
|
||||||
info: &ModuleInfo,
|
info: &ModuleInfo,
|
||||||
) -> Result<ModuleParts<GtkBox>> {
|
) -> Result<ModuleParts<GtkBox>> {
|
||||||
let container = GtkBox::new(Orientation::Horizontal, 0);
|
let container = GtkBox::new(Orientation::Horizontal, 0);
|
||||||
|
let icon = Image::new();
|
||||||
// Wired icon
|
icon.add_class("icon");
|
||||||
let wired_icon = Image::new();
|
container.add(&icon);
|
||||||
wired_icon.add_class("icon");
|
|
||||||
wired_icon.add_class("wired-icon");
|
|
||||||
container.add(&wired_icon);
|
|
||||||
|
|
||||||
// Wifi icon
|
|
||||||
let wifi_icon = Image::new();
|
|
||||||
wifi_icon.add_class("icon");
|
|
||||||
wifi_icon.add_class("wifi-icon");
|
|
||||||
container.add(&wifi_icon);
|
|
||||||
|
|
||||||
// Cellular icon
|
|
||||||
let cellular_icon = Image::new();
|
|
||||||
cellular_icon.add_class("icon");
|
|
||||||
cellular_icon.add_class("cellular-icon");
|
|
||||||
container.add(&cellular_icon);
|
|
||||||
|
|
||||||
// VPN icon
|
|
||||||
let vpn_icon = Image::new();
|
|
||||||
vpn_icon.add_class("icon");
|
|
||||||
vpn_icon.add_class("vpn-icon");
|
|
||||||
container.add(&vpn_icon);
|
|
||||||
|
|
||||||
let icon_theme = info.icon_theme.clone();
|
let icon_theme = info.icon_theme.clone();
|
||||||
glib_recv!(context.subscribe(), state => {
|
|
||||||
macro_rules! update_icon {
|
|
||||||
(
|
|
||||||
$icon_var:expr,
|
|
||||||
$state_type:ident,
|
|
||||||
{$($state:pat => $icon_name:expr,)+}
|
|
||||||
) => {
|
|
||||||
let icon_name = match state.$state_type {
|
|
||||||
$($state => $icon_name,)+
|
|
||||||
};
|
|
||||||
if icon_name.is_empty() {
|
|
||||||
$icon_var.hide();
|
|
||||||
} else {
|
|
||||||
ImageProvider::parse(icon_name, &icon_theme, false, self.icon_size)
|
|
||||||
.map(|provider| provider.load_into_image($icon_var.clone()));
|
|
||||||
$icon_var.show();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
update_icon!(wired_icon, wired, {
|
let initial_icon_name = "content-loading-symbolic";
|
||||||
WiredState::Connected => "icon:network-wired-symbolic",
|
ImageProvider::parse(initial_icon_name, &icon_theme, false, self.icon_size)
|
||||||
WiredState::Disconnected => "icon:network-wired-disconnected-symbolic",
|
.map(|provider| provider.load_into_image(icon.clone()));
|
||||||
WiredState::NotPresent | WiredState::Unknown => "",
|
|
||||||
});
|
let widget_receiver = context.subscribe();
|
||||||
update_icon!(wifi_icon, wifi, {
|
glib_recv!(widget_receiver, state => {
|
||||||
WifiState::Connected(_) => "icon:network-wireless-connected-symbolic",
|
let icon_name = match state {
|
||||||
WifiState::Disconnected => "icon:network-wireless-offline-symbolic",
|
ClientState::WiredConnected => "network-wired-symbolic",
|
||||||
WifiState::Disabled => "icon:network-wireless-hardware-disabled-symbolic",
|
ClientState::WifiConnected => "network-wireless-symbolic",
|
||||||
WifiState::NotPresent | WifiState::Unknown => "",
|
ClientState::CellularConnected => "network-cellular-symbolic",
|
||||||
});
|
ClientState::VpnConnected => "network-vpn-symbolic",
|
||||||
update_icon!(cellular_icon, cellular, {
|
ClientState::WifiDisconnected => "network-wireless-acquiring-symbolic",
|
||||||
CellularState::Connected => "icon:network-cellular-connected-symbolic",
|
ClientState::Offline => "network-wireless-disabled-symbolic",
|
||||||
CellularState::Disconnected => "icon:network-cellular-offline-symbolic",
|
ClientState::Unknown => "dialog-question-symbolic",
|
||||||
CellularState::Disabled => "icon:network-cellular-hardware-disabled-symbolic",
|
};
|
||||||
CellularState::NotPresent | CellularState::Unknown => "",
|
ImageProvider::parse(icon_name, &icon_theme, false, self.icon_size)
|
||||||
});
|
.map(|provider| provider.load_into_image(icon.clone()));
|
||||||
update_icon!(vpn_icon, vpn, {
|
|
||||||
VpnState::Connected(_) => "icon:network-vpn-symbolic",
|
|
||||||
VpnState::Disconnected | VpnState::Unknown => "",
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(ModuleParts::new(container, None))
|
Ok(ModuleParts::new(container, None))
|
||||||
}
|
}
|
||||||
|
|
||||||
module_impl!("networkmanager");
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue