Get up-to-date departure times for Munich public transport in your terminal.

Overview

MVG Fahrinfo

MVG Fahrinfo is a CLI tool to keep up-to-date with latest departure times of Munich public transport. The app is a native binary and uses official (albeit unpublished) MVG API.

It is made with Rust. 🦀

It features:

  • Very low resource usage.
  • Beautiful terminal interface.
  • Automatic refreshing of departures.
  • Searching of stations.
  • Saving stations to file.
  • Real-life colors for vehicles for easier identification.
  • Easy navigation with shortcuts.

Using

Clone the repository and run cargo run in the root directory. In the first run, it will fetch the stations list from the server and save it to stations.json file.

To force update the stations list file, just delete the file and run the app again. The app will stay open in your terminal and will refresh the departures every 60 seconds.

To exit the app, press q or Ctrl+C.

Installing

To run it globally, you can install the app with cargo binstall mvgfahrinfo. Make sure you have binstall binstall repo installed. Once installed, you can invoke the app just by running mvgfahrinfo in the terminal. This is a binary crate and not a library, so you shouldn't use it as a dependency.

I might provide some pre-built binaries for Windows/MacOS/Linux in the future. :)

Shortcuts

Normal mode

  • tab - Switch between departures and stations list.
  • r - Refresh departures.
  • s - Search for a station.
  • Up/Down - Navigate through the list of stations.
  • Enter - Select a station.
  • q - Quit the app.
  • Ctrl+C - Quit the app.

Search mode

  • Esc - Exit search mode.
  • Up/Down - Navigate through the list of stations.
  • Enter - Select a station.

Screenshots

Current Departures in Munich Hauptbahnhof All stations list Station search

Credits

  • MVG for the API.
  • Ratatui for the beautiful terminal interface framework.

License

MIT

Limitations

Currently, the app only handles ASCII or 1 byte UTF-8 character input. If you are searching a station with non-ascii characters (i.e. ö,ß etc.) in its name, the app will ignore the input. Please type the closest characters & scroll a bit down to select the station from the list (this will be fixed at a later version.)

Comments
  • Can not enter the char 'c' in the searchbar

    Can not enter the char 'c' in the searchbar

    When searching for a station the character c is not accepted as input.

    For example: Searching for Candidplatz results in only the string andidplatz getting displayed in the searchbox image

    For stations like Candidplatz this is not an issue since the station will be found either way. However this is problematic for stations like Hackerbrücke which result in the search string Hakerbrüke which is obviously not yielding any results.

    opened by cato447 3
  • tokio-runtime-worker panicking

    tokio-runtime-worker panicking

    Hi there, Thanks for providing such a nice tool. I know close to nothing about Rust so this might be a very naive question/issue. The app works perfectly fine but whenever I close it I see the following message:

    [~] mvgfahrinfo
    fetching stations...
    thread 'tokio-runtime-worker' panicked at 'failed to send tick event: SendError { .. }', /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mvgfahrinfo-1.1.0/src/event.rs:50:50
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    

    Did I do something wrong when installing it using binstall? Cheers

    opened by joolof 1
  • Question regarding mvg api

    Question regarding mvg api

    Hi, not an issue but more of question/ suggestion.

    Where did you find mvg api endpoints? I did not manage to find it ob their website, also would is be possible to add a tracker to certain line, for example to see if there are issues with S2 or U2.

    opened by bq-wrongway 1
  • Migrate to tokio unbounded channel from std mpsc and other bug fixes

    Migrate to tokio unbounded channel from std mpsc and other bug fixes

    • This converts the use of std::sync::mpsc to tokio::sync::mpsc for unbounded channel communication.
    • This also handles the negative departure time shown in some stations.
    • Handles non-ascii chars (UTF-8 size > 1 byte) by just ignoring them 😛
    • silghtly more greyish highlight color in station list tab
    • cleanup and other bug fixes.
    opened by FaisalBinAhmed 0
  • Removing c/q char callbacks in search

    Removing c/q char callbacks in search

    This addresses the issue opened here: https://github.com/FaisalBinAhmed/MVGFahrinfo/issues/4

    Now the characters c and q will only work as char input instead of special keys

    opened by FaisalBinAhmed 0
  • To-dos for next version

    To-dos for next version

    • [ ] default station on launch / user choice
    • [x] handle negative minutes
    • [x] handle non-ascii characters
    • [ ] fullscreen flag - departures take whole screen
    • [ ] redraw if frame resizes
    • [ ] handle code to-dos
    • [x] main loop getting stuck in some stations (due to bad data/parsing. ie. hbf) possible bounded std::mpsc issue
    opened by FaisalBinAhmed 1
  • Thread panic after entering any character after Umlaut

    Thread panic after entering any character after Umlaut

    Trying to enter any character after typing any Umlaut (ä, ö, ü), as in e.g. "München", crashes the app. Inserting umlauts in-between already typed characters seems to work, but it does weird things with the cursor position (it can be moved further to the right than the word should actually allow).

    opened by filvuk 4
Owner
Faisal Bin Ahmed
Software Engineer. Informatics master @ Technical University of Munich. Love reading, space, and technology. https://failab.eu
Faisal Bin Ahmed
Get your loadshedding schedule in your calendar and never be left in the dark! Open-source, up-to-date, and developer friendly.

Loadshedding schedules in your digital calendar. No apps, no ads, up-to-date, and developer friendly. Get it • Key Features • Using the data • Project

Boyd Kane 117 Apr 26, 2023
CLI to query for public transport connections in switzerland

Swiss Public Transport CLI This is a simple tool to search public transport connections from one station to another, possible with a via. It uses the

Sandro Covo 4 Apr 2, 2022
Free and open public transport routing.

Transitous Free and open public transport routing. Goal A community-run provider-neutral international public transport routing service. Using openly

Public Transport 108 Mar 24, 2024
A Yocto setup and management tool that helps you keep your environment up-to-date and in-sync with your team

yb (Yocto Buddy) yb is designed to make it easy to setup and (perhaps more importantly) keep Yocto environments up-to-date and in-sync with your team.

null 13 Oct 31, 2022
Get your github contributions right in your terminal, blazingly fast!

GitColorScripts Get your github contributions right in your terminal! Installation Install via yay yay -S gitcolorscripts Install manually Download t

VoidCupboard 56 Jul 12, 2023
Utility to inherit dependencies from workspace file if it occurs 'n' or more times throughout the project.

Cargo Workspace Dependency Inheritor Utility that inherits dependencies from the main workspace if they occur n or more times in the workspace. Worksp

Timon 9 Oct 14, 2022
Easy, Simple, Clean. Making status bars reliable and up-to-date.

Simple Status Easy, Simple, Clean. Making status bars reliable and up-to-date. Installation Compiling simple_status yourself doesn't require much. Ins

James Butcher 5 Aug 1, 2022
httm prints the size, date and corresponding locations of available unique versions of files residing on ZFS snapshots

httm prints the size, date and corresponding locations of available unique versions of files residing on ZFS snapshots, as well as allowing their interactive viewing and restoration.

null 837 Dec 30, 2022
BoilerFiles is a CLI for downloading your boilerplate files from a public GitHub template repo.

BoilerFiles Available on crates.io. BoilerFiles is a CLI for downloading your boilerplate files from a public GitHub template repo. Features Are you t

Jan Müller 4 Oct 1, 2022
ask.sh: AI terminal assistant that can read and write your terminal directly!

ask.sh: AI terminal assistant that read from & write to your terminal ask.sh is an AI terminal assistant based on OpenAI APIs such as GPT-3.5/4! What'

hmirin 5 Jun 20, 2023
Get relevant files/authors for your code - binary written in rust

ContextPilot: All the context, right at your door code step. What is ContextPilot? Use this binary to find top N (all for now) relevant files and auth

Kushashwa Ravi Shrimali 8 Jul 2, 2023
Print your git contributions in your terminal, blazingly fast

Takoyaki Blazingly fast git contribution graph in your terminal Features ✔️ Customizable ✔️ Plugins to support a bunch of cloud based git repositories

kyeboard 13 Feb 6, 2023
Donate To Charity (A.K.A. Public Goods) Without Lossing Anything

Donate To Charity (A.K.A. Public Goods) Without Lossing Anything

Gajesh Naik 10 Mar 3, 2022
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects

Mercy ?? Documentation Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other pro

Umiko Security 2 Nov 27, 2022
Linkal - A public-calendar aggregator server

Linkal Linkal is a public-calendar aggregator server. Given a set a public calendars links, it can make a CalDav client believe all these calendars ar

Julien Malka 87 Dec 10, 2022
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects

Mercy ?? Documentation Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other pro

CyberSuki 2 Nov 27, 2022
Rust bindings to the RVVM's public api

rvvm [WIP] Safe Rust bindings to the RVVM's public API. Provides the Rust-idiomatic interface to the RVVM public API. Implemented Virtual machine crea

null 3 Jan 9, 2023
A high-performance WebSocket integration library for streaming public market data. Used as a key dependency of the `barter-rs` project.

Barter-Data A high-performance WebSocket integration library for streaming public market data from leading cryptocurrency exchanges - batteries includ

Barter 23 Feb 3, 2023
Automatically replace Discord CDN links with local file links, by downloading the images to the public folder

Auto Undiscord Did you hear that Discord will be blocking external websites from using images hosted on their servers? Did you host every image on you

Dot32 5 Nov 17, 2023