Skip to content

Commit

Permalink
termux (#65)
Browse files Browse the repository at this point in the history
* termux

* add android support
  • Loading branch information
yazgoo authored Jan 6, 2020
1 parent 35ae8b8 commit 542a87e
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 63 deletions.
131 changes: 77 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ categories = ["command-line-utilities"]
dirs = { version = "2.0.1", default-features = false }
serde = { version = "1.0", features = ["derive"], default-features = false }
serde_json = { version = "1.0", default-features = false }
terminal_size = { version = "0.1.8", default-features = false }
crossterm_input = { version = "0.3", default-features = false }
crossterm = { version = "0.9" }
crossterm = { version = "0.14" }
rayon = { version = "1.1", default-features=false }
webbrowser = { version = "0.5", default-features=false }
clipboard = { version = "0.5", default-features=false }
roxmltree = { version = "0.7", default-features = false }
reqwest = { git="https://github.com/EmbarkStudios/reqwest", version = "= 0.10.0-alpha.2", features = ["gzip", "rustls-tls"] }
webbrowser = { git="https://github.com/yazgoo/webbrowser-rs#a36dcbf", version = "= 0.5.2" }
futures = { version = "0.3" , features = ["compat"] }
tokio = { version = "0.2.0-alpha", features = ["macros"] }
chrono = { version = "0.4" }
Expand Down
10 changes: 4 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
extern crate dirs;
extern crate reqwest;
extern crate terminal_size;
extern crate crossterm_input;
extern crate crossterm;
extern crate serde;
Expand All @@ -21,7 +20,6 @@ use std::path::Path;
use std::io::{Read, Write};
use std::io::Error;
use std::io::ErrorKind::NotFound;
use terminal_size::{Width, Height, terminal_size};
use std::cmp::min;
use std::process::{Command, Stdio};
use crossterm_input::{input, RawScreen, InputEvent, MouseEvent, MouseButton};
Expand Down Expand Up @@ -561,17 +559,17 @@ async fn load(reload: bool, app_config: &AppConfig, original_videos: &Items) ->


fn get_lines() -> usize {
let size = terminal_size();
if let Some((Width(_), Height(h))) = size {
let size = crossterm::terminal::size();
if let Ok((_, h)) = size {
(h - 1) as usize
} else {
20
}
}

fn get_cols() -> usize {
let size = terminal_size();
if let Some((Width(w), Height(_))) = size {
let size = crossterm::terminal::size();
if let Ok((w, _)) = size {
w as usize
} else {
20
Expand Down

0 comments on commit 542a87e

Please sign in to comment.