{"id":19974650,"url":"https://github.com/mjkillough/cnx","last_synced_at":"2025-04-05T00:08:14.559Z","repository":{"id":46204764,"uuid":"93861621","full_name":"mjkillough/cnx","owner":"mjkillough","description":"A simple X11 status bar for use with simple WMs.","archived":false,"fork":false,"pushed_at":"2024-05-04T05:42:58.000Z","size":979,"stargazers_count":196,"open_issues_count":12,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T23:06:12.770Z","etag":null,"topics":["rust","status-bar","tokio","x11"],"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/mjkillough.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-09T13:30:01.000Z","updated_at":"2025-03-28T19:37:12.000Z","dependencies_parsed_at":"2025-01-04T12:41:36.072Z","dependency_job_id":"52a35469-dfc1-49f4-b0f7-f4111ede6a87","html_url":"https://github.com/mjkillough/cnx","commit_stats":{"total_commits":279,"total_committers":8,"mean_commits":34.875,"dds":"0.34408602150537637","last_synced_commit":"7845d99baa296901171c083db61588a62f9a8b34"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjkillough%2Fcnx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjkillough%2Fcnx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjkillough%2Fcnx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjkillough%2Fcnx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjkillough","download_url":"https://codeload.github.com/mjkillough/cnx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266564,"owners_count":20910836,"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","status-bar","tokio","x11"],"created_at":"2024-11-13T03:15:40.680Z","updated_at":"2025-04-05T00:08:14.533Z","avatar_url":"https://github.com/mjkillough.png","language":"Rust","funding_links":[],"categories":["Packages"],"sub_categories":["Bars, Panels, and Widgets"],"readme":"# Cnx — [![CI](https://github.com/mjkillough/cnx/actions/workflows/ci.yml/badge.svg)](https://github.com/mjkillough/cnx/actions)\n\nA simple X11 status bar for use with simple WMs.\n\nCnx doesn't rely on functionality from any specific WM, instead preferring to\nget its data from generic properties defined in EWMH. If your WM implements\nenough of EWMH, it should work with Cnx.\n\n![screenshot of cnx](/screenshot.png?raw=true)\n\n## Features\n\nCnx is written to be customisable, simple and fast.\n\nWhere possible, it prefers to asynchronously wait for changes in the underlying\ndata sources (and uses [`tokio`] to achieve this), rather than periodically\ncalling out to external programs.\n\n[`tokio`]: https://tokio.rs/\n\nThere are currently these widgets available:\n\n - Active Window Title — Shows the title (EWMH's `_NET_WM_NAME`) for\n   the currently focused window (EWMH's `_NEW_ACTIVE_WINDOW`).\n - Pager — Shows the WM's workspaces/groups, highlighting whichever is\n   currently active. (Uses EWMH's `_NET_DESKTOP_NAMES`,\n   `_NET_NUMBER_OF_DESKTOPS` and `_NET_CURRENT_DESKTOP`).\n - Clock — Shows the time.\n\nThe cnx-contrib crate contains additional widgets:\n\n- **Sensors** — Periodically parses and displays the output of the\n  sensors provided by the system.\n- **Volume** - Shows the current volume/mute status of the default output\n  device.\n- **Battery** - Shows the remaining battery and charge status.\n- **Wireless** - Shows the wireless strength of your current network.\n- **CPU** - Shows the current CPU consumption\n- **Weather** - Shows the Weather information of your location\n- **Disk Usage** - Show the current usage of your monted filesystem\n- **LeftWM** - Shows the monitors and tags from LeftWM\n\nThe [`Sensors`], [`Volume`] and [`Battery`] widgets require platform\nsupport. They currently support Linux (see dependencies below) and OpenBSD.\nSupport for additional platforms should be possible.\n\n## How to use\n\nCnx is a library that allows you to make your own status bar.\n\nIn normal usage, you will create a new binary project that relies on the `cnx`\ncrate, and customize it through options passed to the main `Cnx` object and\nits widgets. (It's inspired by [`QTile`] and [`dwm`], in that the configuration\nis done entirely in code, allowing greater extensibility without needing complex\nconfiguration handling).\n\n[`QTile`]: http://www.qtile.org/\n[`dwm`]: http://dwm.suckless.org/\n\nAn simple example of a binary using Cnx is:\n\n```rust\nuse cnx::text::*;\nuse cnx::widgets::*;\nuse cnx::{Cnx, Position};\n\nfn main() -\u003e Result\u003c()\u003e {\n    let attr = Attributes {\n        font: Font::new(\"Envy Code R 21\"),\n        fg_color: Color::white(),\n        bg_color: None,\n        padding: Padding::new(8.0, 8.0, 0.0, 0.0),\n    };\n\n    let mut cnx = Cnx::new(Position::Top);\n    cnx.add_widget(ActiveWindowTitle::new(attr.clone()));\n    cnx.add_widget(Clock::new(attr.clone()));\n    cnx.run()?;\n\n    Ok(())\n}\n```\n\nA more complex example is given in [`src/bin/cnx.rs`] alongside the project.\n(This is the default `[bin]` target for the crate, so you _could_ use it by\neither executing `cargo run` from the crate root, or even running `cargo install\ncnx; cnx`. However, neither of these are recommended as options for customizing\nCnx are then limited).\n\nBefore running Cnx, you'll need to make sure your system has the required\n[dependencies].\n\n[`src/bin/cnx.rs`]: https://github.com/mjkillough/cnx/blob/master/src/bin/cnx.rs\n[dependencies]: #dependencies\n\n## Dependencies\n\nIn addition to the Rust dependencies in `Cargo.toml`, Cnx also depends on these\nsystem libraries:\n - `x11-xcb`\n - `xcb-util`: `xcb-ewmh` / `xcb-icccm` / `xcb-keysyms`\n - `pango`\n - `cairo`\n - `pangocairo`\n\nThe following Ubuntu packages should allow your system to meet these\nrequirements:\n\n```\napt-get install libx11-xcb-dev libxcb-ewmh-dev libpango1.0-dev libcairo2-dev\n```\n\nIf the `volume` feature is enabled (and it is by default), you will\nalso need `alsa-lib` on Linux:\n\n```\napt-get install libasound2-dev\n```\n\nIf the `wireless` feature is enabled (and it is not by default), you will also need `iwlib-dev`\non Linux:\n\n```\napt install libiw-dev\n```\n\n## Tests\n\nUnfortunately there aren't many. You can run what's here with:\n\n```\ncargo test\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjkillough%2Fcnx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjkillough%2Fcnx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjkillough%2Fcnx/lists"}