{"id":18823870,"url":"https://github.com/h1romas4/zellij-datetime","last_synced_at":"2025-04-14T01:30:57.384Z","repository":{"id":153941246,"uuid":"631025488","full_name":"h1romas4/zellij-datetime","owner":"h1romas4","description":"This plugin adds a date and time pane to [Zellij](https://zellij.dev/), a terminal workspace.","archived":false,"fork":false,"pushed_at":"2025-03-20T03:56:27.000Z","size":1425,"stargazers_count":34,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T15:47:35.935Z","etag":null,"topics":["rust","wasi","wasmtime","webassemby","zellij","zellij-plugin"],"latest_commit_sha":null,"homepage":"https://another.maple4ever.net/archives/3271/","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/h1romas4.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-21T18:21:34.000Z","updated_at":"2025-03-26T21:43:24.000Z","dependencies_parsed_at":"2024-05-07T11:38:03.140Z","dependency_job_id":"a0b90a9b-80b4-49db-8a8f-cd8354de2d50","html_url":"https://github.com/h1romas4/zellij-datetime","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fzellij-datetime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fzellij-datetime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fzellij-datetime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fzellij-datetime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h1romas4","download_url":"https://codeload.github.com/h1romas4/zellij-datetime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248807394,"owners_count":21164680,"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":["rust","wasi","wasmtime","webassemby","zellij","zellij-plugin"],"created_at":"2024-11-08T00:54:54.712Z","updated_at":"2025-04-14T01:30:57.351Z","avatar_url":"https://github.com/h1romas4.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zellij-datetime\n\n![](https://github.com/h1romas4/zellij-datetime/workflows/Release/badge.svg) ![](https://github.com/h1romas4/zellij-datetime/workflows/Build/badge.svg)\n\nThis plugin adds a date and time pane to [Zellij](https://zellij.dev/), a terminal workspace.\n\n![zellij-08.png](https://raw.githubusercontent.com/h1romas4/zellij-datetime/main/docs/images/zellij-08.png)\n\nZellij's plugin system leverages WebAssembly/WASI, and this plugin will also work with both amd64 and Arm in the same binary.\n\n## Require\n\n* Zellij `0.41.1` or later\n\n```\n$ zellij -V\nzellij 0.41.1\n```\n\n## Setup\n\nPreparation of Plug-in deployment destination:\n\n```bash\n# create configuration directory\nmkdir -p ~/.config/zellij/layouts/\nmkdir -p ~/.config/zellij/plugins/\n# If you have already created a layout file, you do not need to do the following.\n# export default layout (Be careful not to overwrite your settings)\nzellij setup --dump-layout default \u003e ~/.config/zellij/layouts/default.kdl\n```\n[Download zellij-datetime.wasm](https://github.com/h1romas4/zellij-datetime/releases/latest/download/zellij-datetime.wasm):\n\n```bash\ncd ~/.config/zellij/plugins/\n# download datetime plugin\nwget -O zellij-datetime.wasm \\\n    https://github.com/h1romas4/zellij-datetime/releases/latest/download/zellij-datetime.wasm\n```\n\nSet the full path to `zellij-datetime.wasm` in the `~/.config/zellij/layouts/default.kdl` layouts file.\n\n```bash\nvi ~/.config/zellij/layouts/default.kdl\n```\n\nExample - Basic layout:\n\n```kdl\nlayout {\n    pane size=1 borderless=true {\n        plugin location=\"file:/home/hiromasa/.config/zellij/plugins/zellij-datetime.wasm\"\n    }\n    pane size=1 borderless=true {\n        plugin location=\"zellij:tab-bar\"\n    }\n    pane\n    pane size=1 borderless=true {\n        plugin location=\"zellij:status-bar\"\n    }\n}\n```\n\nExample - The same line as the other bar(s):\n\n```kdl\nlayout {\n    pane size=1 split_direction=\"vertical\" {\n        pane size=\"75%\" borderless=true {\n            plugin location=\"zellij:tab-bar\"\n        }\n        pane size=\"25%\" borderless=true {\n            plugin location=\"file:/home/hiromasa/.config/zellij/plugins/zellij-datetime.wasm\"\n        }\n    }\n    pane\n    pane size=1 borderless=true {\n        plugin location=\"zellij:status-bar\"\n    }\n}\n```\n\n## Usage\n\n- Timezone can be selected by left mouse click or scrolling.\n- Insert a date/time string into current pane with a right mouse click. (Require `enable_right_click true` plugin setting)\n\nhttps://github.com/h1romas4/zellij-datetime/assets/4337664/6ba30ce8-f1c5-4c32-9d00-18e2224b4c37\n\n## Plugin settings\n\n```\nlayout {\n    pane size=1 borderless=true {\n        plugin location=\"file:/home/hiromasa/.config/zellij/plugins/zellij-datetime.wasm\" {\n            timezone1 \"PDT/-9\"\n            timezone2 \"UTC/0\"\n            timezone3 \"CEST/+2\"\n            timezone4 \"JST/+9\"\n            timezone5 \"NPT/+5.75\"\n            default_timezone \"JST\"\n            date_format \"%Y/%m/%d %A\"\n            time_format \"%I:%M %p\"\n            background_color \"#0080a0\"\n            foreground_color \"#ffffff\"\n            pane_color \"#1e1e1e\"\n            enable_right_click false\n            arrow_separator1 \"\"\n            arrow_separator2 \"\"\n            arrow_separator3 \"\"\n            padding_adjust 0\n            text_align \"right\"\n        }\n    }\n}\n```\n\n|  Key                 |  Format         | Default        | Note |\n| -------------------- | --------------- | -------------- | ---- |\n| `timezone1`          | `\"name/offset\"` | `\"UTC/0\"`      |      |\n| `timezone[2-9]`      | `\"name/offset\"` | -              |      |\n| `default_timezone`   | `\"name\"`        | `\"UTC\"`        |      |\n| `date_format`        | [chrono::format::strftime](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) | `\"%Y-%m-%d %a\"` |      |\n| `time_format`        | [chrono::format::strftime](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) | `\"%H:%M\"`       | The screen refreshes every minute. |\n| `background_color`   | `\"#color\"`      | `\"#0080a0\"`    |      |\n| `foreground_color`   | `\"#color\"`      | `\"#ffffff\"`    | It may be adjusted automatically depending on the `background_color`. |\n| `pane_color`         | `\"#color\"`      | `\"#1e1e1e\"`    |      |\n| `enable_right_click` | bool            | `false`        | Right-clicking on the clock outputs the string format to stdin; Allow `PermissionType::WriteToStdin` permission when starting the plugin. |\n| `arrow_separator1`   | `\"string\"`      | `\"\"`          | Delimiter string on line. Only the first character. |\n| `arrow_separator2`   | `\"string\"`      | `\"\"`          | 📅 Only the first character. |\n| `arrow_separator3`   | `\"string\"`      | `\"\"`          | ⌚ Only the first character. |\n| `padding_adjust`     | i32             | `0`            | It can be used to adjust left-justified padding. For example, adjusting the separator width if it is off by full-width. |\n| `text_align`         | `\"string\"`      | `\"right\"`      | `right` or `left` or `center` |\n\n## Build\n\nDevelopment\n\n```bash\n# If you don't have Zellij installed already\ncargo install --locked zellij\n# Git clone\ngit clone https://github.com/h1romas4/zellij-datetime\ncd zellij-datetime\n# Building the plugin\ncargo build\n# Running in Zellij\nzellij -l plugin.kdl\n```\n\nProduction\n\n```bash\n# Install wasm-snip\ncargo install wasm-snip\n# Build\ncargo build --release\n# Remove debug symbols and replaces unreachable.\nwasm-snip target/wasm32-wasip1/release/zellij-datetime.wasm -o target/wasm32-wasip1/release/zellij-datetime-snip.wasm\n# Deploy plugin directory\ncp -p target/wasm32-wasip1/release/zellij-datetime-snip.wasm ~/.config/zellij/plugins/zellij-datetime.wasm\n# Running in Zellij\nzellij\n```\n\nDevelopment on Ubuntu 22.04 with container\n\n- It can be tested on the main branch of Zellij.\n- There is no confusion with the current Zellij session.\n- You can test the operation of the plugin authority from the initial state.\n\n```bash\ngit clone https://github.com/zellij-org/zellij.git\ngit clone https://github.com/h1romas4/zellij-datetime\n# build Zellij (A newer version of protobuf-compiler is required)\ncd zellij\ncargo xtask build --release\n# build zellij-datetime\ncd ../zellij-datetime\ncargo build\n# Run with container (podman or docker)\npodman run \\\n    --name zellij-datetime \\\n    --env SHELL=/usr/bin/bash \\\n    -v ../zellij/target/release/:/opt/zellij \\\n    -v .:/opt/zellij-datetime \\\n    -w /opt/zellij-datetime \\\n    -it --rm \\\n    mcr.microsoft.com/devcontainers/base:ubuntu-24.04 \\\n    /opt/zellij/zellij -l plugin.kdl\n```\n\n## License\n\nMIT License\n\n## WIP\n\n- [x] Support for changing timezone by click or scroll on a pane.\n- [x] Support for timezone definition files.\n- [x] Binary size reduction.\n- [x] Improved parsing of configuration files.\n- [x] Support for background color specification.\n- [ ] When a Zellij session is detached and reattached, the plugin stops without getting drawing and timer events. [#2575](https://github.com/zellij-org/zellij/issues/2575)\n- [x] Unnecessary borderlines appear when this plugin is placed at the bottom of the workspace with borderless=true.\n- [ ] Display is disturbed when the screen width is smaller than the display string.\n- [ ] ~~Separate control of the line from control of datetime string generation.~~ Support for Zellij UI components. [Rendering a UI - Zellij User Guide](https://zellij.dev/documentation/plugin-ui-rendering.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1romas4%2Fzellij-datetime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh1romas4%2Fzellij-datetime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1romas4%2Fzellij-datetime/lists"}