Code Monkey home page Code Monkey logo

last's Introduction

LAST Linux Auto Splitting Timer

LAST brings auto splitting functionality to urn with Lua-based auto splitters that are easy to port from asl.

Features

  • Split Tracking and Timing: Accurately track and time your speedruns with ease.
  • Auto Splitter Support: Utilize Lua-based auto splitters to automate split timing based on in-game events.
  • Customizable Themes: Personalize your timer's appearance by creating and applying custom themes.
  • Flexible Configuration: Configure keybindings and various settings to suit your preferences.

Dependencies

LAST requires the following dependencies on your system to compile:

  • libgtk+-3.0
  • x11
  • libjansson
  • luajit

Installation

git clone --recurse-submodules https://github.com/wins1ey/LAST
cd LAST
make
sudo make install

or

git clone --recurse-submodules https://github.com/wins1ey/LAST && cd LAST && make && sudo make install

Getting Started

  1. Launch LAST by executing the compiled binary. ./LAST

  2. When first launched, LAST will create the LAST directory in your config directory. Auto splitters, splits and themes go in their respective folders inside.

  3. The initial window is undecorated, but you can toggle window decorations by pressing the right Control key.

  4. Control the timer using the following key presses:

    Key Stopped Action Started Action
    Spacebar Start Split
    Backspace Reset Stop
    Delete Cancel -
  • The "Cancel" action resets the timer and decrements the attempt counter. A run reset before the start delay is automatically cancelled.

  • To manually modify the current split, use the following key actions:

    Key Action
    Page Up Unsplit
    Page Down Skip split
  1. Customize keybindings by setting the values in wildmouse.last path with gsettings.

    Key Type Description
    start-decorated Boolean Start with window decorations
    hide-cursor Boolean Hide cursor in window
    global-hotkeys Boolean Enables global hotkeys
    theme String Default theme name
    theme-variant String Default theme variant
    keybind-start-split String Start/split keybind
    keybind-stop-reset String Stop/Reset keybind
    keybind-cancel String Cancel keybind
    keybind-unsplit String Unsplit keybind
    keybind-skip-split String Skip split keybind
    keybind-toggle-decorations String Toggle window decorations keybind

Keybind strings should be parseable by gtk_accelerator_parse.

Auto Splitters

LAST supports auto splitters written in Lua to automate split timing based on in-game events. When running LAST in the terminal you will initally be greeted with an auto splitter downloader which grabs them from here. Feel free to make your own, Documentation can be found here

Split Files

Split files in LAST are stored as well-formed JSON. The split file must contain a main object. The following keys are optional:

Key Value
title Title string at top of window
start_delay Non-negative delay until timer starts
world_record Best known time
splits Array of split objects
theme Window theme
theme_variant Window theme variant
width Window width
height Window height

Each split object within the splits array has the following keys:

Key Value
title Split title
time Split time
best_time Your best split time
best_segment Your best segment time

Times are strings in HH:MM:SS.mmmmmm format

Themes

LAST supports customizable themes, allowing you to personalize the timer's appearance. To create a theme:

  1. Create a CSS stylesheet with your desired styles.
  2. Place the stylesheet in the ~/.config/LAST/themes/<name>/<name>.css directory. (If you have XDG_CONFIG_HOME env var pointing somewher else than .config it will be wherever it points to)
  3. Set the global theme by modifying the theme value in gsettings.
  4. Theme variants should follow the pattern <name>-<variant>.css.
  5. Individual splits can apply their own themes by specifying a theme key in the main split object.

For a list of supported CSS properties, refer to the GtkCssProvider documentation.

CSS Classes

The following CSS classes can be used to style the elements of the LAST interface:

.window
.header
.title
.attempt-count
.time
.delta
.timer
.timer-seconds
.timer-millis
.delay
.splits
.split
.current-split
.split-title
.split-time
.split-delta
.split-last
.done
.behind
.losing
.best-segment
.best-split
.footer
.prev-segment-label
.prev-segment
.sum-of-bests-label
.sum-of-bests
.personal-best-label
.personal-best
.world-record-label
.world-record

last's People

Contributors

dependabot[bot] avatar extremeexploit avatar loomeh avatar wins1ey avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

last's Issues

Compilation issue on Ubuntu 22.04 Kernel 5.19.0-46-generic

I already installed all lua*-dev avaliable on ubuntu repositories and the issue persists. What is the correct lua version necessary to compilation?

xxd --include last.css > ./src/headers/last-css.h || (rm ./src/headers/last-css.h; false)
g++ -std=c++17 -I/usr/include/curl -I/usr/include/lua5.* pkg-config --cflags gtk+-3.0 x11 jansson -O2 -pthread -Wall -Wno-unused-parameter -c -o bin/objects/autosplitter.o src/autosplitter.cpp
src/autosplitter.cpp:12:10: fatal error: lua.hpp: No such file or directory
12 | #include <lua.hpp>
| ^~~~~~~~~
compilation terminated.
make: *** [Makefile:35: bin/objects/autosplitter.o] Error 1

Hardcoded sudo in Makefile makes installing in systems without sudo impossible

Pretty much what the title says. I use a system that has doas instead of sudo installed and I had to delete every single usage of sudo in order for it to compile.

Why does the Makefile have sudo in every install/uninstall command? Usually Makefiles expect the user to add sudo or doas to make for those tasks, so this is kind of strange to encounter. There's other weirdness in the Makefile that doesn't make sense (such as not using PREFIX to make sure everything goes into /usr/local and instead dropping everything in /usr except the bin), but this is the only one that actively prevents compilation.

LiveSplit Auto Splitting Runtime Proof of Concept

I'm not sure if you guys are aware, but we've been working on developing the "next generation" of auto splitting in LiveSplit recently. The idea is to do it right this time, solving the following problems:

  1. We want the runtime to be portable across different operating systems, such as Windows, Linux, and macOS.
  2. The runtime should be sandboxed. It shouldn't be possible for an auto splitter to steal your passwords or delete your files.
  3. The language you write your auto splitter in should be your choice.
  4. The new runtime shouldn't be allowed to work with LiveSplit's internals (which made it hard for LiveSplit to ever change its internals). So the new API needs to be cleanly defined and be portable to other timers.

All of this already works, but due to the sandboxing approach, not every auto splitter can be rewritten for the new runtime yet. Unfortunately with the way ASL works (accessing internals and being a C# dialect), it has turned out to be quite hard to port it to the new runtime. So for now I've actually looked into JavaScript / TypeScript to be the successor language for ASL. I've however also considered Python and Lua. In the end we'll probably support all of them anyway. So I really like that you guys are exploring Lua here.

I've been curious how easy it would be to plug the auto splitting runtime into LAST, so I've written up a branch that provides a Proof of Concept implementation. It already works perfectly fine, but it lacks some things that the Lua implementation didn't provide either (skipping splits, setting game time, querying the timer state, ...).

CryZe@8be2448

If you want you can plug in this runtime, which will automatically make LAST compatible with all future LiveSplit auto splitters. I also still encourage you to work on the Lua auto splitters, as I believe that's indeed a great language that we probably want to support in the runtime as well. In fact it would be great if we worked out the design of the Lua auto splitters such that LAST's lua auto splitters can be compatible with LiveSplit('s auto splitting runtime) as is.

Keep up the great work :)

LAST does not respect Window Manager quitting.

Using my window manager's keybind to close the GTK window does not stop the LAST process from running.
Right clicking the window, selecting quit does cause the process to stop.

Tested on Arch, running qtile.

Timer as IGT

Hi, does LAST support IGT, I am porting Dino Crisis Live Splits to LAST, it works fine apparently but it uses RTA instead of IGT, is there any way to make it work with IGT?

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.