{"id":13595523,"url":"https://github.com/nwtnni/tock","last_synced_at":"2025-04-09T13:32:24.025Z","repository":{"id":57670020,"uuid":"191499058","full_name":"nwtnni/tock","owner":"nwtnni","description":"Digital clock for the terminal","archived":false,"fork":false,"pushed_at":"2025-01-16T19:48:53.000Z","size":170,"stargazers_count":130,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T20:51:49.139Z","etag":null,"topics":["cli","clock","terminal-based"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nwtnni.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-06-12T04:43:51.000Z","updated_at":"2025-01-16T19:48:55.000Z","dependencies_parsed_at":"2024-01-16T22:19:44.734Z","dependency_job_id":"a7e437bf-1be9-456f-99fa-dfa05f2d3dd7","html_url":"https://github.com/nwtnni/tock","commit_stats":{"total_commits":67,"total_committers":1,"mean_commits":67.0,"dds":0.0,"last_synced_commit":"8e1267d60f434bf1653f3ab690d6f5d3a50cf047"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtnni%2Ftock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtnni%2Ftock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtnni%2Ftock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwtnni%2Ftock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwtnni","download_url":"https://codeload.github.com/nwtnni/tock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248049463,"owners_count":21039221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","clock","terminal-based"],"created_at":"2024-08-01T16:01:51.748Z","updated_at":"2025-04-09T13:32:23.686Z","avatar_url":"https://github.com/nwtnni.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# tock\n\nA digital clock for the terminal, inspired by [tty-clock][0].\nUnfortunately only works on UNIX systems due to the use of\nthe `termios` and `sigaction` related function calls.\n\nNote: emulating all features of tty-clock is **not** a goal of this project.\n\n## Features\n\n- Efficient bitmap and diff-based drawing\n- Timezone support via the `TZ` environment variable and `tzselect` utility\n- Military time and second display toggling\n- Color customization using ANSI, 8-bit, or 24-bit color values\n- Arbitrary date formatting\n- Positioned or centered clock\n- Adjustable display size\n- Synchronization with system clock seconds\n- Minimal syscalls (about one `read`, `write`, `nanosleep` per second)\n\n## Screenshots\n\n![Screenshot of clock](./resources/tock.png)\n\n![asciicast of multiple clocks](./resources/world.gif)\n\n## Installation\n\nCurrently requires a Rust installation with version \u003e= 1.70.0\n(due to the [`IsTerminal`](https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html) trait,\nand is only available from either:\n\n1. [crates.io][1] using [`cargo-install`](https://doc.rust-lang.org/cargo/commands/cargo-install.html)\n\n```sh\ncargo install tock\n```\n\n2. Building from source\n\n```sh\ngit clone https://github.com/nwtnni/tock.git\ncargo build --release\n./target/release/tock\n```\n\n## Usage\n\n```output\nA digital clock for the terminal.\n\nUsage: tock [OPTIONS]\n\nOptions:\n  -x, --x \u003cX\u003e            Horizontal 0-indexed position of top-left corner [default: 0]\n  -y, --y \u003cY\u003e            Vertical 0-indexed position of top-left corner [default: 0]\n  -W, --width \u003cWIDTH\u003e    Font width in characters per tile [default: 2]\n  -H, --height \u003cHEIGHT\u003e  Font height in characters per tile [default: 1]\n  -s, --second           Display seconds\n  -m, --military         Display military (24-hour) time\n  -c, --center           Center the clock in the terminal. Overrides manual positioning\n  -C, --color \u003cCOLOR\u003e    Change the color of the time [default: 2]\n  -f, --format \u003cFORMAT\u003e  Change the date format [default: \"%F | %Z\"]\n  -h, --help             Print help (see more with '--help')\n```\n\nCurrently compiles with the `interactive` feature flag set by default, which\npolls `stdin` for user input once per second. Available commands with this\nfeature flag set are:\n\n- `q` or `Q` or `\u003cESC\u003e`: Exit.\n- `s`: Toggle second display.\n- `m`: Toggle military (24H) time.\n- `0`..=`7`: Change to corresponding ANSI color.\n\n## References\n\n- [How Not to Write a Signal Handler][2]\n- [What is the difference between sigaction and signal?][3]\n- [A Brief Introduction to termios: termios(3) and stty][4]\n- [Understanding UNIX termios VMIN and VTIME][5]\n- [Specifying the Time Zone with TZ][6]\n- [min-sized-rust][7]\n\n[0]: https://github.com/xorg62/tty-clock\n[1]: https://crates.io/\n[2]: http://lazarenko.me/signal-handler/\n[3]: https://stackoverflow.com/questions/231912/what-is-the-difference-between-sigaction-and-signal\n[4]: https://blog.nelhage.com/2009/12/a-brief-introduction-to-termios-termios3-and-stty/\n[5]: http://www.unixwiz.net/techtips/termios-vmin-vtime.html\n[6]: https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html\n[7]: https://github.com/johnthagen/min-sized-rust\n[8]: https://github.com/Canop\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwtnni%2Ftock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwtnni%2Ftock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwtnni%2Ftock/lists"}