aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Jankowski <Daniel.Jankowski@rub.de>2024-04-16 10:59:15 +0200
committerGitHub <noreply@github.com>2024-04-16 10:59:15 +0200
commit072392300409c11930cb07f56fab03eda2c24d4a (patch)
treea009352ec85fa705d239166873d14ef469b3fbea
parentfix: toggle pane frames with floating panes (diff)
downloadsl0pstatus-072392300409c11930cb07f56fab03eda2c24d4a.tar.gz
sl0pstatus-072392300409c11930cb07f56fab03eda2c24d4a.tar.xz
sl0pstatus-072392300409c11930cb07f56fab03eda2c24d4a.zip
feat: remote control zjstatus with pipes (#48)
* chore: update to latest version of zellij * fix: deprecated functions in chrono * chore: update nix deps * chore: remove deprecated chrono functions * feat: add refresh via pipes with line protocol * fix: handle multiple lines in pipe * fix(clippy): char instead of str * feat: add notification widget * chore: update nix flake * chore: update cargo deps * chore: update cargo deps * chore: update nix flake * chore: clean up imports for tracing * chore: update nix flake * chore: update cargo deps * chore: update nix flake * chore: update cargo deps * chore: remove pinning of chrono Since chrono-tz now fixed the deprecations from chrono we can finally remove the pinning. * chore: update nix flake * chore: update cargo deps
-rw-r--r--Cargo.lock393
-rw-r--r--Cargo.toml6
-rw-r--r--benches/widgets.rs4
-rw-r--r--flake.lock24
-rw-r--r--plugin-dev-workspace.kdl11
-rw-r--r--src/bin/zjstatus.rs59
-rw-r--r--src/config.rs4
-rw-r--r--src/lib.rs1
-rw-r--r--src/pipe.rs103
-rw-r--r--src/widgets/command.rs6
-rw-r--r--src/widgets/mod.rs1
-rw-r--r--src/widgets/notification.rs78
12 files changed, 461 insertions, 229 deletions
diff --git a/Cargo.lock b/Cargo.lock
index b12971d..4b00c4e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -85,18 +85,18 @@ dependencies = [
[[package]]
name = "aho-corasick"
-version = "1.1.2"
+version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
+checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
dependencies = [
"memchr",
]
[[package]]
name = "allocator-api2"
-version = "0.2.16"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
+checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
[[package]]
name = "android-tzdata"
@@ -127,18 +127,18 @@ checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc"
[[package]]
name = "anyhow"
-version = "1.0.80"
+version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1"
+checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
dependencies = [
"backtrace",
]
[[package]]
name = "arc-swap"
-version = "1.7.0"
+version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b3d0060af21e8d11a926981cc00c6c1541aa91dd64b9f881985c3da1094425f"
+checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
[[package]]
name = "arrayvec"
@@ -147,6 +147,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]]
+name = "async-attributes"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5"
+dependencies = [
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
name = "async-channel"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -159,28 +169,27 @@ dependencies = [
[[package]]
name = "async-channel"
-version = "2.2.0"
+version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3"
+checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928"
dependencies = [
"concurrent-queue",
- "event-listener 5.2.0",
- "event-listener-strategy 0.5.0",
+ "event-listener 5.3.0",
+ "event-listener-strategy 0.5.1",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-executor"
-version = "1.8.0"
+version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c"
+checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a"
dependencies = [
- "async-lock 3.3.0",
"async-task",
"concurrent-queue",
- "fastrand 2.0.1",
- "futures-lite 2.2.0",
+ "fastrand 2.0.2",
+ "futures-lite 2.3.0",
"slab",
]
@@ -190,12 +199,12 @@ version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c"
dependencies = [
- "async-channel 2.2.0",
+ "async-channel 2.2.1",
"async-executor",
- "async-io 2.3.1",
+ "async-io 2.3.2",
"async-lock 3.3.0",
"blocking",
- "futures-lite 2.2.0",
+ "futures-lite 2.3.0",
"once_cell",
]
@@ -221,18 +230,18 @@ dependencies = [
[[package]]
name = "async-io"
-version = "2.3.1"
+version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65"
+checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884"
dependencies = [
"async-lock 3.3.0",
"cfg-if",
"concurrent-queue",
"futures-io",
- "futures-lite 2.2.0",
+ "futures-lite 2.3.0",
"parking",
- "polling 3.5.0",
- "rustix 0.38.31",
+ "polling 3.6.0",
+ "rustix 0.38.32",
"slab",
"tracing",
"windows-sys 0.52.0",
@@ -271,7 +280,7 @@ dependencies = [
"cfg-if",
"event-listener 3.1.0",
"futures-lite 1.13.0",
- "rustix 0.38.31",
+ "rustix 0.38.32",
"windows-sys 0.48.0",
]
@@ -281,13 +290,13 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5"
dependencies = [
- "async-io 2.3.1",
+ "async-io 2.3.2",
"async-lock 2.8.0",
"atomic-waker",
"cfg-if",
"futures-core",
"futures-io",
- "rustix 0.38.31",
+ "rustix 0.38.32",
"signal-hook-registry",
"slab",
"windows-sys 0.48.0",
@@ -299,6 +308,7 @@ version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d"
dependencies = [
+ "async-attributes",
"async-channel 1.9.0",
"async-global-executor",
"async-io 1.13.0",
@@ -328,13 +338,13 @@ checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
[[package]]
name = "async-trait"
-version = "0.1.77"
+version = "0.1.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9"
+checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
@@ -356,15 +366,15 @@ dependencies = [
[[package]]
name = "autocfg"
-version = "1.1.0"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
[[package]]
name = "backtrace"
-version = "0.3.69"
+version = "0.3.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
+checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d"
dependencies = [
"addr2line",
"cc",
@@ -410,9 +420,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
-version = "2.4.2"
+version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
+checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
[[package]]
name = "block-buffer"
@@ -438,21 +448,21 @@ version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118"
dependencies = [
- "async-channel 2.2.0",
+ "async-channel 2.2.1",
"async-lock 3.3.0",
"async-task",
- "fastrand 2.0.1",
+ "fastrand 2.0.2",
"futures-io",
- "futures-lite 2.2.0",
+ "futures-lite 2.3.0",
"piper",
"tracing",
]
[[package]]
name = "bumpalo"
-version = "3.15.3"
+version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b"
+checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
@@ -468,9 +478,9 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]]
name = "bytes"
-version = "1.5.0"
+version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
+checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
[[package]]
name = "cached"
@@ -513,9 +523,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
-version = "1.0.89"
+version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0ba8f7aaa012f30d5b2861462f6708eccd49c3c39863fe083a308035f63d723"
+checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7"
[[package]]
name = "cfg-if"
@@ -525,21 +535,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
-version = "0.4.34"
+version = "0.4.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b"
+checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [
"android-tzdata",
"iana-time-zone",
"num-traits",
- "windows-targets 0.52.4",
+ "windows-targets 0.52.5",
]
[[package]]
name = "chrono-tz"
-version = "0.8.6"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e"
+checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb"
dependencies = [
"chrono",
"chrono-tz-build",
@@ -548,9 +558,9 @@ dependencies = [
[[package]]
name = "chrono-tz-build"
-version = "0.2.1"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f"
+checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1"
dependencies = [
"parse-zoneinfo",
"phf 0.11.2",
@@ -612,18 +622,18 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.5.1"
+version = "4.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da"
+checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0"
dependencies = [
"clap_builder",
]
[[package]]
name = "clap_builder"
-version = "4.5.1"
+version = "4.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb"
+checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4"
dependencies = [
"anstyle",
"clap_lex 0.7.0",
@@ -763,7 +773,7 @@ dependencies = [
"anes",
"cast",
"ciborium",
- "clap 4.5.1",
+ "clap 4.5.4",
"criterion-plot",
"is-terminal",
"itertools",
@@ -1055,9 +1065,9 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
[[package]]
name = "either"
-version = "1.10.0"
+version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
+checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2"
[[package]]
name = "encode_unicode"
@@ -1111,9 +1121,9 @@ dependencies = [
[[package]]
name = "event-listener"
-version = "5.2.0"
+version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91"
+checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24"
dependencies = [
"concurrent-queue",
"parking",
@@ -1132,11 +1142,11 @@ dependencies = [
[[package]]
name = "event-listener-strategy"
-version = "0.5.0"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291"
+checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3"
dependencies = [
- "event-listener 5.2.0",
+ "event-listener 5.3.0",
"pin-project-lite",
]
@@ -1151,9 +1161,9 @@ dependencies = [
[[package]]
name = "fastrand"
-version = "2.0.1"
+version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
+checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984"
[[package]]
name = "file-id"
@@ -1299,11 +1309,11 @@ dependencies = [
[[package]]
name = "futures-lite"
-version = "2.2.0"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba"
+checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
dependencies = [
- "fastrand 2.0.1",
+ "fastrand 2.0.2",
"futures-core",
"futures-io",
"parking",
@@ -1318,7 +1328,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
@@ -1374,9 +1384,9 @@ dependencies = [
[[package]]
name = "getrandom"
-version = "0.2.12"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
+checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c"
dependencies = [
"cfg-if",
"libc",
@@ -1413,9 +1423,9 @@ dependencies = [
[[package]]
name = "half"
-version = "2.4.0"
+version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e"
+checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888"
dependencies = [
"cfg-if",
"crunchy",
@@ -1508,7 +1518,7 @@ version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
dependencies = [
- "bytes 1.5.0",
+ "bytes 1.6.0",
"fnv",
"itoa",
]
@@ -1625,9 +1635,9 @@ dependencies = [
[[package]]
name = "indexmap"
-version = "2.2.5"
+version = "2.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4"
+checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
dependencies = [
"equivalent",
"hashbrown 0.14.3",
@@ -1759,9 +1769,9 @@ dependencies = [
[[package]]
name = "itoa"
-version = "1.0.10"
+version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
+checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = "js-sys"
@@ -1832,9 +1842,9 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "libnghttp2-sys"
-version = "0.1.9+1.58.0"
+version = "0.1.10+1.61.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b57e858af2798e167e709b9d969325b6d8e9d50232fcbc494d7d54f976854a64"
+checksum = "959c25552127d2e1fa72f0e52548ec04fc386e827ba71a7bd01db46a447dc135"
dependencies = [
"cc",
"libc",
@@ -1842,20 +1852,19 @@ dependencies = [
[[package]]
name = "libredox"
-version = "0.0.1"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8"
+checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
dependencies = [
- "bitflags 2.4.2",
+ "bitflags 2.5.0",
"libc",
- "redox_syscall",
]
[[package]]
name = "libz-sys"
-version = "1.1.15"
+version = "1.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6"
+checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9"
dependencies = [
"cc",
"libc",
@@ -1931,9 +1940,9 @@ dependencies = [
[[package]]
name = "memchr"
-version = "2.7.1"
+version = "2.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
+checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
[[package]]
name = "memmem"
@@ -1979,7 +1988,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
@@ -2082,7 +2091,7 @@ version = "6.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d"
dependencies = [
- "bitflags 2.4.2",
+ "bitflags 2.5.0",
"crossbeam-channel",
"filetime",
"fsevent-sys",
@@ -2182,9 +2191,9 @@ dependencies = [
[[package]]
name = "openssl-sys"
-version = "0.9.101"
+version = "0.9.102"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff"
+checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2"
dependencies = [
"cc",
"libc",
@@ -2296,9 +2305,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "pest"
-version = "2.7.8"
+version = "2.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8"
+checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95"
dependencies = [
"memchr",
"thiserror",
@@ -2307,9 +2316,9 @@ dependencies = [
[[package]]
name = "pest_derive"
-version = "2.7.8"
+version = "2.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0d24f72393fd16ab6ac5738bc33cdb6a9aa73f8b902e8fe29cf4e67d7dd1026"
+checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c"
dependencies = [
"pest",
"pest_generator",
@@ -2317,22 +2326,22 @@ dependencies = [
[[package]]
name = "pest_generator"
-version = "2.7.8"
+version = "2.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fdc17e2a6c7d0a492f0158d7a4bd66cc17280308bbaff78d5bef566dca35ab80"
+checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd"
dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
name = "pest_meta"
-version = "2.7.8"
+version = "2.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "934cd7631c050f4674352a6e835d5f6711ffbfb9345c2fc0107155ac495ae293"
+checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca"
dependencies = [
"once_cell",
"pest",
@@ -2346,7 +2355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9"
dependencies = [
"fixedbitset",
- "indexmap 2.2.5",
+ "indexmap 2.2.6",
]
[[package]]
@@ -2398,7 +2407,7 @@ dependencies = [
"phf_shared 0.11.2",
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
@@ -2436,14 +2445,14 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
name = "pin-project-lite"
-version = "0.2.13"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
+checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
[[package]]
name = "pin-utils"
@@ -2458,7 +2467,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4"
dependencies = [
"atomic-waker",
- "fastrand 2.0.1",
+ "fastrand 2.0.2",
"futures-io",
]
@@ -2486,14 +2495,15 @@ dependencies = [
[[package]]
name = "polling"
-version = "3.5.0"
+version = "3.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9"
+checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6"
dependencies = [
"cfg-if",
"concurrent-queue",
+ "hermit-abi 0.3.9",
"pin-project-lite",
- "rustix 0.38.31",
+ "rustix 0.38.32",
"tracing",
"windows-sys 0.52.0",
]
@@ -2557,9 +2567,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
[[package]]
name = "proc-macro2"
-version = "1.0.78"
+version = "1.0.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
+checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e"
dependencies = [
"unicode-ident",
]
@@ -2570,7 +2580,7 @@ version = "0.11.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd"
dependencies = [
- "bytes 1.5.0",
+ "bytes 1.6.0",
"prost-derive",
]
@@ -2580,7 +2590,7 @@ version = "0.11.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270"
dependencies = [
- "bytes 1.5.0",
+ "bytes 1.6.0",
"heck 0.4.1",
"itertools",
"lazy_static",
@@ -2620,9 +2630,9 @@ dependencies = [
[[package]]
name = "quote"
-version = "1.0.35"
+version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
+checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [
"proc-macro2",
]
@@ -2686,7 +2696,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
- "getrandom 0.2.12",
+ "getrandom 0.2.14",
]
[[package]]
@@ -2709,20 +2719,20 @@ dependencies = [
[[package]]
name = "redox_users"
-version = "0.4.4"
+version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4"
+checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891"
dependencies = [
- "getrandom 0.2.12",
+ "getrandom 0.2.14",
"libredox",
"thiserror",
]
[[package]]
name = "regex"
-version = "1.10.3"
+version = "1.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
+checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c"
dependencies = [
"aho-corasick",
"memchr",
@@ -2743,9 +2753,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
-version = "0.8.2"
+version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
+checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
[[package]]
name = "rmp"
@@ -2809,11 +2819,11 @@ dependencies = [
[[package]]
name = "rustix"
-version = "0.38.31"
+version = "0.38.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949"
+checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89"
dependencies = [
- "bitflags 2.4.2",
+ "bitflags 2.5.0",
"errno",
"libc",
"linux-raw-sys 0.4.13",
@@ -2916,14 +2926,14 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
name = "serde_json"
-version = "1.0.114"
+version = "1.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0"
+checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813"
dependencies = [
"itoa",
"ryu",
@@ -2955,11 +2965,11 @@ dependencies = [
[[package]]
name = "serde_yaml"
-version = "0.9.32"
+version = "0.9.34+deprecated"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f"
+checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
dependencies = [
- "indexmap 2.2.5",
+ "indexmap 2.2.6",
"itoa",
"ryu",
"serde",
@@ -3080,9 +3090,9 @@ dependencies = [
[[package]]
name = "smallvec"
-version = "1.13.1"
+version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
+checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "smawk"
@@ -3263,7 +3273,7 @@ dependencies = [
"async-trait",
"cfg-if",
"futures-util",
- "getrandom 0.2.12",
+ "getrandom 0.2.14",
"http-client",
"http-types",
"log",
@@ -3287,9 +3297,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.52"
+version = "2.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07"
+checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a"
dependencies = [
"proc-macro2",
"quote",
@@ -3303,8 +3313,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
dependencies = [
"cfg-if",
- "fastrand 2.0.1",
- "rustix 0.38.31",
+ "fastrand 2.0.2",
+ "rustix 0.38.32",
"windows-sys 0.52.0",
]
@@ -3409,22 +3419,22 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
[[package]]
name = "thiserror"
-version = "1.0.57"
+version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b"
+checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.57"
+version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81"
+checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
@@ -3536,7 +3546,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
@@ -3674,9 +3684,9 @@ dependencies = [
[[package]]
name = "unsafe-libyaml"
-version = "0.2.10"
+version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b"
+checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
[[package]]
name = "url"
@@ -3698,11 +3708,11 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]]
name = "uuid"
-version = "1.7.0"
+version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a"
+checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0"
dependencies = [
- "getrandom 0.2.12",
+ "getrandom 0.2.14",
"serde",
]
@@ -3714,9 +3724,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "value-bag"
-version = "1.7.0"
+version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b"
+checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8"
[[package]]
name = "vcpkg"
@@ -3819,7 +3829,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
"wasm-bindgen-shared",
]
@@ -3853,7 +3863,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -3942,7 +3952,7 @@ dependencies = [
"either",
"home",
"once_cell",
- "rustix 0.38.31",
+ "rustix 0.38.32",
]
[[package]]
@@ -3982,7 +3992,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
- "windows-targets 0.52.4",
+ "windows-targets 0.52.5",
]
[[package]]
@@ -4000,7 +4010,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
- "windows-targets 0.52.4",
+ "windows-targets 0.52.5",
]
[[package]]
@@ -4020,17 +4030,18 @@ dependencies = [
[[package]]
name = "windows-targets"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
+checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
dependencies = [
- "windows_aarch64_gnullvm 0.52.4",
- "windows_aarch64_msvc 0.52.4",
- "windows_i686_gnu 0.52.4",
- "windows_i686_msvc 0.52.4",
- "windows_x86_64_gnu 0.52.4",
- "windows_x86_64_gnullvm 0.52.4",
- "windows_x86_64_msvc 0.52.4",
+ "windows_aarch64_gnullvm 0.52.5",
+ "windows_aarch64_msvc 0.52.5",
+ "windows_i686_gnu 0.52.5",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc 0.52.5",
+ "windows_x86_64_gnu 0.52.5",
+ "windows_x86_64_gnullvm 0.52.5",
+ "windows_x86_64_msvc 0.52.5",
]
[[package]]
@@ -4041,9 +4052,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
+checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
[[package]]
name = "windows_aarch64_msvc"
@@ -4053,9 +4064,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
+checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
[[package]]
name = "windows_i686_gnu"
@@ -4065,9 +4076,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
-version = "0.52.4"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
+checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
[[package]]
name = "windows_i686_msvc"
@@ -4077,9 +4094,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
+checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
[[package]]
name = "windows_x86_64_gnu"
@@ -4089,9 +4106,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
+checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
[[package]]
name = "windows_x86_64_gnullvm"
@@ -4101,9 +4118,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
+checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
[[package]]
name = "windows_x86_64_msvc"
@@ -4113,15 +4130,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.52.4"
+version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
+checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
[[package]]
name = "zellij-tile"
-version = "0.39.2"
+version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bee5e07b2425d3135e162740f99fe1594f43e5f0a62fe09e3002a8356c6a90cc"
+checksum = "58471198b62771e4387ac00c072e9b1d8ebd87db2568bdb5fbb60dd99d8552bd"
dependencies = [
"clap 3.2.25",
"serde",
@@ -4133,9 +4150,9 @@ dependencies = [
[[package]]
name = "zellij-utils"
-version = "0.39.2"
+version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2b8f21edd42f679b1aa3440add0c6a6539f91d81c6eee5f41e105d84342c037"
+checksum = "5289f6ff643db4f7f772f090cede454cd1be276a3a5654464c402094b625524f"
dependencies = [
"anyhow",
"async-channel 1.9.0",
@@ -4201,7 +4218,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.52",
+ "syn 2.0.59",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index f0956a1..45fa716 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,10 +16,10 @@ bench = []
tracing = []
[dependencies]
-zellij-tile = "0.39.0"
-chrono = { version = "0.4.0", default-features = false }
+zellij-tile = "0.40.0"
+chrono = { version = "0.4.35", default-features = false }
regex = "1.10.0"
-chrono-tz = "0.8.3"
+chrono-tz = "0.9.0"
anyhow = "1.0.75"
anstyle = "1.0.2"
uuid = { version = "1.6.1", features = ["v4"] }
diff --git a/benches/widgets.rs b/benches/widgets.rs
index d8d6212..d14a44d 100644
--- a/benches/widgets.rs
+++ b/benches/widgets.rs
@@ -19,7 +19,7 @@ fn bench_widget_command(c: &mut Criterion) {
let wid = widgets::command::CommandWidget::new(&config);
- let ts = Local::now().sub(Duration::seconds(1));
+ let ts = Local::now().sub(Duration::try_seconds(1).unwrap());
let state = ZellijState {
command_results: BTreeMap::from([(
@@ -56,7 +56,7 @@ fn bench_widget_command_dynamic(c: &mut Criterion) {
let wid = widgets::command::CommandWidget::new(&config);
- let ts = Local::now().sub(Duration::seconds(1));
+ let ts = Local::now().sub(Duration::try_seconds(1).unwrap());
let state = ZellijState {
command_results: BTreeMap::from([(
diff --git a/flake.lock b/flake.lock
index 0023d27..c23f3d6 100644
--- a/flake.lock
+++ b/flake.lock
@@ -7,11 +7,11 @@
]
},
"locked": {
- "lastModified": 1708794349,
- "narHash": "sha256-jX+B1VGHT0ruHHL5RwS8L21R6miBn4B6s9iVyUJsJJY=",
+ "lastModified": 1712681629,
+ "narHash": "sha256-bMDXn4AkTXLCpoZbII6pDGoSeSe9gI87jxPsHRXgu/E=",
"owner": "ipetkov",
"repo": "crane",
- "rev": "2c94ff9a6fbeb9f3ea0107f28688edbe9c81deaa",
+ "rev": "220387ac8e99cbee0ca4c95b621c4bc782b6a235",
"type": "github"
},
"original": {
@@ -25,11 +25,11 @@
"systems": "systems"
},
"locked": {
- "lastModified": 1709126324,
- "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
+ "lastModified": 1710146030,
+ "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "d465f4819400de7c8d874d50b982301f28a84605",
+ "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
@@ -40,11 +40,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1709294055,
- "narHash": "sha256-7EECkQYoNKJZOf2+miJdrMpxpvsn/qZFwIhUI3fQpLs=",
+ "lastModified": 1713219115,
+ "narHash": "sha256-xC8H/s6ZBnqzJIf7gIV9OIL73d43pV60E8F2VOr5QRo=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "ec869190b56a1b4677d24a8bdbcfe80ccea2ece6",
+ "rev": "2b80ce7707aedcb79be09e412b6dd6c15c578ab2",
"type": "github"
},
"original": {
@@ -72,11 +72,11 @@
]
},
"locked": {
- "lastModified": 1709259239,
- "narHash": "sha256-MbrpgqpvUND7+UnOSLazrAMj0+zle16RRiOKTtjBefw=",
+ "lastModified": 1713233539,
+ "narHash": "sha256-dPGrCy5ttx6E3bUOmDynY/cAotRqvoIAimZlbv+Zr1w=",
"owner": "oxalica",
"repo": "rust-overlay",
- "rev": "0e031ddb3f5a339dc6eda93d271ae43618b14eec",
+ "rev": "847bc25ebab8dc72a86d2b1f0c088740eebbb1b8",
"type": "github"
},
"original": {
diff --git a/plugin-dev-workspace.kdl b/plugin-dev-workspace.kdl
index 8ebb6c0..76decc9 100644
--- a/plugin-dev-workspace.kdl
+++ b/plugin-dev-workspace.kdl
@@ -5,12 +5,15 @@ layout {
pane size=2 borderless=true {
plugin location="file:target/wasm32-wasi/debug/zjstatus.wasm" {
- format_left "{mode} #[fg=#89B4FA,bg=#181825,bold]{session} {tabs} "
+ format_left "{mode}#[fg=#89B4FA,bg=#181825,bold] {session} {tabs}"
format_center "{command_0} {command_1} {command_git_branch} {command_3}"
- format_right "{tabs} {datetime}"
+ format_right "{notifications}{datetime}"
format_space "#[bg=#181825]"
- // foo
+ notification_format_unread "#[fg=#89B4FA,bg=#181825,blink]  #[fg=#89B4FA,bg=#181825] {message} "
+ notification_format_no_notifications "#[fg=#89B4FA,bg=#181825,dim]  "
+ notification_show_interval "10"
+
border_enabled "true"
border_char "─"
border_format "#[fg=#6C7086]{char}"
@@ -36,7 +39,7 @@ layout {
command_0_interval "1"
command_1_command "date"
- command_1_format "#[fg=blue,reverse,dashed-underscore,bg=default,us=red,blink,dim,strikethrough] {exit_code} {stdout} "
+ command_1_format "#[fg=blue,reverse,bg=default,us=red,blink,dim,strikethrough] {exit_code} {stdout} "
command_1_interval "1"
command_git_branch_command "git rev-parse --abbrev-ref HEAD"
diff --git a/src/bin/zjstatus.rs b/src/bin/zjstatus.rs
index 1f0de0e..86cbf70 100644
--- a/src/bin/zjstatus.rs
+++ b/src/bin/zjstatus.rs
@@ -1,25 +1,20 @@
-use config::ModuleConfig;
-use widgets::{
- command::{CommandResult, CommandWidget},
- datetime::DateTimeWidget,
- mode::ModeWidget,
- session::SessionWidget,
- swap_layout::SwapLayoutWidget,
- tabs::TabsWidget,
- widget::Widget,
-};
-
-use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
-
use zellij_tile::prelude::*;
use chrono::Local;
-use std::{collections::BTreeMap, fs::File, sync::Arc, usize};
+use std::{collections::BTreeMap, sync::Arc, usize};
use uuid::Uuid;
use zjstatus::{
- config::{self, UpdateEventMask, ZellijState},
- frames, widgets,
+ config::{self, ModuleConfig, UpdateEventMask, ZellijState},
+ frames, pipe,
+ widgets::command::{CommandResult, CommandWidget},
+ widgets::datetime::DateTimeWidget,
+ widgets::mode::ModeWidget,
+ widgets::notification::NotificationWidget,
+ widgets::session::SessionWidget,
+ widgets::swap_layout::SwapLayoutWidget,
+ widgets::tabs::TabsWidget,
+ widgets::widget::Widget,
};
#[derive(Default)]
@@ -36,6 +31,9 @@ register_plugin!(State);
#[cfg(feature = "tracing")]
fn init_tracing() {
+ use std::fs::File;
+ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
+
let file = File::create(".zjstatus.log");
let file = match file {
Ok(file) => file,
@@ -88,9 +86,34 @@ impl ZellijPlugin for State {
sessions: Vec::new(),
start_time: Local::now(),
cache_mask: 0,
+ incoming_notification: None,
};
}
+ fn pipe(&mut self, pipe_message: PipeMessage) -> bool {
+ let mut should_render = false;
+
+ match pipe_message.source {
+ PipeSource::Cli(_) => {
+ if let Some(input) = pipe_message.payload {
+ should_render = pipe::parse_protocol(&mut self.state, &input);
+ }
+ }
+ PipeSource::Plugin(_) => {
+ if let Some(input) = pipe_message.payload {
+ should_render = pipe::parse_protocol(&mut self.state, &input);
+ }
+ }
+ PipeSource::Keybind => {
+ if let Some(input) = pipe_message.payload {
+ should_render = pipe::parse_protocol(&mut self.state, &input);
+ }
+ }
+ }
+
+ should_render
+ }
+
#[tracing::instrument(skip_all, fields(event_type))]
fn update(&mut self, event: Event) -> bool {
let mut should_render = false;
@@ -267,6 +290,10 @@ fn register_widgets(configuration: &BTreeMap<String, String>) -> BTreeMap<String
Arc::new(SessionWidget::new(configuration)),
);
widget_map.insert("tabs".to_owned(), Arc::new(TabsWidget::new(configuration)));
+ widget_map.insert(
+ "notifications".to_owned(),
+ Arc::new(NotificationWidget::new(configuration)),
+ );
tracing::debug!("registered widgets: {:?}", widget_map.keys());
diff --git a/src/config.rs b/src/config.rs
index ec1efed..2c12fe4 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -6,7 +6,7 @@ use zellij_tile::prelude::*;
use crate::{
border::{parse_border_config, BorderConfig, BorderPosition},
render::FormattedPart,
- widgets::{command::CommandResult, widget::Widget},
+ widgets::{command::CommandResult, notification, widget::Widget},
};
use chrono::{DateTime, Local};
@@ -20,6 +20,7 @@ pub struct ZellijState {
pub tabs: Vec<TabInfo>,
pub sessions: Vec<SessionInfo>,
pub start_time: DateTime<Local>,
+ pub incoming_notification: Option<notification::Message>,
pub cache_mask: u8,
}
@@ -37,6 +38,7 @@ pub fn event_mask_from_widget_name(name: &str) -> u8 {
"command" => UpdateEventMask::Always as u8,
"datetime" => UpdateEventMask::Always as u8,
"mode" => UpdateEventMask::Mode as u8,
+ "notifications" => UpdateEventMask::Always as u8,
"session" => UpdateEventMask::Session as u8,
"swap_layout" => UpdateEventMask::Tab as u8,
"tabs" => UpdateEventMask::Tab as u8,
diff --git a/src/lib.rs b/src/lib.rs
index 3b7bb51..345d4af 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,5 +1,6 @@
pub mod border;
pub mod config;
pub mod frames;
+pub mod pipe;
pub mod render;
pub mod widgets;
diff --git a/src/pipe.rs b/src/pipe.rs
new file mode 100644
index 0000000..f88db89
--- /dev/null
+++ b/src/pipe.rs
@@ -0,0 +1,103 @@
+use std::ops::Sub;
+
+use chrono::{Duration, Local};
+
+use crate::{
+ config::ZellijState,
+ widgets::{command::TIMESTAMP_FORMAT, notification},
+};
+
+/// Parses the line protocol and updates the state accordingly
+///
+/// The protocol is as follows:
+///
+/// zjstatus::command_name::args
+///
+/// It first starts with `zjstatus` as a prefix to indicate that the line is
+/// used for the line protocol and zjstatus should parse it. It is followed
+/// by the command name and then the arguments. The following commands are
+/// available:
+///
+/// - `rerun` - Reruns the command with the given name (like in the config) as
+/// argument. E.g. `zjstatus::rerun::command_1`
+///
+/// The function returns a boolean indicating whether the state has been
+/// changed and the UI should be re-rendered.
+#[tracing::instrument(skip(state))]
+pub fn parse_protocol(state: &mut ZellijState, input: &str) -> bool {
+ tracing::debug!("parsing protocol");
+ let lines = input.split('\n').collect::<Vec<&str>>();
+
+ let mut should_render = false;
+ for line in lines {
+ let line_renders = process_line(state, line);
+
+ if line_renders {
+ should_render = true;
+ }
+ }
+
+ should_render
+}
+
+#[tracing::instrument(skip_all)]
+fn process_line(state: &mut ZellijState, line: &str) -> bool {
+ let parts = line.split("::").collect::<Vec<&str>>();
+
+ if parts.len() < 3 {
+ return false;
+ }
+
+ if parts[0] != "zjstatus" {
+ return false;
+ }
+
+ tracing::debug!("command: {}", parts[1]);
+
+ let mut should_render = false;
+ #[allow(clippy::single_match)]
+ match parts[1] {
+ "rerun" => {
+ rerun_command(state, parts[2]);
+
+ should_render = true;
+ }
+ "notify" => {
+ notify(state, parts[2]);
+
+ should_render = true;
+ }
+ _ => {}
+ }
+
+ should_render
+}
+
+fn notify(state: &mut ZellijState, message: &str) {
+ state.incoming_notification = Some(notification::Message {
+ body: message.to_string(),
+ received_at: Local::now(),
+ });
+}
+
+fn rerun_command(state: &mut ZellijState, command_name: &str) {
+ let command_result = state.command_results.get(command_name);
+
+ if command_result.is_none() {
+ return;
+ }
+
+ let mut command_result = command_result.unwrap().clone();
+
+ let ts = Sub::<Duration>::sub(Local::now(), Duration::try_days(1).unwrap());
+
+ command_result.context.insert(
+ "timestamp".to_string(),
+ ts.format(TIMESTAMP_FORMAT).to_string(),
+ );
+
+ state.command_results.remove(command_name);
+ state
+ .command_results
+ .insert(command_name.to_string(), command_result.clone());
+}
diff --git a/src/widgets/command.rs b/src/widgets/command.rs
index 05bc94a..9e095c9 100644
--- a/src/widgets/command.rs
+++ b/src/widgets/command.rs
@@ -210,13 +210,13 @@ fn get_timestamp_from_event_or_default(
return Local::now();
}
- return Sub::<Duration>::sub(Local::now(), Duration::days(1));
+ return Sub::<Duration>::sub(Local::now(), Duration::try_days(1).unwrap());
}
let command_result = command_result.unwrap();
let ts_context = command_result.context.get("timestamp");
if ts_context.is_none() {
- return Sub::<Duration>::sub(Local::now(), Duration::days(1));
+ return Sub::<Duration>::sub(Local::now(), Duration::try_days(1).unwrap());
}
let ts_context = ts_context.unwrap();
@@ -226,7 +226,7 @@ fn get_timestamp_from_event_or_default(
match DateTime::parse_from_str(ts_context, TIMESTAMP_FORMAT) {
Ok(ts) => ts.into(),
- Err(_) => Sub::<Duration>::sub(Local::now(), Duration::days(1)),
+ Err(_) => Sub::<Duration>::sub(Local::now(), Duration::try_days(1).unwrap()),
}
}
diff --git a/src/widgets/mod.rs b/src/widgets/mod.rs
index 9fcd130..1b20e48 100644
--- a/src/widgets/mod.rs
+++ b/src/widgets/mod.rs
@@ -1,6 +1,7 @@
pub mod command;
pub mod datetime;
pub mod mode;
+pub mod notification;
pub mod swap_layout;
pub mod session;
pub mod tabs;
diff --git a/src/widgets/notification.rs b/src/widgets/notification.rs
new file mode 100644
index 0000000..5023fa7
--- /dev/null
+++ b/src/widgets/notification.rs
@@ -0,0 +1,78 @@
+use std::collections::BTreeMap;
+
+use chrono::{DateTime, Local};
+
+use crate::render::FormattedPart;
+use crate::{config::ZellijState, widgets::widget::Widget};
+
+#[derive(Clone, Debug, Default)]
+pub struct Message {
+ pub body: String,
+ pub received_at: DateTime<Local>,
+}
+
+pub struct NotificationWidget {
+ show_interval: i64,
+ format_unread: Vec<FormattedPart>,
+ format_no_notifications: Vec<FormattedPart>,
+}
+
+impl NotificationWidget {
+ pub fn new(config: &BTreeMap<String, String>) -> Self {
+ let format_unread = match config.get("notification_format_unread") {
+ Some(f) => FormattedPart::multiple_from_format_string(f),
+ None => FormattedPart::multiple_from_format_string(""),
+ };
+
+ let format_no_notifications = match config.get("notification_format_no_notifications") {
+ Some(f) => FormattedPart::multiple_from_format_string(f),
+ None => FormattedPart::multiple_from_format_string(""),
+ };
+
+ let show_interval = match config.get("notification_show_interval") {
+ Some(i) => i.parse::<i64>().unwrap_or(5),
+ None => 5,
+ };
+
+ Self {
+ show_interval,
+ format_unread,
+ format_no_notifications,
+ }
+ }
+}
+
+impl Widget for NotificationWidget {
+ fn process(&self, _name: &str, state: &ZellijState) -> String {
+ let message = match state.incoming_notification {
+ Some(ref message) => message.clone(),
+ None => Message::default(),
+ };
+
+ let no_new =
+ message.received_at.timestamp() + self.show_interval < Local::now().timestamp();
+
+ tracing::debug!("no_new: {}", no_new);
+
+ let format = match no_new {
+ true => self.format_no_notifications.clone(),
+ false => self.format_unread.clone(),
+ };
+
+ let mut output = "".to_owned();
+
+ for f in format.iter() {
+ let mut content = f.content.clone();
+
+ if content.contains("{message}") {
+ content = content.replace("{message}", message.body.as_str());
+ }
+
+ output = format!("{}{}", output, f.format_string(&content));
+ }
+
+ output.to_owned()
+ }
+
+ fn process_click(&self, _state: &ZellijState, _pos: usize) {}
+}