Skip to content

Commit

Permalink
Merge pull request hykilpikonna#15 from teohhanhui/riir
Browse files Browse the repository at this point in the history
Implement recolored ascii output
  • Loading branch information
teohhanhui authored Jul 6, 2024
2 parents ff46c8f + be70233 commit 46b6182
Show file tree
Hide file tree
Showing 8 changed files with 694 additions and 118 deletions.
155 changes: 133 additions & 22 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,24 @@ repository = "https://github.com/hykilpikonna/hyfetch"
license = "MIT"

[workspace.dependencies]
aho-corasick = { version = "1.1.3", default-features = false }
ansi_colours = { version = "1.2.2", default-features = false }
# anstream = { version = "0.6.14", default-features = false }
anyhow = { version = "1.0.86", default-features = false }
bpaf = { version = "0.9.12", default-features = false }
bytemuck = { version = "1.16.1", default-features = false }
chrono = { version = "0.4.38", default-features = false }
deranged = { version = "0.3.11", default-features = false }
derive_more = { version = "1.0.0-beta.6", default-features = false }
directories = { version = "5.0.1", default-features = false }
enable-ansi-support = { version = "0.2.1", default-features = false }
indexmap = { version = "2.2.6", default-features = false }
palette = { version = "0.7.6", default-features = false }
regex = { version = "1.10.5", default-features = false }
rgb = { version = "0.8.37", default-features = false }
serde = { version = "1.0.203", default-features = false }
serde_json = { version = "1.0.118", default-features = false }
serde_path_to_error = { version = "0.1.16", default-features = false }
shell-words = { version = "1.1.0", default-features = false }
strum = { version = "0.26.3", default-features = false }
tempfile = { version = "3.10.1", default-features = false }
thiserror = { version = "1.0.61", default-features = false }
tracing = { version = "0.1.40", default-features = false }
tracing-subscriber = { version = "0.3.18", default-features = false }
Expand Down
12 changes: 7 additions & 5 deletions crates/hyfetch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@ license = { workspace = true }
default-run = "hyfetch"

[dependencies]
# ansi_colours = { workspace = true, features = ["rgb"] }
aho-corasick = { workspace = true, features = ["perf-literal", "std"] }
ansi_colours = { workspace = true, features = [] }
# anstream = { workspace = true, features = ["auto"] }
anyhow = { workspace = true, features = ["std"] }
bpaf = { workspace = true, features = [] }
# bytemuck = { workspace = true, features = [] }
chrono = { workspace = true, features = ["clock", "std"] }
deranged = { workspace = true, features = ["serde", "std"] }
derive_more = { workspace = true, features = ["from", "from_str", "into", "std"] }
directories = { workspace = true, features = [] }
indexmap = { workspace = true, features = ["serde", "std"] }
palette = { workspace = true, features = ["std"] }
regex = { workspace = true, features = ["perf", "std", "unicode"] }
# rgb = { workspace = true, features = [] }
serde = { workspace = true, features = ["derive", "std"] }
serde_json = { workspace = true, features = ["std"] }
serde_path_to_error = { workspace = true, features = [] }
shell-words = { workspace = true, features = ["std"] }
strum = { workspace = true, features = ["derive", "std"] }
tempfile = { workspace = true, features = [] }
thiserror = { workspace = true, features = [] }
tracing = { workspace = true, features = ["attributes", "std"] }
tracing-subscriber = { workspace = true, features = ["ansi", "fmt", "smallvec", "std", "tracing-log"] }
Expand All @@ -36,6 +35,9 @@ indexmap = { workspace = true, features = ["std"] }
regex = { workspace = true, features = ["perf", "std", "unicode"] }
unicode-normalization = { workspace = true, features = ["std"] }

[target.'cfg(windows)'.dependencies]
enable-ansi-support = { workspace = true, features = [] }

[features]
default = ["autocomplete", "color"]
autocomplete = ["bpaf/autocomplete"]
Expand Down
6 changes: 5 additions & 1 deletion crates/hyfetch/src/bin/hyfetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ use hyfetch::utils::get_cache_path;
use tracing::debug;

fn main() -> Result<()> {
#[cfg(windows)]
enable_ansi_support::enable_ansi_support();

let options = options().run();

init_tracing_subsriber(options.debug).context("failed to init tracing subscriber")?;
Expand Down Expand Up @@ -97,7 +100,8 @@ fn main() -> Result<()> {
};
let asc = config
.color_align
.recolor_ascii(asc, color_profile, color_mode, config.light_dark);
.recolor_ascii(asc, color_profile, color_mode, config.light_dark)
.context("failed to recolor ascii")?;
neofetch_util::run(asc, backend, args).context("failed to run")?;

if options.ask_exit {
Expand Down
Loading

0 comments on commit 46b6182

Please sign in to comment.