Compare commits
4 Commits
df5308e3dd
...
2d054bb9a1
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d054bb9a1 | |||
| f09145eccd | |||
| 1a2ad57826 | |||
| cbb709afda |
82
Cargo.lock
generated
82
Cargo.lock
generated
@ -1,5 +1,13 @@
|
|||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
|
[[package]]
|
||||||
|
name = "aho-corasick"
|
||||||
|
version = "0.7.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "alsa"
|
name = "alsa"
|
||||||
version = "0.1.10"
|
version = "0.1.10"
|
||||||
@ -53,6 +61,26 @@ dependencies = [
|
|||||||
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "chrono"
|
||||||
|
version = "0.4.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "chrono-tz"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"parse-zoneinfo 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "2.33.0"
|
version = "2.33.0"
|
||||||
@ -117,8 +145,11 @@ dependencies = [
|
|||||||
name = "i3xs"
|
name = "i3xs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"chrono-tz 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"i3monkit 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"i3monkit 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"spark 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -148,6 +179,11 @@ dependencies = [
|
|||||||
"vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memchr"
|
||||||
|
version = "2.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num"
|
name = "num"
|
||||||
version = "0.1.42"
|
version = "0.1.42"
|
||||||
@ -210,6 +246,14 @@ dependencies = [
|
|||||||
"vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "parse-zoneinfo"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkg-config"
|
name = "pkg-config"
|
||||||
version = "0.3.16"
|
version = "0.3.16"
|
||||||
@ -252,6 +296,22 @@ name = "redox_syscall"
|
|||||||
version = "0.1.56"
|
version = "0.1.56"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex"
|
||||||
|
version = "1.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-syntax"
|
||||||
|
version = "0.6.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@ -302,6 +362,11 @@ dependencies = [
|
|||||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "spark"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "structopt"
|
name = "structopt"
|
||||||
version = "0.2.18"
|
version = "0.2.18"
|
||||||
@ -350,6 +415,14 @@ dependencies = [
|
|||||||
"unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thread_local"
|
||||||
|
version = "0.3.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.1.42"
|
version = "0.1.42"
|
||||||
@ -405,6 +478,7 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
|
"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"
|
||||||
"checksum alsa 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d59934ece7c39ba89796b3cae0e7a56cd0a346a1b6b9194dd3e2a1a48b629249"
|
"checksum alsa 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d59934ece7c39ba89796b3cae0e7a56cd0a346a1b6b9194dd3e2a1a48b629249"
|
||||||
"checksum alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0edcbbf9ef68f15ae1b620f722180b82a98b6f0628d30baa6b8d2a5abc87d58"
|
"checksum alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0edcbbf9ef68f15ae1b620f722180b82a98b6f0628d30baa6b8d2a5abc87d58"
|
||||||
"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"
|
"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"
|
||||||
@ -413,6 +487,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
"checksum cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)" = "4fc9a35e1f4290eb9e5fc54ba6cf40671ed2a2514c3eeb2b2a908dda2ea5a1be"
|
"checksum cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)" = "4fc9a35e1f4290eb9e5fc54ba6cf40671ed2a2514c3eeb2b2a908dda2ea5a1be"
|
||||||
"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33"
|
"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33"
|
||||||
"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e"
|
"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e"
|
||||||
|
"checksum chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e8493056968583b0193c1bb04d6f7684586f3726992d6c573261941a895dbd68"
|
||||||
|
"checksum chrono-tz 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e0e430fad0384e4defc3dc6b1223d1b886087a8bf9b7080e5ae027f73851ea15"
|
||||||
"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
|
"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
|
||||||
"checksum curl 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "d08ad3cb89d076a36b0ce5749eec2c9964f70c0c58480ab6b75a91ec4fc206d8"
|
"checksum curl 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "d08ad3cb89d076a36b0ce5749eec2c9964f70c0c58480ab6b75a91ec4fc206d8"
|
||||||
"checksum curl-sys 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)" = "520594da9914c1dc77ce3be450fc1c74fde67c82966d80f8e93c6d460eb0e9ae"
|
"checksum curl-sys 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)" = "520594da9914c1dc77ce3be450fc1c74fde67c82966d80f8e93c6d460eb0e9ae"
|
||||||
@ -422,6 +498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
|
"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
|
||||||
"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
|
"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
|
||||||
|
"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
|
||||||
"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e"
|
"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e"
|
||||||
"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09"
|
"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09"
|
||||||
"checksum num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "76bd5272412d173d6bf9afdf98db8612bbabc9a7a830b7bfc9c188911716132e"
|
"checksum num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "76bd5272412d173d6bf9afdf98db8612bbabc9a7a830b7bfc9c188911716132e"
|
||||||
@ -429,23 +506,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273"
|
"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273"
|
||||||
"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
|
"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
|
||||||
"checksum openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)" = "f4fad9e54bd23bd4cbbe48fdc08a1b8091707ac869ef8508edea2fec77dcc884"
|
"checksum openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)" = "f4fad9e54bd23bd4cbbe48fdc08a1b8091707ac869ef8508edea2fec77dcc884"
|
||||||
|
"checksum parse-zoneinfo 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "089a398ccdcdd77b8c38909d5a1e4b67da1bc4c9dbfe6d5b536c828eddb779e5"
|
||||||
"checksum pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "72d5370d90f49f70bd033c3d75e87fc529fbfff9d6f7cccef07d6170079d91ea"
|
"checksum pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "72d5370d90f49f70bd033c3d75e87fc529fbfff9d6f7cccef07d6170079d91ea"
|
||||||
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
|
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
|
||||||
"checksum proc-macro2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afdc77cc74ec70ed262262942ebb7dac3d479e9e5cfa2da1841c0806f6cdabcc"
|
"checksum proc-macro2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afdc77cc74ec70ed262262942ebb7dac3d479e9e5cfa2da1841c0806f6cdabcc"
|
||||||
"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
|
"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
|
||||||
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
|
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
|
||||||
"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
|
"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
|
||||||
|
"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd"
|
||||||
|
"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716"
|
||||||
"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997"
|
"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997"
|
||||||
"checksum schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021"
|
"checksum schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021"
|
||||||
"checksum serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "9796c9b7ba2ffe7a9ce53c2287dfc48080f4b2b362fcc245a259b3a7201119dd"
|
"checksum serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "9796c9b7ba2ffe7a9ce53c2287dfc48080f4b2b362fcc245a259b3a7201119dd"
|
||||||
"checksum serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "4b133a43a1ecd55d4086bd5b4dc6c1751c68b1bfbeba7a5040442022c7e7c02e"
|
"checksum serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "4b133a43a1ecd55d4086bd5b4dc6c1751c68b1bfbeba7a5040442022c7e7c02e"
|
||||||
"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704"
|
"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704"
|
||||||
"checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85"
|
"checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85"
|
||||||
|
"checksum spark 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cdfdbc4ce5316afaa9023d28ed77019bc0860e68e6e5857643a14071520347cb"
|
||||||
"checksum structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "16c2cdbf9cc375f15d1b4141bc48aeef444806655cd0e904207edc8d68d86ed7"
|
"checksum structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "16c2cdbf9cc375f15d1b4141bc48aeef444806655cd0e904207edc8d68d86ed7"
|
||||||
"checksum structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "53010261a84b37689f9ed7d395165029f9cc7abb9f56bbfe86bee2597ed25107"
|
"checksum structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "53010261a84b37689f9ed7d395165029f9cc7abb9f56bbfe86bee2597ed25107"
|
||||||
"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
|
"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
|
||||||
"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf"
|
"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf"
|
||||||
"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
|
"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
|
||||||
|
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
|
||||||
"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"
|
"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"
|
||||||
"checksum unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1967f4cdfc355b37fd76d2a954fb2ed3871034eb4f26d60537d88795cfc332a9"
|
"checksum unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1967f4cdfc355b37fd76d2a954fb2ed3871034eb4f26d60537d88795cfc332a9"
|
||||||
"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20"
|
"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20"
|
||||||
|
|||||||
@ -11,8 +11,12 @@ name = "i3xs"
|
|||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "i3xs"
|
name = "i3xs-work"
|
||||||
path = "src/bin/main.rs"
|
path = "src/bin/work.rs"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "i3xs-home"
|
||||||
|
path = "src/bin/home.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
i3monkit = "0.1.2"
|
i3monkit = "0.1.2"
|
||||||
@ -20,3 +24,4 @@ num_cpus = "1.0"
|
|||||||
structopt = { version = "0.2", default-features = false }
|
structopt = { version = "0.2", default-features = false }
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
chrono-tz = "0.5"
|
chrono-tz = "0.5"
|
||||||
|
spark = "0.4.0"
|
||||||
|
|||||||
@ -1,14 +1,15 @@
|
|||||||
use i3monkit::{I3Protocol, Header, WidgetCollection};
|
use i3monkit::widgets::CpuWidget;
|
||||||
use i3monkit::widgets::{NetworkSpeedWidget, CpuWidget};
|
use i3monkit::{Header, I3Protocol, WidgetCollection};
|
||||||
|
|
||||||
use num_cpus;
|
use num_cpus;
|
||||||
|
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
|
|
||||||
use i3xs::widgets::DateTimeWidget;
|
use i3xs::widgets::datetime::DateTimeWidget;
|
||||||
|
use i3xs::widgets::network::NetworkSpeedWidget;
|
||||||
|
|
||||||
#[derive(Debug, StructOpt)]
|
#[derive(Debug, StructOpt)]
|
||||||
#[structopt(name="i3xs", about="Custom i3 status bar program.")]
|
#[structopt(name = "i3xs", about = "Custom i3 status bar program.")]
|
||||||
struct Opt {
|
struct Opt {
|
||||||
#[structopt(short, long)]
|
#[structopt(short, long)]
|
||||||
nic: String,
|
nic: String,
|
||||||
@ -17,19 +18,18 @@ struct Opt {
|
|||||||
fn main() {
|
fn main() {
|
||||||
let mut bar = WidgetCollection::new();
|
let mut bar = WidgetCollection::new();
|
||||||
|
|
||||||
let opts=Opt::from_args();
|
let opts = Opt::from_args();
|
||||||
|
|
||||||
// Realtime upload/download rate for a interface
|
|
||||||
bar.push(NetworkSpeedWidget::new(&opts.nic));
|
|
||||||
|
|
||||||
//Display all the cpu usage for each core
|
//Display all the cpu usage for each core
|
||||||
for i in 0..num_cpus::get() as u32 {
|
for i in 0..num_cpus::get() as u32 {
|
||||||
bar.push(CpuWidget::new(i));
|
bar.push(CpuWidget::new(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
bar.push(DateTimeWidget::new());
|
// Realtime upload/download rate for a interface
|
||||||
bar.push(DateTimeWidget::new());
|
bar.push(NetworkSpeedWidget::new(&opts.nic, 6));
|
||||||
|
|
||||||
// Then start updating the satus bar
|
bar.push(DateTimeWidget::new("%m/%d %H:%M".to_string()));
|
||||||
|
|
||||||
|
// Then start updating the status bar
|
||||||
bar.update_loop(I3Protocol::new(Header::new(1), std::io::stdout()));
|
bar.update_loop(I3Protocol::new(Header::new(1), std::io::stdout()));
|
||||||
}
|
}
|
||||||
39
src/bin/work.rs
Normal file
39
src/bin/work.rs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
use i3monkit::widgets::CpuWidget;
|
||||||
|
use i3monkit::{Header, I3Protocol, WidgetCollection};
|
||||||
|
|
||||||
|
use num_cpus;
|
||||||
|
|
||||||
|
use structopt::StructOpt;
|
||||||
|
|
||||||
|
use i3xs::widgets::datetime::DateTimeWidget;
|
||||||
|
use i3xs::widgets::network::NetworkSpeedWidget;
|
||||||
|
|
||||||
|
#[derive(Debug, StructOpt)]
|
||||||
|
#[structopt(name = "i3xs", about = "Custom i3 status bar program.")]
|
||||||
|
struct Opt {
|
||||||
|
#[structopt(short, long)]
|
||||||
|
nic: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let mut bar = WidgetCollection::new();
|
||||||
|
|
||||||
|
let opts = Opt::from_args();
|
||||||
|
|
||||||
|
//Display all the cpu usage for each core
|
||||||
|
for i in 0..num_cpus::get() as u32 {
|
||||||
|
bar.push(CpuWidget::new(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Realtime upload/download rate for a interface
|
||||||
|
bar.push(NetworkSpeedWidget::new(&opts.nic, 6));
|
||||||
|
|
||||||
|
bar.push(DateTimeWidget::tz(
|
||||||
|
"%H:%M %Z".to_string(),
|
||||||
|
"Europe/London".to_string(),
|
||||||
|
));
|
||||||
|
bar.push(DateTimeWidget::new("%m/%d %H:%M".to_string()));
|
||||||
|
|
||||||
|
// Then start updating the status bar
|
||||||
|
bar.update_loop(I3Protocol::new(Header::new(1), std::io::stdout()));
|
||||||
|
}
|
||||||
@ -1,52 +0,0 @@
|
|||||||
use chrono::DateTime;
|
|
||||||
use chrono_tz::Tz;
|
|
||||||
|
|
||||||
use i3monkit::{Widget, WidgetUpdate};
|
|
||||||
use i3monkit::Block;
|
|
||||||
|
|
||||||
trait Clock<Tz> {
|
|
||||||
fn now() -> DateTime<Tz>;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct LocalClock;
|
|
||||||
impl Clock<Tz> for LocalClock {
|
|
||||||
fn now() -> DateTime<Tz> {
|
|
||||||
chrono::Local::now()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The widget that shows local time
|
|
||||||
pub struct DateTimeWidget{
|
|
||||||
clock: dyn Clock<Tz>
|
|
||||||
}
|
|
||||||
|
|
||||||
impl DateTimeWidget {
|
|
||||||
/// Create a new time widget
|
|
||||||
pub fn new() -> Self {
|
|
||||||
DateTimeWidget{
|
|
||||||
clock: LocalClock{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
pub fn tz(tz : String)->Self {
|
|
||||||
DateTimeWidget{
|
|
||||||
clock: tz.parse().unwrap(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Widget for DateTimeWidget {
|
|
||||||
fn update(&mut self) -> Option<WidgetUpdate> {
|
|
||||||
let time_string = if self.0 {
|
|
||||||
format!("{}", self.now().format("%H:%M"))
|
|
||||||
} else {
|
|
||||||
format!("{}", self.now().format("%H %M"))
|
|
||||||
};
|
|
||||||
|
|
||||||
Some(WidgetUpdate {
|
|
||||||
refresh_interval: std::time::Duration::new(1, 0),
|
|
||||||
data: Some(Block::new().append_full_text(&time_string).clone())
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
44
src/widgets/datetime.rs
Normal file
44
src/widgets/datetime.rs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
use chrono_tz::Tz;
|
||||||
|
|
||||||
|
use i3monkit::Block;
|
||||||
|
use i3monkit::{Widget, WidgetUpdate};
|
||||||
|
|
||||||
|
/// The widget that shows local time
|
||||||
|
pub struct DateTimeWidget {
|
||||||
|
/// fmt to format the datetime, see
|
||||||
|
/// https://docs.rs/chrono/*/chrono/format/strftime/index.html for documentation.
|
||||||
|
fmt: String,
|
||||||
|
/// tz string, values from https://docs.rs/chrono-tz/*/chrono_tz/
|
||||||
|
/// None will use local time.
|
||||||
|
tz: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DateTimeWidget {
|
||||||
|
// Create a new time widget
|
||||||
|
pub fn new(fmt: String) -> Self {
|
||||||
|
DateTimeWidget { fmt, tz: None }
|
||||||
|
}
|
||||||
|
pub fn tz(fmt: String, tz: String) -> Self {
|
||||||
|
DateTimeWidget { fmt, tz: Some(tz) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Widget for DateTimeWidget {
|
||||||
|
fn update(&mut self) -> Option<WidgetUpdate> {
|
||||||
|
let now = chrono::Local::now();
|
||||||
|
let time_string = match &self.tz {
|
||||||
|
Some(tz) => {
|
||||||
|
let tz: Tz = tz.parse().unwrap();
|
||||||
|
let now = now.with_timezone(&tz);
|
||||||
|
//TODO(wathiede): convert to timezone.
|
||||||
|
now.format(&self.fmt).to_string()
|
||||||
|
}
|
||||||
|
None => now.format(&self.fmt).to_string(),
|
||||||
|
};
|
||||||
|
|
||||||
|
Some(WidgetUpdate {
|
||||||
|
refresh_interval: std::time::Duration::new(1, 0),
|
||||||
|
data: Some(Block::new().append_full_text(&time_string).clone()),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
2
src/widgets/mod.rs
Normal file
2
src/widgets/mod.rs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
pub mod datetime;
|
||||||
|
pub mod network;
|
||||||
164
src/widgets/network.rs
Normal file
164
src/widgets/network.rs
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
use i3monkit::Block;
|
||||||
|
use i3monkit::{Widget, WidgetUpdate};
|
||||||
|
|
||||||
|
use std::collections::vec_deque::VecDeque;
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io::{BufRead, BufReader, Error, ErrorKind, Result};
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use std::time::SystemTime;
|
||||||
|
|
||||||
|
use spark;
|
||||||
|
|
||||||
|
const NETWORK_PATH_PREFIX: &'static str = "/sys/class/net";
|
||||||
|
const NETWORK_STAT_SUFFIX: &'static str = "statistics/dummy";
|
||||||
|
|
||||||
|
struct TransferStat {
|
||||||
|
rx: u64,
|
||||||
|
tx: u64,
|
||||||
|
ts: SystemTime,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TransferStat {
|
||||||
|
fn read_stat(interface: &str) -> Result<Self> {
|
||||||
|
let mut path = PathBuf::new();
|
||||||
|
path.push(format!(
|
||||||
|
"{}/{}/{}",
|
||||||
|
NETWORK_PATH_PREFIX, interface, NETWORK_STAT_SUFFIX
|
||||||
|
));
|
||||||
|
|
||||||
|
let mut read_stat_file = move |what: &str| {
|
||||||
|
path.set_file_name(what);
|
||||||
|
|
||||||
|
let reader = BufReader::new(File::open(path.as_path())?);
|
||||||
|
|
||||||
|
if let Some(line) = reader.lines().next() {
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Err(Error::new(ErrorKind::Other, "Empty file"));
|
||||||
|
};
|
||||||
|
|
||||||
|
let rx = u64::from_str_radix(&(read_stat_file("rx_bytes")?), 10).unwrap();
|
||||||
|
let tx = u64::from_str_radix(&(read_stat_file("tx_bytes")?), 10).unwrap();
|
||||||
|
let ts = SystemTime::now();
|
||||||
|
|
||||||
|
return Ok(Self { rx, tx, ts });
|
||||||
|
}
|
||||||
|
|
||||||
|
fn duration(&self, earlier: &Self) -> f64 {
|
||||||
|
let duration = self.ts.duration_since(earlier.ts).unwrap();
|
||||||
|
let secs = duration.as_secs() as f64 + duration.subsec_nanos() as f64 / 1_000_000_000.0;
|
||||||
|
return secs;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn rx_rate(&self, earlier: &Self) -> f64 {
|
||||||
|
let duration = self.duration(earlier);
|
||||||
|
if duration < 1e-5 {
|
||||||
|
return std::f64::NAN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (self.rx - earlier.rx) as f64 / duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn tx_rate(&self, earlier: &Self) -> f64 {
|
||||||
|
let duration = self.duration(earlier);
|
||||||
|
if duration < 1e-5 {
|
||||||
|
return std::f64::NAN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (self.tx - earlier.tx) as f64 / duration;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A widget that shows the network speed realtimely
|
||||||
|
pub struct NetworkSpeedWidget {
|
||||||
|
interface: String,
|
||||||
|
last_stat: TransferStat,
|
||||||
|
rx_history: VecDeque<f32>,
|
||||||
|
tx_history: VecDeque<f32>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl NetworkSpeedWidget {
|
||||||
|
/// Create the widget, for given interface.
|
||||||
|
///
|
||||||
|
/// **interface** The interface to monitor
|
||||||
|
pub fn new(interface: &str, num_samples: usize) -> Self {
|
||||||
|
let last_stat = TransferStat::read_stat(interface).unwrap();
|
||||||
|
let interface = interface.to_string();
|
||||||
|
let rx_history: VecDeque<f32> = (0..num_samples).map(|_| 0.).collect();
|
||||||
|
let tx_history: VecDeque<f32> = (0..num_samples).map(|_| 0.).collect();
|
||||||
|
Self {
|
||||||
|
last_stat,
|
||||||
|
interface,
|
||||||
|
rx_history,
|
||||||
|
tx_history,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn format_rate(rate: f64) -> String {
|
||||||
|
if rate.is_nan() {
|
||||||
|
return "N/A".to_string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const UNIT_NAME: [&'static str; 6] = [" B/s", "KB/s", "MB/s", "GB/s", "TB/s", "PB/s"];
|
||||||
|
|
||||||
|
let mut best_unit = UNIT_NAME[0];
|
||||||
|
let mut best_multiplier = 1.0;
|
||||||
|
|
||||||
|
for unit in UNIT_NAME[1..].iter() {
|
||||||
|
if best_multiplier > rate / 1024.0 {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
best_unit = unit;
|
||||||
|
best_multiplier *= 1024.0
|
||||||
|
}
|
||||||
|
|
||||||
|
let ret = format!("{:6.1}{}", rate / best_multiplier, best_unit);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_human_readable_stat(&mut self) -> Result<(String, String)> {
|
||||||
|
let cur_stat = TransferStat::read_stat(&self.interface)?;
|
||||||
|
|
||||||
|
let rx_rate = cur_stat.rx_rate(&self.last_stat);
|
||||||
|
let tx_rate = cur_stat.tx_rate(&self.last_stat);
|
||||||
|
|
||||||
|
dbg!(&self.rx_history);
|
||||||
|
dbg!(&self.tx_history);
|
||||||
|
self.rx_history.push_back(rx_rate as f32);
|
||||||
|
self.rx_history.pop_front();
|
||||||
|
self.tx_history.push_back(tx_rate as f32);
|
||||||
|
self.tx_history.pop_front();
|
||||||
|
self.last_stat = cur_stat;
|
||||||
|
|
||||||
|
return Ok((Self::format_rate(rx_rate), Self::format_rate(tx_rate)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Widget for NetworkSpeedWidget {
|
||||||
|
fn update(&mut self) -> Option<WidgetUpdate> {
|
||||||
|
if let Ok((rx, tx)) = self.get_human_readable_stat() {
|
||||||
|
let mut data = Block::new();
|
||||||
|
let (rx_history, tx_history) = if self.rx_history.len() > 1 {
|
||||||
|
(
|
||||||
|
spark::graph(&self.rx_history.iter().cloned().collect::<Vec<f32>>()),
|
||||||
|
spark::graph(&self.tx_history.iter().cloned().collect::<Vec<f32>>()),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
("".to_string(), "".to_string())
|
||||||
|
};
|
||||||
|
eprintln!("rx_history {} tx_history {}", &rx_history, &tx_history);
|
||||||
|
data.use_pango();
|
||||||
|
data.append_full_text(&format!(
|
||||||
|
"Rx:<tt>{}</tt>{} Tx:<tt>{}</tt>{}",
|
||||||
|
rx, rx_history, tx, tx_history
|
||||||
|
));
|
||||||
|
return Some(WidgetUpdate {
|
||||||
|
refresh_interval: std::time::Duration::new(10, 0),
|
||||||
|
data: Some(data),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user