|
2 | 2 | [<img alt="crates.io" src="https://img.shields.io/crates/v/zentime-rs.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/zentime-rs)
|
3 | 3 | [<img alt="docs.rs" src="https://img.shields.io/docsrs/zentime-rs/latest?style=for-the-badge&logo=docs.rs" height="20">](https://docs.rs/zentime-rs/latest/zentime_rs/)
|
4 | 4 |
|
5 |
| - |
6 |
| - |
7 | 5 | # TOC
|
8 | 6 |
|
9 |
| -- [TOC](#toc) |
10 |
| - - [Features](#features) |
11 |
| - - [Example with multiple clients + display inside the left status bar of tmux](#example-with-multiple-clients--display-inside-the-left-status-bar-of-tmux) |
12 |
| - - [Installation](#installation) |
13 |
| - - [Homebrew](#homebrew) |
14 |
| - - [Cargo](#cargo) |
15 |
| - - [Nix](#nix) |
16 |
| - - [Configuration](#configuration) |
17 |
| - - [Logs](#logs) |
18 |
| - - [Tmux integration example](#tmux-integration-example) |
19 |
| - - [Usage as library](#usage-as-library) |
| 7 | +- [TOC](#toc) |
| 8 | + - [Features](#features) |
| 9 | + - [Example with multiple clients + display inside the left status bar of tmux](#example-with-multiple-clients--display-inside-the-left-status-bar-of-tmux) |
| 10 | + - [Installation](#installation) |
| 11 | + - [Homebrew](#homebrew) |
| 12 | + - [Cargo](#cargo) |
| 13 | + - [Nix](#nix) |
| 14 | + - [Configuration](#configuration) |
| 15 | + - [Logs](#logs) |
| 16 | + - [Zellij integration example](#zellij-integration-example) |
| 17 | + - [Tmux integration example](#tmux-integration-example) |
| 18 | + - [Usage as library](#usage-as-library) |
20 | 19 |
|
21 | 20 | A simple terminal based pomodoro/productivity timer written in Rust.
|
22 | 21 |
|
23 | 22 | ## Features
|
24 | 23 |
|
25 |
| -* Timer suited for the pomodoro technique |
26 |
| -* Socket-based Client/Server-Architecture, where multiple clients can attach to a single timer server |
27 |
| -* Server is terminal independent and runs as a daemon |
28 |
| -* TUI-interface with keymaps + and a minimal TUI-interface |
29 |
| -* CLI commands to interact with the timer without attaching a client (e.g. for integration into tools such as tmux) |
| 24 | +- Timer suited for the pomodoro technique |
| 25 | +- Socket-based Client/Server-Architecture, where multiple clients can attach to a single timer server |
| 26 | +- Server is terminal independent and runs as a daemon |
| 27 | +- TUI-interface with keymaps + and a minimal TUI-interface |
| 28 | +- CLI commands to interact with the timer without attaching a client (e.g. for integration into tools such as tmux) |
30 | 29 |
|
31 | 30 | ### Example with multiple clients + display inside the left status bar of tmux
|
32 | 31 |
|
@@ -66,13 +65,60 @@ clicking on the type inside the docs shows you the available configuration field
|
66 | 65 |
|
67 | 66 | Logs are being written to:
|
68 | 67 |
|
69 |
| -* `/tmp/zentime.d.err` - this captures any panics |
70 |
| -* `/tmp/zentime.d.out` - this captures error/warn/info etc. logs |
| 68 | +- `/tmp/zentime.d.err` - this captures any panics |
| 69 | +- `/tmp/zentime.d.out` - this captures error/warn/info etc. logs |
71 | 70 |
|
72 | 71 | The default log level is `warn`.
|
73 | 72 | You can configure the log level by running zentime with `RUST_LOG=<level> zentime`.
|
74 | 73 | Here's an overview of [available log levels](https://docs.rs/log/0.4.17/log/enum.Level.html).
|
75 | 74 |
|
| 75 | +## Zellij integration example |
| 76 | + |
| 77 | +I've found that currently the easiest way to get some integration with zentime into zellij, is to create a custom layout and also create some shell aliases. |
| 78 | + |
| 79 | +For example you could use the following layout as base for a 'zellij-zentime'-layout: |
| 80 | + |
| 81 | +```kdl |
| 82 | +layout { |
| 83 | + pane split_direction="vertical" size=1 { |
| 84 | + pane { |
| 85 | + size 30 |
| 86 | + borderless true |
| 87 | + name "zentime" |
| 88 | + command "zentime" |
| 89 | + } |
| 90 | + pane borderless=true { |
| 91 | + plugin location="zellij:tab-bar" |
| 92 | + } |
| 93 | + } |
| 94 | +} |
| 95 | +``` |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +You might need to adjust the size of the zentime pane depending on the terminal font you are using. |
| 100 | + |
| 101 | +> WARNING: |
| 102 | +> There currently is no way to isolate regular panes in zellij from the tab-sync mechanism. |
| 103 | +> (Only plugin panes are currently isolated) |
| 104 | +> This means that you might accidentally change your timer, when you use tab-sync mode. |
| 105 | +> I already created a [feature request](https://github.com/zellij-org/zellij/issues/2285) to create isolated panes and am planning to contribute and create a PR if the maintainer is fine with that. |
| 106 | +
|
| 107 | +> NOTE: I actually wanted to write a plugin for zellij. However unfortunately this is currently not that easy for |
| 108 | +> two reasons: |
| 109 | +> |
| 110 | +> 1. The zellij plugin system is currently being rebuilt and it doesn't really make sense to built a "legacy"-plugin right now |
| 111 | +> 2. Our zentime client library code makes use of a lot of async code, which does not yet compile to WASI |
| 112 | +
|
| 113 | +Because zellij also does not yet allow arbitary commands to be configured with keyboard shortcuts, |
| 114 | +you basically have three options to interact with zentime: |
| 115 | + |
| 116 | +1. Just manually switch to the pane and use our regular zentime shortcuts |
| 117 | +2. Manually run commands/trigger another zentime client inside the pane you are working in anyway right now |
| 118 | +3. **Recommnded**: (This is basically just an alteration of 2. -> Create bash/zsh/<your-shell> aliases for commands like `zentime skip`, `zentime toggle-timer` etc. |
| 119 | + |
| 120 | +If you go the third route I would recommend to prefix each command with `-s` (`--silent`) as you probably are not interested in the minor output zentime gives you under these circumstances. |
| 121 | + |
76 | 122 | ## Tmux integration example
|
77 | 123 |
|
78 | 124 | To display the current timer state inside the tmux status bar you could use `zentime once` which will be queried by tmux on each status bar update.
|
|
0 commit comments