Git Product home page Git Product logo

chronos's Introduction

chronos

chronos is a lightweight speedrun timer that runs in your terminal.

Building

You will need the following dependencies:

  • latest stable rust

Run the following commands in your shell.

git clone --recursive https://github.com/darkrta/chronos
cd chronos
cargo build --release

The timer should be placed in ./target/

Usage

  • See ./chronos --help for command line args.
  • Split files can be imported from both LiveSplit and Livepslit One.
  • Layout files can only be used from LiveSplit One, and may require tweaking in order to look right. A best effort attempt is made to use colors from the layout as they are.

Key Bindings

  • Escape - Quit
  • F1 - Activate Global Hotkeys
  • F2 - Deactivate Global Hotkeys
  • F3 - Save Splits (not done automatically)
  • More key binds are in ./examples/config-example.toml

chronos's People

Contributors

darkrta avatar eein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chronos's Issues

Better support UTF-8

Right now we have to use a patch to livesplit-core to replace any sort of dash with the ASCII minus.

We can get rid of that patch by using a UTF-8 version of strlen for calculating the length of strings.

Error when compiling on WSL

Hello, here's the error:

LINK chronos
/usr/bin/ld: error: LLVM gold plugin has failed to create LTO module: Unknown attribute kind (70) (Producer: 'LLVM13.0.0-rust-1.57.0-stable' Reader: 'LLVM 10.0.0')
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:35: chronos] Error 1

Do not hardcode size of included files.

Iโ€™m completely new to Rust so pardon me if this is an error on my end.

Anyway, when I run cargo build --release, I get this output:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS E:\configs-programs\chronos\chronos> cargo build --release
    Updating crates.io index
  Downloaded autocfg v1.1.0
  Downloaded toml v0.5.9
  Downloaded ident_case v1.0.1
  Downloaded cfg-if v1.0.0
  Downloaded cursive_buffered_backend v0.6.1
  Downloaded byteorder v1.4.3
  Downloaded target-lexicon v0.12.5
  Downloaded doc-comment v0.3.3
  Downloaded version_check v0.9.4
  Downloaded jpeg-decoder v0.3.0
  Downloaded time-core v0.1.0
  Downloaded maplit v1.0.2
  Downloaded heck v0.4.0
  Downloaded rand_core v0.6.4
  Downloaded darling v0.14.2
  Downloaded unicode-script v0.5.5
  Downloaded log v0.4.17
  Downloaded serde_derive v1.0.150
  Downloaded serde v1.0.150
  Downloaded libm v0.2.6
  Downloaded rayon v1.6.0
  Downloaded image v0.24.5
  Downloaded cranelift-native v0.89.2
  Downloaded cranelift-isle v0.89.2
  Downloaded cranelift-entity v0.89.2
  Downloaded cranelift-frontend v0.89.2
  Downloaded cranelift-bforest v0.89.2
  Downloaded wasmtime-jit v2.0.2
  Downloaded gimli v0.26.2
  Downloaded cranelift-codegen-shared v0.89.2
  Downloaded enum-map v2.4.1
  Downloaded winapi v0.3.9
  Downloaded regalloc2 v0.4.2
  Downloaded sysinfo v0.26.8
  Downloaded tiny-skia v0.8.2
  Downloaded tiff v0.8.0
  Downloaded snafu v0.7.3
  Downloaded cursive_core v0.3.6
  Downloaded cranelift-wasm v0.89.2
  Downloaded cranelift-codegen v0.89.2
  Downloaded wasmtime v2.0.2
  Downloaded proc-maps v0.3.0
  Downloaded snafu-derive v0.7.3
  Downloaded png v0.17.7
  Downloaded enumset_derive v0.6.1
  Downloaded wasmtime-asm-macros v2.0.2
  Downloaded cranelift-codegen-meta v0.89.2
  Downloaded cursive v0.20.0
  Downloaded wasmtime-runtime v2.0.2
  Downloaded wasmtime-environ v2.0.2
  Downloaded wasmtime-cranelift v2.0.2
  Downloaded wasmparser v0.92.0
  Downloaded tokio v1.23.0
  Downloaded strict-num v0.1.0
  Downloaded tiny-skia-path v0.8.2
  Downloaded wasmtime-types v2.0.2
  Downloaded wasmtime-jit-debug v2.0.2
  Downloaded ntapi v0.4.0
  Downloaded read-process-memory v0.1.5
  Downloaded enum-map-derive v0.10.0
  Downloaded hashbrown v0.13.1
  Downloaded crossterm v0.25.0
  Downloaded weezl v0.1.7
  Downloaded slotmap v1.0.6
  Downloaded unicode-general-category v0.6.0
  Downloaded rustc-demangle v0.1.21
  Downloaded anyhow v1.0.66
  Downloaded num-traits v0.2.15
  Downloaded addr2line v0.17.0
  Downloaded rand_chacha v0.3.1
  Downloaded bytemuck_derive v1.3.0
  Downloaded enumset v1.0.12
  Downloaded simd-abstraction v0.7.1
  Downloaded clap_derive v4.0.21
  Downloaded scopeguard v1.1.0
  Downloaded clap_lex v0.3.0
  Downloaded itoa v1.0.4
  Downloaded cc v1.0.77
  Downloaded outref v0.1.0
  Downloaded windows-sys v0.42.0
  Downloaded windows-sys v0.36.1
  Downloaded winapi-util v0.1.5
  Downloaded windows_x86_64_msvc v0.42.0
  Downloaded windows_x86_64_msvc v0.36.1
  Downloaded thiserror v1.0.37
  Downloaded proc-macro-error-attr v1.0.4
  Downloaded crossbeam-utils v0.8.14
  Downloaded libc v0.2.138
  Downloaded serde_json v1.0.89
  Downloaded rustybuzz v0.6.0
  Downloaded itertools v0.10.5
  Downloaded clap v4.0.29
  Downloaded object v0.29.0
  Downloaded ttf-parser v0.17.1
  Downloaded time v0.3.17
  Downloaded stable_deref_trait v1.2.0
  Downloaded bumpalo v3.11.1
  Downloaded owning_ref v0.4.1
  Downloaded smallvec v1.10.0
  Downloaded slice-group-by v0.3.0
  Downloaded simdutf8 v0.1.4
  Downloaded crc32fast v1.3.2
  Downloaded ryu v1.0.11
  Downloaded rayon-core v1.10.1
  Downloaded flate2 v1.0.25
  Downloaded miniz_oxide v0.6.2
  Downloaded rand v0.8.5
  Downloaded cpp_demangle v0.3.5
  Downloaded hashbrown v0.12.3
  Downloaded bytemuck v1.12.3
  Downloaded memchr v2.5.0
  Downloaded crossbeam-channel v0.5.6
  Downloaded parking_lot v0.12.1
  Downloaded proc-macro2 v1.0.47
  Downloaded darling_core v0.14.2
  Downloaded xi-unicode v0.3.0
  Downloaded unicode-segmentation v1.10.0
  Downloaded unicode-bidi-mirroring v0.1.0
  Downloaded termcolor v1.1.3
  Downloaded bincode v1.3.3
  Downloaded crossbeam-epoch v0.9.13
  Downloaded psm v0.1.21
  Downloaded scoped_threadpool v0.1.9
  Downloaded ppv-lite86 v0.2.17
  Downloaded quote v1.0.21
  Downloaded unicode-ccc v0.1.2
  Downloaded arrayref v0.3.6
  Downloaded ahash v0.8.2
  Downloaded time-macros v0.2.6
  Downloaded paste v1.0.9
  Downloaded strsim v0.10.0
  Downloaded parking_lot_core v0.9.5
  Downloaded os_str_bytes v6.4.1
  Downloaded once_cell v1.16.0
  Downloaded getrandom v0.2.8
  Downloaded crossterm_winapi v0.9.0
  Downloaded base64-simd v0.7.0
  Downloaded num-integer v0.1.45
  Downloaded num v0.4.0
  Downloaded adler v1.0.2
  Downloaded num-iter v0.1.43
  Downloaded memoffset v0.6.5
  Downloaded io-lifetimes v1.0.3
  Downloaded bitflags v1.3.2
  Downloaded num-complex v0.4.2
  Downloaded arrayvec v0.7.2
  Downloaded proc-macro-error v1.0.4
  Downloaded num_cpus v1.14.0
  Downloaded memoffset v0.7.1
  Downloaded pin-project-lite v0.2.9
  Downloaded num-rational v0.4.1
  Downloaded indexmap v1.9.2
  Downloaded ahash v0.7.6
  Downloaded crossbeam-deque v0.8.2
  Downloaded unicode-width v0.1.10
  Downloaded unicode-ident v1.0.5
  Downloaded syn v1.0.105
  Downloaded darling_macro v0.14.2
  Downloaded is-terminal v0.4.1
  Downloaded color_quant v1.1.0
  Downloaded fallible-iterator v0.2.0
  Downloaded either v1.8.0
  Downloaded fxhash v0.2.1
  Downloaded fnv v1.0.7
  Downloaded lazy_static v1.4.0
  Downloaded lock_api v0.4.9
  Downloaded unicase v2.6.0
  Downloaded thiserror-impl v1.0.37
  Downloaded smallstr v0.3.0
  Downloaded term_size v0.3.2
  Downloaded 170 crates (21.5 MB) in 15.24s (largest was `windows-sys` at 3.3 MB)
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.47
   Compiling quote v1.0.21
   Compiling unicode-ident v1.0.5
   Compiling cfg-if v1.0.0
   Compiling syn v1.0.105
   Compiling version_check v0.9.4
   Compiling serde_derive v1.0.150
   Compiling serde v1.0.150
   Compiling getrandom v0.2.8
   Compiling once_cell v1.16.0
   Compiling indexmap v1.9.2
   Compiling ahash v0.7.6
   Compiling log v0.4.17
   Compiling stable_deref_trait v1.2.0
   Compiling winapi v0.3.9
   Compiling smallvec v1.10.0
   Compiling crc32fast v1.3.2
   Compiling crossbeam-utils v0.8.14
   Compiling fallible-iterator v0.2.0
   Compiling hashbrown v0.12.3
   Compiling target-lexicon v0.12.5
   Compiling num-traits v0.2.15
   Compiling scopeguard v1.1.0
   Compiling cranelift-isle v0.89.2
   Compiling thiserror v1.0.37
   Compiling libc v0.2.138
   Compiling cranelift-codegen-shared v0.89.2
   Compiling byteorder v1.4.3
   Compiling cranelift-codegen-meta v0.89.2
   Compiling memoffset v0.7.1
   Compiling num-integer v0.1.45
   Compiling memchr v2.5.0
   Compiling cc v1.0.77
   Compiling windows_x86_64_msvc v0.42.0
   Compiling fxhash v0.2.1
   Compiling crossbeam-channel v0.5.6
   Compiling crossbeam-epoch v0.9.13
   Compiling anyhow v1.0.66
   Compiling slice-group-by v0.3.0
   Compiling regalloc2 v0.4.2
   Compiling num-rational v0.4.1
   Compiling ident_case v1.0.1
   Compiling either v1.8.0
   Compiling windows_x86_64_msvc v0.36.1
   Compiling bumpalo v3.11.1
   Compiling fnv v1.0.7
   Compiling arrayvec v0.7.2
   Compiling darling_core v0.14.2
   Compiling windows-sys v0.42.0
   Compiling cranelift-codegen v0.89.2
   Compiling ahash v0.8.2
   Compiling memoffset v0.6.5
   Compiling rand_core v0.6.4
   Compiling bitflags v1.3.2
   Compiling heck v0.4.0
   Compiling itoa v1.0.4
   Compiling ppv-lite86 v0.2.17
   Compiling rayon-core v1.10.1
   Compiling rand_chacha v0.3.1
   Compiling crossbeam-deque v0.8.2
   Compiling thiserror-impl v1.0.37
   Compiling darling_macro v0.14.2
   Compiling wasmtime-runtime v2.0.2
   Compiling num-iter v0.1.43
   Compiling num_cpus v1.14.0
   Compiling doc-comment v0.3.3
   Compiling time-core v0.1.0
   Compiling cpp_demangle v0.3.5
   Compiling adler v1.0.2
   Compiling darling v0.14.2
   Compiling miniz_oxide v0.6.2
   Compiling time v0.3.17
   Compiling windows-sys v0.36.1
   Compiling rand v0.8.5
   Compiling itertools v0.10.5
   Compiling psm v0.1.21
   Compiling wasmtime-jit-debug v2.0.2
   Compiling proc-macro-error-attr v1.0.4
   Compiling lock_api v0.4.9
   Compiling wasmtime-asm-macros v2.0.2
   Compiling paste v1.0.9
   Compiling ntapi v0.4.0
   Compiling parking_lot_core v0.9.5
   Compiling rayon v1.6.0
   Compiling flate2 v1.0.25
   Compiling enumset_derive v0.6.1
   Compiling enum-map-derive v0.10.0
   Compiling snafu-derive v0.7.3
   Compiling num-complex v0.4.2
   Compiling proc-macro-error v1.0.4
   Compiling unicase v2.6.0
   Compiling slotmap v1.0.6
   Compiling io-lifetimes v1.0.3
   Compiling proc-maps v0.3.0
   Compiling wasmtime v2.0.2
   Compiling rustc-demangle v0.1.21
   Compiling num v0.4.0
   Compiling enumset v1.0.12
   Compiling enum-map v2.4.1
   Compiling bytemuck_derive v1.3.0
   Compiling owning_ref v0.4.1
   Compiling tokio v1.23.0
   Compiling snafu v0.7.3
   Compiling unicode-segmentation v1.10.0
   Compiling lazy_static v1.4.0
   Compiling cranelift-entity v0.89.2
   Compiling bincode v1.3.3
   Compiling toml v0.5.9
   Compiling unicode-width v0.1.10
   Compiling gimli v0.26.2
   Compiling wasmparser v0.92.0
   Compiling cranelift-bforest v0.89.2
   Compiling object v0.29.0
   Compiling jpeg-decoder v0.3.0
   Compiling libm v0.2.6
   Compiling weezl v0.1.7
   Compiling serde_json v1.0.89
   Compiling xi-unicode v0.3.0
   Compiling outref v0.1.0
   Compiling cursive_core v0.3.6
   Compiling simd-abstraction v0.7.1
   Compiling tiff v0.8.0
   Compiling wasmtime-types v2.0.2
   Compiling wasmtime-environ v2.0.2
   Compiling addr2line v0.17.0
   Compiling sysinfo v0.26.8
   Compiling wasmtime-jit v2.0.2
   Compiling bytemuck v1.12.3
   Compiling parking_lot v0.12.1
   Compiling png v0.17.7
   Compiling cranelift-frontend v0.89.2
   Compiling cranelift-native v0.89.2
   Compiling cranelift-wasm v0.89.2
   Compiling wasmtime-cranelift v2.0.2
   Compiling winapi-util v0.1.5
   Compiling crossterm_winapi v0.9.0
   Compiling read-process-memory v0.1.5
   Compiling scoped_threadpool v0.1.9
   Compiling pin-project-lite v0.2.9
   Compiling os_str_bytes v6.4.1
   Compiling color_quant v1.1.0
   Compiling ryu v1.0.11
   Compiling image v0.24.5
   Compiling clap_lex v0.3.0
   Compiling livesplit-auto-splitting v0.1.0 (E:\configs-programs\chronos\chronos\livesplit-core\crates\livesplit-auto-splitting)
   Compiling crossterm v0.25.0
   Compiling termcolor v1.1.3
   Compiling is-terminal v0.4.1
   Compiling livesplit-title-abbreviations v0.2.0 (E:\configs-programs\chronos\chronos\livesplit-core\crates\livesplit-title-abbreviations)
   Compiling clap_derive v4.0.21
   Compiling base64-simd v0.7.0
   Compiling livesplit-hotkey v0.6.0 (E:\configs-programs\chronos\chronos\livesplit-core\crates\livesplit-hotkey)
   Compiling hashbrown v0.13.1
   Compiling term_size v0.3.2
   Compiling smallstr v0.3.0
   Compiling simdutf8 v0.1.4
   Compiling strsim v0.10.0
   Compiling maplit v1.0.2
   Compiling cursive v0.20.0
   Compiling livesplit-core v0.12.0 (E:\configs-programs\chronos\chronos\livesplit-core)
   Compiling clap v4.0.29
   Compiling cursive_buffered_backend v0.6.1
   Compiling chronos v0.3.0 (E:\configs-programs\chronos\chronos)
error[E0308]: mismatched types
  --> src\lib.rs:10:41
   |
10 | pub const DEFAULT_LAYOUT: &[u8; 6413] = include_bytes!("default_layout.ls1l");
   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an array with a fixed size of 6413 elements, found one with 6643 elements
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0308`.
error: could not compile `chronos` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
PS E:\configs-programs\chronos\chronos>

Implement config file parsing.

At the moment the current config setup requires you to edit config.c. This isn't ideal as someone might want to have different setups for different games.

We should look for a suitable YAML library that's easy to embed into the codebase for this purpose.

Global hotkeys works only with NumLock off

I have rebound my start/stop and reset hotkeys to F13 and F14 respectively to use with a keypad, but even when bound to a normal keyboard button like A, it seems that any global hotkey only fires when Num Lock is disabled

Switch to termbox for rendering.

This will require a rewrite of most of the code, but the trade off here is worth it as termbox is a much cleaner library than ncurses.

Read colors from the layout.

Right now we rely entirely on semantic colors, but it should be possible to actually read the colors from the layout and display them.

This will need some changes in livesplit-core to pull off.

How to use the auto splitter?

I don't understand how the auto-splitter works. I tried giving a .dll path of an autosplitter but it didn't recognize. Tried also giving the name but same thing. Maybe it's still W.I.P?
The other options would benefit from a better documentation too :)

Failure to compile livesplit-core on a Raspberry Pi

pi@testpi:~/darksplit $ make
HEAD is now at 0355b83 Merge pull request #307 from CryZe/title-abbrevs-in-component
   Compiling scopeguard v1.1.0
error: could not compile `scopeguard`.
 Caused by:
  process didn't exit successfully: `rustc --crate-name scopeguard /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/scopeguard-1.1.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C metadata=7ab59481cc59ada1 -C extra-filename=-7ab59481cc59ada1 --out-dir /home/pi/darksplit/livesplit-core/livesplit-core/target/release/deps -L dependency=/home/pi/darksplit/livesplit-core/livesplit-core/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
cp: cannot stat 'target/release/liblivesplit_core.a': No such file or directory
make: *** [Makefile:39: livesplit-core/liblivesplit_core.a] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.