{"id":16864723,"url":"https://github.com/38/i3monkit","last_synced_at":"2025-03-17T05:32:38.872Z","repository":{"id":62440412,"uuid":"165324037","full_name":"38/i3monkit","owner":"38","description":"The toolkit to create customized I3 status bar","archived":false,"fork":false,"pushed_at":"2023-07-15T14:15:28.000Z","size":65,"stargazers_count":39,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-27T18:36:50.431Z","etag":null,"topics":["i3bar","i3status","i3wm","tiling-window-manager"],"latest_commit_sha":null,"homepage":null,"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/38.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":"2019-01-11T23:10:57.000Z","updated_at":"2025-01-08T05:37:26.000Z","dependencies_parsed_at":"2024-10-27T12:09:43.657Z","dependency_job_id":"b75c7b4a-eb6c-4424-affa-76c0a68f9c0c","html_url":"https://github.com/38/i3monkit","commit_stats":{"total_commits":27,"total_committers":3,"mean_commits":9.0,"dds":"0.11111111111111116","last_synced_commit":"d72d94d103b2621ebfc06c9950d3bba9613e4936"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38%2Fi3monkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38%2Fi3monkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38%2Fi3monkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38%2Fi3monkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/38","download_url":"https://codeload.github.com/38/i3monkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243846978,"owners_count":20357297,"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":["i3bar","i3status","i3wm","tiling-window-manager"],"created_at":"2024-10-13T14:43:38.896Z","updated_at":"2025-03-17T05:32:38.047Z","avatar_url":"https://github.com/38.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# i3monkit - The i3 Status Bar Monitor Toolkit\n\n[![Latest Version](https://img.shields.io/crates/v/i3monkit.svg)](https://crates.io/crates/i3monkit)\n\n* [API Documentation](https://docs.rs/i3monkit/)\n\n## Overview\n\nThis is a toolkit for building customized status bar program for the [i3 tiling window manager](https://i3wm.org).\ni3 has its default status bar program called `i3status`, but it's somehow limited and hard to\nextend and customize. This crate gives you the ability to reimplement an status bar program for\ni3 quickly.\n\n![Screen Shot](https://raw.githubusercontent.com/38/i3monkit/master/screenshot.png)\n\nIt comes with a set of builtin widget as well, such as, CPU usage bar, Network speed meter,\netc.\n\n## How to build the status bar program\n\nYou can crate your own status bar with just a few lines of code in Rust.\n\nFirst, you need to crate a crate and import this crate\n\n```toml\n[dependencies]\ni3monkit = \"*\"\n\n```\n\nThen, config your customized i3 status bar\n\n```rust\nuse i3monkit::*;                                                              \nuse i3monkit::widgets::*;                                                     \n\nfn main() {\n    let mut bar = WidgetCollection::new();\n\n    //Add realtime stock prices, for example: Microsoft, AMD and Facebook\n    let stock_client = StockClient::new(\"your-alphavantage-API-key\");         \n    bar.push(StockClient::create_widget(\u0026stock_client, \"MSFT\"));              \n    bar.push(StockClient::create_widget(\u0026stock_client, \"AMD\"));               \n    bar.push(StockClient::create_widget(\u0026stock_client, \"FB\"));\n                                                                              \n    //Realtime upload/download rate for a interface                           \n    bar.push(NetworkSpeedWidget::new(\"wlp58s0\"));\n                                                                              \n    //Display all the cpu usage for each core                                 \n    for i in 0..4 {                                                           \n        bar.push(CpuWidget::new(i));                                          \n    }\n                                                                              \n    //Volume widget                                                           \n    bar.push(VolumeWidget::new(\"default\", \"Master\", 0));\n                                                                              \n    //Battery status                                                          \n    bar.push(BatteryWidget::new(0));\n                                                                              \n    //Time                                                                    \n    bar.push(DateTimeWidget::new());\n                                                                              \n    // Then start updating the satus bar                                      \n    bar.update_loop(I3Protocol::new(Header::new(1), std::io::stdout()));\n}\n```\n                                                                             \nFinally, you can change `~/.config/i3/config` to make i3wm uses your status bar program\n\n``` config\n # Start i3bar to display a workspace bar (plus the system information i3status\n # finds out, if available)\n bar {\n \tstatus_command path/to/your/customized/status/program\n \ttray_output primary\n \tcolors {\n \t   background #222222\n \t   statusline #00ee22\n \t   separator #666666\n \t   #                  border  backgr. text\n \t   focused_workspace  #4c7899 #285577 #ffffff\n \t   inactive_workspace #333333 #222222 #888888\n \t   urgent_workspace   #2f343a #900000 #ffffff\n \t}                                                           \n  }\n```\n## Write your own widget\n\nYou can also add your customized widget to the framework by implementing the `Widget` trait.\n\n```rust\nuse i3monkit::{Block, Widget, WidgetUpdate};\nstruct Greeter(\u0026'static str);\nimpl Widget for Greeter {\n    fn update(\u0026mut self) -\u003e Option\u003cWidgetUpdate\u003e {\n        Some(WidgetUpdate{\n            refresh_interval: std::time::Duration::new(3600,0),\n            data: Some(Block::new().append_full_text(self.0).clone())\n        })\n    }\n}\n\nfn main() {\n    let bar = WidgetCollection::new();\n    bar.push(Greeter(\"hello world\"));\n    .....\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F38%2Fi3monkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F38%2Fi3monkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F38%2Fi3monkit/lists"}