mirror of https://github.com/bobwen-dev/hunter
big fat update to graphics mode (performance, features, etc)
This commit is contained in:
parent
3ba311a5bb
commit
f38093ad1f
|
@ -342,118 +342,175 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glib"
|
||||
version = "0.5.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "glib-sys"
|
||||
version = "0.6.0"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gobject-sys"
|
||||
version = "0.6.0"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer"
|
||||
version = "0.11.6"
|
||||
version = "0.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"muldiv 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"muldiv 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-app"
|
||||
version = "0.11.2"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer 0.11.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-app-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-app-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-app-sys"
|
||||
version = "0.5.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-base"
|
||||
version = "0.11.0"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer 0.11.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-base-sys"
|
||||
version = "0.5.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-player"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-player-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-video 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-player-sys"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-video-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-sys"
|
||||
version = "0.5.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-video"
|
||||
version = "0.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-video-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-video-sys"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -470,8 +527,11 @@ dependencies = [
|
|||
"dirs-2 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer 0.11.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-app 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-app 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-base 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-player 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-video 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -485,7 +545,8 @@ dependencies = [
|
|||
"rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"signal-notify 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sixel 0.3.0 (git+https://github.com/rabite0/sixel-rs?tag=v0.3.0)",
|
||||
"sixel 0.3.1 (git+https://github.com/rabite0/sixel-rs?tag=v0.3.1)",
|
||||
"sixel-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"systemstat 0.1.4 (git+https://github.com/myfreeweb/systemstat?tag=v0.1.4)",
|
||||
"termion 1.5.3 (git+https://github.com/redox-os/termion)",
|
||||
"tree_magic 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -695,7 +756,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "muldiv"
|
||||
version = "0.1.1"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
|
@ -773,15 +834,6 @@ dependencies = [
|
|||
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-rational"
|
||||
version = "0.1.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"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)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-rational"
|
||||
version = "0.2.2"
|
||||
|
@ -1223,8 +1275,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "sixel"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/rabite0/sixel-rs?tag=v0.3.0#9018082b3b5d094e7a634292d7c3ae09f4fd2cd1"
|
||||
version = "0.3.1"
|
||||
source = "git+https://github.com/rabite0/sixel-rs?tag=v0.3.1#e94c283d920a6c2e73aadea9635ef9331e00ea8e"
|
||||
dependencies = [
|
||||
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"semver-parser 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1297,7 +1349,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "termion"
|
||||
version = "1.5.3"
|
||||
source = "git+https://github.com/redox-os/termion#11fbe7155681c3c87495a2fa8ee9f822b18e2b2a"
|
||||
source = "git+https://github.com/redox-os/termion#c27678efc2ed14576361c7ce6d806a6bb576f1a9"
|
||||
dependencies = [
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1541,15 +1593,19 @@ dependencies = [
|
|||
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
|
||||
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
|
||||
"checksum gif 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "86c2f2b597d6e05c86ee5947b2223bda468fe8dad3e88e2a6520869322aaf568"
|
||||
"checksum glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e0be1b1432e227bcd1a9b28db9dc1474a7e7fd4227e08e16f35304f32d09b61"
|
||||
"checksum glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615bef979b5838526aee99241afc80cfb2e34a8735d4bcb8ec6072598c18a408"
|
||||
"checksum gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "70409d6405db8b1591602fcd0cbe8af52cd9976dd39194442b4c149ba343f86d"
|
||||
"checksum gstreamer 0.11.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6c5a43723784a8b3a308541f3752370ee0ee3b6dc26ed50cdd06e8d9f5399cc"
|
||||
"checksum gstreamer-app 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4e68d96a6a86fe4e4796d7ecb5a3cacd6b4680277da6daea7934612fa8c5c2bf"
|
||||
"checksum gstreamer-app-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a224d33c7780957c30f9280b1256b3882792dda6916f75b54bb30b5b71ed505a"
|
||||
"checksum gstreamer-base 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05ec7a84b4160b61c72ea27ccf3f46eb9c8f996c5991746623e69e3e532e3cb5"
|
||||
"checksum gstreamer-base-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "501a7add44f256aab6cb5b65ef121c449197cf55087d6a7586846c8d1e42e88b"
|
||||
"checksum gstreamer-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b2f51e25a6f97dd4bfd640cba96f192f8759b8766afd66d6d9ea0f82ca14a37"
|
||||
"checksum glib 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d70d737019da0473a7cd6d9240571cf58c6897dcb10edf32b90774f4ba237c1b"
|
||||
"checksum glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b86a9169fbc9cf9a0ef315039c2304b09d5c575c5fde7defba3576a0311b863"
|
||||
"checksum gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "61d55bc9202447ca776f6ad0048c36e3312010f66f82ab478e97513e93f3604b"
|
||||
"checksum gstreamer 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4fa1bf3aa35e465a976a28b3f32df88b773d8707a1c40cd8a6d5d29f4384256c"
|
||||
"checksum gstreamer-app 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a85485c2db4149ccb24d0b3c6598725743dec254bf757ac7a3684e62b9822c27"
|
||||
"checksum gstreamer-app-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41c85ef44d827b9292833203f6623cf6592d5eda06ad1eeefa63bca0cc38ce71"
|
||||
"checksum gstreamer-base 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f9e72a0456c51e9cf3a21c96539bed9be3f38c85ea49eee6d87a4d61db0cc2b0"
|
||||
"checksum gstreamer-base-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ba1955ea091323c17fdf8ff54fd7cf3dfed1a6035193ba08f85eb76bf549056"
|
||||
"checksum gstreamer-player 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "78395f87de2b954ca3e33a594a4eb85e68246f5f41a70bf0ab52187aacb4d3a9"
|
||||
"checksum gstreamer-player-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c3608d3e96c8977f31b9b8db7da0b8d0e96758b060e3f05fc3ee9626d75ab1c5"
|
||||
"checksum gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfc2f6cc9b6a1f5159bfd500310fe431cfb0b74b3af17ce3fdf8353cf586975"
|
||||
"checksum gstreamer-video 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44868f3390bec7cad142f5fc3e39bb1782d1453d07889efd2ac69a50b0656d1f"
|
||||
"checksum gstreamer-video-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6b8fcb1e577de93d1ad1e5117234ce64d40f215143d752140719923651608983"
|
||||
"checksum image 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "99198e595d012efccf12abf4abc08da2d97be0b0355a2b08d101347527476ba4"
|
||||
"checksum inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff"
|
||||
"checksum inotify 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40b54539f3910d6f84fbf9a643efd6e3aa6e4f001426c0329576128255994718"
|
||||
|
@ -1574,7 +1630,7 @@ dependencies = [
|
|||
"checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23"
|
||||
"checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40"
|
||||
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
|
||||
"checksum muldiv 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1cbef5aa2e8cd82a18cc20e26434cc9843e1ef46e55bfabe5bddb022236c5b3e"
|
||||
"checksum muldiv 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "451a9a05d2a32c566c897835e0ea95cf79ed2fdfe957924045a1721a36c9980f"
|
||||
"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
|
||||
"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
|
||||
"checksum nom 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf51a729ecf40266a2368ad335a5fdde43471f545a967109cd62146ecf8b66ff"
|
||||
|
@ -1583,7 +1639,6 @@ dependencies = [
|
|||
"checksum num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2"
|
||||
"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-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e"
|
||||
"checksum num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2885278d5fe2adc2f75ced642d52d879bffaceb5a2e0b1d4309ffdfb239b454"
|
||||
"checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32"
|
||||
"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273"
|
||||
|
@ -1636,7 +1691,7 @@ dependencies = [
|
|||
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||
"checksum signal-notify 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "847fbedad7c2e6fbb6077befa1fa61a6336658eaae2d9fe66cb94a0024742f4e"
|
||||
"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac"
|
||||
"checksum sixel 0.3.0 (git+https://github.com/rabite0/sixel-rs?tag=v0.3.0)" = "<none>"
|
||||
"checksum sixel 0.3.1 (git+https://github.com/rabite0/sixel-rs?tag=v0.3.1)" = "<none>"
|
||||
"checksum sixel-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fb46e0cd5569bf910390844174a5a99d52dd40681fff92228d221d9f8bf87dea"
|
||||
"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
|
||||
"checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7"
|
||||
|
|
26
Cargo.toml
26
Cargo.toml
|
@ -40,13 +40,22 @@ osstrtools = "0.1.9"
|
|||
pathbuftools = "0.1"
|
||||
clap = "2.33"
|
||||
mime = "0.3.13"
|
||||
# Updated to work with recent sixel-sys
|
||||
sixel = { git = "https://github.com/rabite0/sixel-rs", tag="v0.3.0" }
|
||||
base64 = { version = "0.10.1" }
|
||||
base64 = "0.10.1"
|
||||
#glib = "*"
|
||||
|
||||
image = { version = "0.21.1", optional = true }
|
||||
gstreamer = { version = "0.11.2", optional = true }
|
||||
gstreamer-app = { version = "0.11.2", optional = true }
|
||||
gstreamer = { version = "0.14", optional = true }
|
||||
gstreamer-app = { version = "0.14", optional = true }
|
||||
gstreamer-player = { version = "0.14", optional = true }
|
||||
gstreamer-video = { version = "0.14", optional = true }
|
||||
gstreamer-base = { version = "0.14", optional = true }
|
||||
sixel-sys = { version="0.3.1" , optional = true }
|
||||
|
||||
[dependencies.sixel-rs]
|
||||
package = "sixel"
|
||||
git = "https://github.com/rabite0/sixel-rs"
|
||||
tag="v0.3.1"
|
||||
optional = true
|
||||
|
||||
[build-dependencies]
|
||||
# Added terminal_size_pixels recently
|
||||
|
@ -54,9 +63,10 @@ termion = { git = "https://github.com/redox-os/termion" }
|
|||
rustc_version = "0.2.3"
|
||||
|
||||
[features]
|
||||
default = ["img", "video"]
|
||||
video = ["gstreamer", "gstreamer-app"]
|
||||
default = ["img", "video", "sixel"]
|
||||
video = ["gstreamer", "gstreamer-app", "gstreamer-player","gstreamer-video", "gstreamer-base"]
|
||||
img = ["image"]
|
||||
sixel = ["sixel-rs", "sixel-sys"]
|
||||
|
||||
[[bin]]
|
||||
name = "hunter"
|
||||
|
@ -65,7 +75,7 @@ path = "src/main.rs"
|
|||
[[bin]]
|
||||
name = "hunter-media"
|
||||
path = "src/hunter-media.rs"
|
||||
required-features = ["img"]
|
||||
required-features = ["img", "sixel"]
|
||||
|
||||
|
||||
|
||||
|
|
10
README.md
10
README.md
|
@ -5,6 +5,7 @@ hunter
|
|||
|
||||
NEW
|
||||
|
||||
- [Graphics] High quality support for graphics using SIXEL/kitty protocols
|
||||
- [QuickActions] Added quick action creator/customizer
|
||||
- [Previews] New and improved preview customization
|
||||
- [**[IRC channel](https://webchat.freenode.net/?channels=hunter)**] Problems? Bugs? Praise? Chat with us: [#hunter @ Freenode](https://webchat.freenode.net/?channels=hunter)!
|
||||
|
@ -41,7 +42,7 @@ A big thanks to ranger and its developers. Without its inspiration this wouldn't
|
|||
* Exit and cd into last directory and put selected files into shell variables
|
||||
* Slide up animation for previews for a smoother experience (configurable)
|
||||
* Can show icons with the [right fonts](https://github.com/ryanoasis/nerd-fonts)
|
||||
* Optional support for previews of image/video/audio files using Unicode half-block drawing
|
||||
* Optional support for previews of image(+pdf)/video/audio files using Unicode half-block drawing and SIXEL, or kitty's graphics protocol
|
||||
|
||||
|
||||
|
||||
|
@ -67,7 +68,7 @@ hunter comes with definitions to enable previewing certain file typse. To use th
|
|||
* bat / highlight for syntax highlighting
|
||||
* 7z for archives
|
||||
* w3m / links / elinks / lynx for html
|
||||
* pdftotext / mutool for pdf
|
||||
* pdftotext / mutool for pdf or pdftoppm in graphics mode
|
||||
|
||||
### Debian/Ubuntu
|
||||
|
||||
|
@ -122,8 +123,11 @@ show_hidden=off
|
|||
select_cmd=find -type f | fzf -m
|
||||
cd_cmd=find -type d | fzf
|
||||
icons=off
|
||||
ratios=20,30,49
|
||||
media_autostart=off
|
||||
media_mute=off
|
||||
media_previewer=hunter-media
|
||||
graphics_mode=auto
|
||||
```
|
||||
|
||||
## Previews
|
||||
|
@ -137,6 +141,8 @@ and create a symlink to it in
|
|||
|
||||
with the extension of the file type you want to preview. Make sure the script is executable. That's it.
|
||||
|
||||
A graphical previewer can be created by appending ```.g``` to the name of the symlink. It should print the path to the generated image file. If you want the file deleted after display, create it in the ```/tmp/hunter-preview``` directory.
|
||||
|
||||
## Quick Actions
|
||||
These are executables you can run by pressing ```a```. Which actions you can see depends on the MIME type of the files you have selected. If you have multiple files selected, hunter will try to use the most specific MIME type possible. For example, if you have selected a bunch of images with different types you will see actions for "image/". You can see the computed MIME type in the header bar.
|
||||
|
||||
|
|
BIN
config.tar.gz
BIN
config.tar.gz
Binary file not shown.
|
@ -14,7 +14,7 @@ struct ArgvConfig {
|
|||
animation: Option<bool>,
|
||||
show_hidden: Option<bool>,
|
||||
icons: Option<bool>,
|
||||
sixel: Option<bool>,
|
||||
graphics: Option<String>,
|
||||
}
|
||||
|
||||
impl ArgvConfig {
|
||||
|
@ -23,7 +23,7 @@ impl ArgvConfig {
|
|||
animation: None,
|
||||
show_hidden: None,
|
||||
icons: None,
|
||||
sixel: None
|
||||
graphics: None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ pub fn set_argv_config(args: clap::ArgMatches) -> HResult<()> {
|
|||
let animation = args.is_present("animation-off");
|
||||
let show_hidden = args.is_present("show-hidden");
|
||||
let icons = args.is_present("icons");
|
||||
let sixel = args.is_present("sixel");
|
||||
|
||||
let mut config = ArgvConfig::new();
|
||||
|
||||
|
@ -53,8 +52,12 @@ pub fn set_argv_config(args: clap::ArgMatches) -> HResult<()> {
|
|||
config.icons = Some(true)
|
||||
}
|
||||
|
||||
if sixel == true {
|
||||
config.sixel = Some(true)
|
||||
if let Some(mode) = args.value_of("graphics") {
|
||||
if mode == "auto" {
|
||||
config.graphics = Some(detect_g_mode());
|
||||
} else {
|
||||
config.graphics = Some(String::from(mode));
|
||||
}
|
||||
}
|
||||
|
||||
*ARGV_CONFIG.write()? = config;
|
||||
|
@ -71,7 +74,7 @@ fn infuse_argv_config(mut config: Config) -> Config {
|
|||
argv_config.animation.map(|val| config.animation = val);
|
||||
argv_config.show_hidden.map(|val| config.show_hidden = val);
|
||||
argv_config.icons.map(|val| config.icons = val);
|
||||
argv_config.sixel.map(|val| config.sixel = val);
|
||||
argv_config.graphics.map(|val| config.graphics = val);
|
||||
|
||||
config
|
||||
}
|
||||
|
@ -88,7 +91,7 @@ pub struct Config {
|
|||
pub media_mute: bool,
|
||||
pub media_previewer: String,
|
||||
pub ratios: Vec::<usize>,
|
||||
pub sixel: bool,
|
||||
pub graphics: String,
|
||||
}
|
||||
|
||||
|
||||
|
@ -111,7 +114,7 @@ impl Config {
|
|||
media_mute: false,
|
||||
media_previewer: "hunter-media".to_string(),
|
||||
ratios: vec![20,30,49],
|
||||
sixel: false
|
||||
graphics: detect_g_mode(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,16 +129,16 @@ impl Config {
|
|||
|
||||
let config = config_string.lines().fold(Config::new(), |mut config, line| {
|
||||
match Config::prep_line(line) {
|
||||
Ok(("animation", "on")) => { config.animation = true; },
|
||||
Ok(("animation", "off")) => { config.animation = false; },
|
||||
Ok(("animation", "on")) => config.animation = true,
|
||||
Ok(("animation", "off")) => config.animation = false,
|
||||
Ok(("animation_refresh_frequency", frequency)) => {
|
||||
match frequency.parse::<usize>() {
|
||||
Ok(parsed_freq) => config.animation_refresh_frequency = parsed_freq,
|
||||
_ => HError::config_error::<Config>(line.to_string()).log()
|
||||
}
|
||||
}
|
||||
Ok(("show_hidden", "on")) => { config.show_hidden = true; },
|
||||
Ok(("show_hidden", "off")) => { config.show_hidden = false; },
|
||||
Ok(("show_hidden", "on")) => config.show_hidden = true,
|
||||
Ok(("show_hidden", "off")) => config.show_hidden = false,
|
||||
Ok(("icons", "on")) => config.icons = true,
|
||||
Ok(("icons", "off")) => config.icons = false,
|
||||
Ok(("select_cmd", cmd)) => {
|
||||
|
@ -146,10 +149,10 @@ impl Config {
|
|||
let cmd = cmd.to_string();
|
||||
config.cd_cmd = cmd;
|
||||
}
|
||||
Ok(("media_autoplay", "on")) => { config.media_autoplay = true; },
|
||||
Ok(("media_autoplay", "off")) => { config.media_autoplay = false; },
|
||||
Ok(("media_mute", "on")) => { config.media_mute = true; },
|
||||
Ok(("media_mute", "off")) => { config.media_mute = false; },
|
||||
Ok(("media_autoplay", "on")) => config.media_autoplay = true,
|
||||
Ok(("media_autoplay", "off")) => config.media_autoplay = false,
|
||||
Ok(("media_mute", "on")) => config.media_mute = true,
|
||||
Ok(("media_mute", "off")) => config.media_mute = false,
|
||||
Ok(("media_previewer", cmd)) => {
|
||||
let cmd = cmd.to_string();
|
||||
config.media_previewer = cmd;
|
||||
|
@ -167,7 +170,13 @@ impl Config {
|
|||
}
|
||||
}
|
||||
}
|
||||
Ok(("sixel", "on")) => { config.sixel = true; }
|
||||
#[cfg(feature = "sixel")]
|
||||
Ok(("graphics",
|
||||
"sixel")) => config.graphics = "sixel".to_string(),
|
||||
Ok(("graphics",
|
||||
"kitty")) => config.graphics = "kitty".to_string(),
|
||||
Ok(("graphics",
|
||||
"auto")) => config.graphics = detect_g_mode(),
|
||||
_ => { HError::config_error::<Config>(line.to_string()).log(); }
|
||||
}
|
||||
config
|
||||
|
@ -196,3 +205,13 @@ impl Config {
|
|||
self.show_hidden
|
||||
}
|
||||
}
|
||||
|
||||
fn detect_g_mode() -> String {
|
||||
let term = std::env::var("TERM").unwrap_or(String::new());
|
||||
match term.as_str() {
|
||||
"xterm-kitty" => "kitty",
|
||||
#[cfg(feature = "sixel")]
|
||||
"xterm" => "sixel",
|
||||
_ => "unicode"
|
||||
}.to_string()
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use crate::fail::HResult;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Size(pub (u16, u16));
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
@ -110,6 +112,19 @@ impl Coordinates {
|
|||
((xsize-1) as usize, (ysize-1) as usize)
|
||||
}
|
||||
|
||||
pub fn size_pixels(&self) -> HResult<(usize, usize)> {
|
||||
let (xsize, ysize) = self.size_u();
|
||||
let (cols, rows) = crate::term::size()?;
|
||||
let (xpix, ypix) = crate::term::size_pixels()?;
|
||||
// Cell dimensions
|
||||
let (xpix, ypix) = (xpix/cols, ypix/rows);
|
||||
// Frame dimensions
|
||||
let (xpix, ypix) = (xpix * (xsize + 1),
|
||||
ypix * (ysize + 1));
|
||||
|
||||
Ok((xpix as usize, ypix as usize))
|
||||
}
|
||||
|
||||
pub fn top(&self) -> Position {
|
||||
self.position().clone()
|
||||
}
|
||||
|
|
1021
src/hunter-media.rs
1021
src/hunter-media.rs
File diff suppressed because it is too large
Load Diff
|
@ -16,7 +16,7 @@ impl std::cmp::PartialEq for ImgView {
|
|||
pub struct ImgView {
|
||||
pub core: WidgetCore,
|
||||
pub buffer: Vec<String>,
|
||||
pub file: PathBuf
|
||||
pub file: Option<PathBuf>
|
||||
}
|
||||
|
||||
impl ImgView {
|
||||
|
@ -24,7 +24,7 @@ impl ImgView {
|
|||
let mut view = ImgView {
|
||||
core: core,
|
||||
buffer: vec![],
|
||||
file: file.to_path_buf()
|
||||
file: Some(file.to_path_buf())
|
||||
};
|
||||
|
||||
view.encode_file()?;
|
||||
|
@ -33,25 +33,23 @@ impl ImgView {
|
|||
|
||||
pub fn encode_file(&mut self) -> HResult<()> {
|
||||
let (xsize, ysize) = self.core.coordinates.size_u();
|
||||
let (cols, rows) = termion::terminal_size()?;
|
||||
let (xpix, ypix) = termion::terminal_size_pixels()?;
|
||||
let (xpix, ypix) = (xpix/cols, ypix/rows);
|
||||
let (xpix, ypix) = (xpix * (xsize as u16 + 1),
|
||||
ypix * (ysize as u16 + 1));
|
||||
let (xpix, ypix) = self.core.coordinates.size_pixels()?;
|
||||
let cell_ratio = crate::term::cell_ratio()?;
|
||||
|
||||
let file = &self.file;
|
||||
let file = &self.file.as_ref()?;
|
||||
let media_previewer = self.core.config().media_previewer;
|
||||
let sixel = self.core.config().sixel;
|
||||
let g_mode = self.core.config().graphics;
|
||||
|
||||
let output = std::process::Command::new(&media_previewer)
|
||||
.arg(format!("{}", (xsize+1)))
|
||||
.arg(format!("{}", (ysize+1)))
|
||||
.arg(format!("{}", xpix))
|
||||
.arg(format!("{}", ypix))
|
||||
.arg(format!("{}", cell_ratio))
|
||||
.arg("image")
|
||||
.arg(format!("true"))
|
||||
.arg(format!("true"))
|
||||
.arg(format!("{}", sixel))
|
||||
.arg(format!("{}", g_mode))
|
||||
.arg(file.to_string_lossy().to_string())
|
||||
.output()
|
||||
.map_err(|e| {
|
||||
|
@ -101,7 +99,9 @@ impl Widget for ImgView {
|
|||
if &self.core.coordinates == coordinates { return Ok(()) }
|
||||
|
||||
self.core.coordinates = coordinates.clone();
|
||||
self.encode_file()?;
|
||||
if self.file.is_some() {
|
||||
self.encode_file()?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -132,7 +132,8 @@ impl Widget for ImgView {
|
|||
|
||||
impl Drop for ImgView {
|
||||
fn drop(&mut self) {
|
||||
if self.core.config().sixel {
|
||||
let g_mode = self.core.config().graphics;
|
||||
if g_mode == "kitty" || g_mode == "auto" {
|
||||
print!("\x1b_Ga=d\x1b\\");
|
||||
}
|
||||
}
|
||||
|
|
10
src/main.rs
10
src/main.rs
|
@ -152,11 +152,11 @@ fn parse_args() -> HResult<()> {
|
|||
.help("Show icons for different file types")
|
||||
.takes_value(false))
|
||||
.arg(
|
||||
Arg::with_name("sixel")
|
||||
.short("s")
|
||||
.long("sixel")
|
||||
.help("Show HQ graphics using sixel")
|
||||
.takes_value(false))
|
||||
Arg::with_name("graphics")
|
||||
.short("g")
|
||||
.long("graphics")
|
||||
.help("Show HQ graphics using sixel/kitty")
|
||||
.takes_value(true))
|
||||
// For "Add Action" action
|
||||
.arg(
|
||||
Arg::with_name("mime")
|
||||
|
|
|
@ -91,21 +91,16 @@ impl MediaView {
|
|||
return Err(MediaError::NoPreviewer(msg))?;
|
||||
}
|
||||
|
||||
let (xsize, ysize) = core.coordinates.size_u();
|
||||
let (cols, rows) = termion::terminal_size()?;
|
||||
let (xpix, ypix) = termion::terminal_size_pixels()?;
|
||||
let (xpix, ypix) = (xpix/cols, ypix/rows);
|
||||
let (xpix, ypix) = (xpix * (xsize as u16 + 1),
|
||||
ypix * (ysize as u16 - 1));
|
||||
|
||||
let (tx_cmd, rx_cmd) = channel();
|
||||
|
||||
let imgview = ImgView {
|
||||
core: core.clone(),
|
||||
buffer: vec![],
|
||||
file: file.to_path_buf()
|
||||
file: None
|
||||
};
|
||||
|
||||
let (tx_cmd, rx_cmd) = channel();
|
||||
|
||||
// Stuff that gets moved into the closure
|
||||
let imgview = Arc::new(Mutex::new(imgview));
|
||||
let thread_imgview = imgview.clone();
|
||||
|
@ -120,7 +115,7 @@ impl MediaView {
|
|||
let ctype = media_type.clone();
|
||||
let ccore = core.clone();
|
||||
let media_previewer = core.config().media_previewer;
|
||||
let sixel = core.config().sixel;
|
||||
let g_mode = core.config().graphics;
|
||||
|
||||
let run_preview = Box::new(move | auto,
|
||||
mute,
|
||||
|
@ -132,6 +127,16 @@ impl MediaView {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
// Use current size. Widget could have been resized at some point
|
||||
let (xsize, ysize, xpix, ypix) =
|
||||
{
|
||||
let view = thread_imgview.lock()?;
|
||||
let (xsize, ysize) = view.core.coordinates.size_u();
|
||||
let (xpix, ypix) = view.core.coordinates.size_pixels()?;
|
||||
(xsize, ysize, xpix, ypix)
|
||||
};
|
||||
let cell_ratio = crate::term::cell_ratio()?;
|
||||
|
||||
|
||||
let mut previewer = std::process::Command::new(&media_previewer)
|
||||
.arg(format!("{}", (xsize+1)))
|
||||
|
@ -139,15 +144,15 @@ impl MediaView {
|
|||
.arg(format!("{}", (ysize-1)))
|
||||
.arg(format!("{}", xpix))
|
||||
.arg(format!("{}", ypix))
|
||||
.arg(format!("{}", cell_ratio))
|
||||
.arg(format!("{}", ctype.to_str()))
|
||||
.arg(format!("{}", auto))
|
||||
.arg(format!("{}", mute))
|
||||
.arg(format!("{}", sixel))
|
||||
.arg(format!("{}", g_mode))
|
||||
.arg(&path)
|
||||
.stdin(std::process::Stdio::piped())
|
||||
.stdout(std::process::Stdio::piped())
|
||||
.stderr(std::process::Stdio::inherit())
|
||||
// .stderr(std::process::Stdio::piped())
|
||||
.spawn()
|
||||
.map_err(|e| {
|
||||
let msg = format!("Couldn't run {}{}{}! Error: {:?}",
|
||||
|
@ -187,7 +192,10 @@ impl MediaView {
|
|||
.try_wait() {
|
||||
if code.success() {
|
||||
break;
|
||||
} else { return Ok(()); }
|
||||
} else {
|
||||
let msg = String::from("hunter-media failed!");
|
||||
return Err(failure::format_err!("{}", msg))?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -196,11 +204,20 @@ impl MediaView {
|
|||
|
||||
// Newline means frame is complete
|
||||
if line_buf == newline {
|
||||
let new_height;
|
||||
|
||||
line_buf.clear();
|
||||
stdout.read_line(&mut line_buf)?;
|
||||
let h = &line_buf.trim();
|
||||
*height.lock().unwrap() = h
|
||||
.parse::<usize>()?;
|
||||
let h = line_buf.trim().parse::<usize>()?;
|
||||
|
||||
let mut height = height.lock().unwrap();
|
||||
if *height != h {
|
||||
new_height = true;
|
||||
} else {
|
||||
new_height = false;
|
||||
}
|
||||
*height = h;
|
||||
|
||||
|
||||
line_buf.clear();
|
||||
stdout.read_line(&mut line_buf)?;
|
||||
|
@ -217,6 +234,9 @@ impl MediaView {
|
|||
|
||||
|
||||
if let Ok(mut imgview) = thread_imgview.lock() {
|
||||
if new_height {
|
||||
imgview.core.clear()?;
|
||||
}
|
||||
imgview.set_image_data(frame);
|
||||
sender.send(crate::widget::Events::WidgetReady)
|
||||
.map_err(|e| HError::from(e))
|
||||
|
@ -275,7 +295,7 @@ impl MediaView {
|
|||
mute,
|
||||
height,
|
||||
position,
|
||||
duration));
|
||||
duration).log());
|
||||
}
|
||||
Ok(())
|
||||
});
|
||||
|
@ -307,7 +327,7 @@ impl MediaView {
|
|||
Ok(format!("{:|>elements$}|{: >empty$}",
|
||||
"",
|
||||
"",
|
||||
empty=xsize - (element_count as usize + 1),
|
||||
empty=xsize - (element_count as usize),
|
||||
elements=element_count as usize))
|
||||
}
|
||||
}
|
||||
|
@ -328,7 +348,7 @@ impl MediaView {
|
|||
|
||||
let mute_char = "🔇";
|
||||
let pause_char = "⏸";
|
||||
let play_char = "⏴";
|
||||
let play_char = "▶";
|
||||
|
||||
let mut icons = String::new();
|
||||
|
||||
|
@ -364,25 +384,14 @@ impl MediaView {
|
|||
let auto = AUTOPLAY.read()?.clone();
|
||||
let pos = self.position.lock()?.clone();
|
||||
|
||||
// This combination means only first frame is shown, since
|
||||
// This combination means only first frame was shown, since
|
||||
// self.paused will be false, even with autoplay off
|
||||
if pos == 0 && auto == false && self.paused == false {
|
||||
self.toggle_autoplay();
|
||||
|
||||
// Since GStreamer sucks, just create a new instace
|
||||
let mut view = MediaView::new_from_file(self.core.clone(),
|
||||
&self.file.clone(),
|
||||
self.media_type.clone())?;
|
||||
|
||||
// Insert buffer to prevent flicker
|
||||
let buffer = self.imgview.lock()?.buffer.clone();
|
||||
view.imgview.lock()?.buffer = buffer;
|
||||
|
||||
view.start_video()?;
|
||||
view.paused = false;
|
||||
view.play()?;
|
||||
std::mem::swap(self, &mut &mut view);
|
||||
|
||||
self.start_video()?;
|
||||
self.paused = false;
|
||||
self.play()?;
|
||||
|
||||
return Ok(())
|
||||
}
|
||||
|
@ -468,15 +477,23 @@ impl Widget for MediaView {
|
|||
fn set_coordinates(&mut self, coordinates: &Coordinates) -> HResult<()> {
|
||||
if &self.core.coordinates == coordinates { return Ok(()); }
|
||||
|
||||
|
||||
self.core.coordinates = coordinates.clone();
|
||||
|
||||
let mut imgview = self.imgview.lock()?;
|
||||
imgview.set_image_data(vec![]);
|
||||
imgview.set_coordinates(&coordinates)?;
|
||||
|
||||
let xsize = self.core.coordinates.xsize_u();
|
||||
let ysize = self.core.coordinates.ysize_u() - 1;
|
||||
let (xsize, ysize) = self.core.coordinates.size_u();
|
||||
let (xpix, ypix) = self.core.coordinates.size_pixels()?;
|
||||
let cell_ratio = crate::term::cell_ratio()?;
|
||||
|
||||
let xystring = format!("xy\n{}\n{}\n", xsize, ysize);
|
||||
let xystring = format!("xy\n{}\n{}\n{}\n{}\n{}\n",
|
||||
xsize+1,
|
||||
ysize-1,
|
||||
xpix,
|
||||
ypix,
|
||||
cell_ratio);
|
||||
|
||||
self.controller.send(xystring)?;
|
||||
|
||||
|
|
|
@ -202,7 +202,12 @@ enum PreviewWidget {
|
|||
MediaView(MediaView)
|
||||
}
|
||||
|
||||
fn find_previewer(file: &File) -> HResult<PathBuf> {
|
||||
enum ExtPreviewer {
|
||||
Text(PathBuf),
|
||||
Graphics(PathBuf)
|
||||
}
|
||||
|
||||
fn find_previewer(file: &File, g_mode: bool) -> HResult<ExtPreviewer> {
|
||||
let path = crate::paths::previewers_path()?;
|
||||
let ext = file.path.extension()?;
|
||||
|
||||
|
@ -211,16 +216,35 @@ fn find_previewer(file: &File) -> HResult<PathBuf> {
|
|||
let mut previewer = PathBuf::from(&path);
|
||||
previewer.push("definitions/");
|
||||
previewer.push("text");
|
||||
return Ok(previewer);
|
||||
return Ok(ExtPreviewer::Text(previewer));
|
||||
}
|
||||
|
||||
// Try to find a graphical previewer first
|
||||
if g_mode {
|
||||
let g_previewer = path.read_dir()?
|
||||
.find(|previewer| previewer.as_ref()
|
||||
.and_then(|p| {
|
||||
Ok(p.path().file_stem() == Some(ext)
|
||||
&& p.path().extension() == Some(&std::ffi::OsStr::new("g")))
|
||||
})
|
||||
.unwrap_or(false))
|
||||
.map(|p| p.map(|p| p.path()));
|
||||
match g_previewer {
|
||||
Some(Ok(g_p)) => return Ok(ExtPreviewer::Graphics(g_p)),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Look for previewers matching the file extension
|
||||
let previewer = path.read_dir()?
|
||||
.find(|previewer| previewer.as_ref()
|
||||
.and_then(|p| Ok(p.file_name() == ext ))
|
||||
.unwrap_or(false))
|
||||
.map(|p| p.map(|p| p.path()));
|
||||
Ok(previewer??)
|
||||
.map(|p| p.map(|p| p.path()));
|
||||
|
||||
Ok(ExtPreviewer::Text(previewer??))
|
||||
}
|
||||
|
||||
|
||||
|
@ -349,7 +373,11 @@ impl Previewer {
|
|||
&self.core,
|
||||
move |stale: &Stale|
|
||||
{
|
||||
kill_proc().unwrap();
|
||||
kill_proc().log();
|
||||
// Delete files left by graphical PDF previews, etc.
|
||||
std::fs::remove_dir_all("/tmp/hunter-previews/")
|
||||
.map_err(HError::from)
|
||||
.log();
|
||||
|
||||
if file.kind == Kind::Directory {
|
||||
let preview = Previewer::preview_dir(&file,
|
||||
|
@ -509,28 +537,41 @@ impl Previewer {
|
|||
stale: &Stale,
|
||||
animator: &Stale)
|
||||
-> HResult<PreviewWidget> {
|
||||
let previewer = find_previewer(&file)?;
|
||||
let previewer = if core.config().graphics.as_str() != "unicode" {
|
||||
find_previewer(&file, true)?
|
||||
} else {
|
||||
find_previewer(&file, false)?
|
||||
};
|
||||
|
||||
match previewer {
|
||||
ExtPreviewer::Text(previewer) => {
|
||||
let lines = Previewer::run_external(previewer, file, stale);
|
||||
|
||||
let lines = Previewer::run_external(previewer, file, stale);
|
||||
if stale.is_stale()? { return Previewer::preview_failed(&file) }
|
||||
|
||||
if stale.is_stale()? { return Previewer::preview_failed(&file) }
|
||||
let mut textview = TextView {
|
||||
lines: lines?,
|
||||
core: core.clone(),
|
||||
follow: false,
|
||||
offset: 0};
|
||||
textview.set_coordinates(&core.coordinates).log();
|
||||
textview.refresh().log();
|
||||
textview.animate_slide_up(Some(animator)).log();
|
||||
|
||||
let mut textview = TextView {
|
||||
lines: lines?,
|
||||
core: core.clone(),
|
||||
follow: false,
|
||||
offset: 0};
|
||||
textview.set_coordinates(&core.coordinates).log();
|
||||
textview.refresh().log();
|
||||
textview.animate_slide_up(Some(animator)).log();
|
||||
Ok(PreviewWidget::TextView(textview))
|
||||
},
|
||||
ExtPreviewer::Graphics(previewer) => {
|
||||
let lines = Previewer::run_external(previewer, file, stale)?;
|
||||
let gfile = lines.first()?;
|
||||
let imgview = ImgView::new_from_file(core.clone(),
|
||||
&PathBuf::from(&gfile))?;
|
||||
|
||||
|
||||
return Ok(PreviewWidget::TextView(textview))
|
||||
Ok(PreviewWidget::ImgView(imgview))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl Widget for Previewer {
|
||||
fn get_core(&self) -> HResult<&WidgetCore> {
|
||||
Ok(&self.core)
|
||||
|
|
17
src/term.rs
17
src/term.rs
|
@ -131,6 +131,7 @@ pub trait ScreenExt: Write {
|
|||
let (xsize, ysize) = termion::terminal_size()?;
|
||||
Ok(((xsize-1) as usize, (ysize-1) as usize))
|
||||
}
|
||||
|
||||
fn xsize(&self) -> HResult<usize> {
|
||||
let (xsize, _) = termion::terminal_size()?;
|
||||
Ok((xsize - 1) as usize)
|
||||
|
@ -203,6 +204,22 @@ pub fn size() -> HResult<(usize, usize)> {
|
|||
Ok(((xsize-1) as usize, (ysize-1) as usize))
|
||||
}
|
||||
|
||||
pub fn size_pixels() -> HResult<(usize, usize)> {
|
||||
let (xsize, ysize) = termion::terminal_size_pixels()?;
|
||||
Ok((xsize as usize, ysize as usize))
|
||||
}
|
||||
|
||||
pub fn cell_ratio() -> HResult<f32> {
|
||||
let (xsize, ysize) = size()?;
|
||||
let (xpix, ypix) = size_pixels()?;
|
||||
|
||||
let cell_xpix = xpix as f32 / (xsize+1) as f32;
|
||||
let cell_ypix = ypix as f32 / (ysize+1) as f32;
|
||||
let ratio = cell_xpix / cell_ypix;
|
||||
|
||||
Ok(ratio)
|
||||
}
|
||||
|
||||
pub fn sized_string(string: &str, xsize: u16) -> String {
|
||||
string.chars().fold("".to_string(), |acc, ch| {
|
||||
let width: usize = unicode_width::UnicodeWidthStr::width(acc.as_str());
|
||||
|
|
|
@ -332,6 +332,11 @@ pub trait Widget {
|
|||
}
|
||||
|
||||
fn popup(&mut self) -> HResult<()> {
|
||||
// Image will draw over widget otherwise
|
||||
if self.get_core()?.config().graphics == "kitty" {
|
||||
let ypos = self.get_coordinates()?.ypos();
|
||||
print!("\x1b_Ga=d,d=y,y={}\x1b\\", ypos+1);
|
||||
}
|
||||
let result = self.run_widget();
|
||||
self.get_core()?.clear().log();
|
||||
self.get_core()?.get_sender().send(Events::ExclusiveEvent(None))?;
|
||||
|
|
Loading…
Reference in New Issue