All Projects → mjkillough → Cnx

mjkillough / Cnx

Licence: mit
A simple X11 status bar for use with simple WMs.

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Cnx

Umonitor
Manage monitor configuration automatically
Stars: ✭ 54 (-53.04%)
Mutual labels:  x11
Nx Libs
nx-libs
Stars: ✭ 89 (-22.61%)
Mutual labels:  x11
Wmwm
Pure Go autotiling window manager
Stars: ✭ 107 (-6.96%)
Mutual labels:  x11
Pmenu
A pie-menu in xlib and imlib2.
Stars: ✭ 66 (-42.61%)
Mutual labels:  x11
Vkmark
Vulkan benchmark
Stars: ✭ 80 (-30.43%)
Mutual labels:  x11
Connmap
connmap is an X11 desktop widget that shows location of your current network peers on a world map (tested only with i3wm). Made with C and libcairo.
Stars: ✭ 90 (-21.74%)
Mutual labels:  x11
Paperview
A high performance X11 animated wallpaper setter
Stars: ✭ 999 (+768.7%)
Mutual labels:  x11
Meh
🎑 a simple, minimalist, super fast image viewer using raw XLib
Stars: ✭ 113 (-1.74%)
Mutual labels:  x11
Xrandr Extend
💻➡️ Extend a HIDPI screen to a normal DPI external display
Stars: ✭ 81 (-29.57%)
Mutual labels:  x11
Oxidizer
📦 A Rust ORM based on tokio-postgres and refinery
Stars: ✭ 100 (-13.04%)
Mutual labels:  tokio
Octobtt
OctoBTT
Stars: ✭ 77 (-33.04%)
Mutual labels:  x11
Rumqttd
rust mqtt broker
Stars: ✭ 77 (-33.04%)
Mutual labels:  tokio
Clearine
Beautiful Logout UI for X11 window manager
Stars: ✭ 92 (-20%)
Mutual labels:  x11
X11vnc Desktop
Docker image for Ubuntu with X11 and VNC
Stars: ✭ 57 (-50.43%)
Mutual labels:  x11
Termux Extra Packages
Stars: ✭ 110 (-4.35%)
Mutual labels:  x11
Xsuspender
👀 💻 💤 🔋 Save battery by auto-suspending unfocused X11 applications.
Stars: ✭ 53 (-53.91%)
Mutual labels:  x11
Autorandr
Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
Stars: ✭ 1,286 (+1018.26%)
Mutual labels:  x11
Php Mpos
MPOS stands for Mining Portal Open Source. Issue tracker is now closed since it's not maintained anymore.
Stars: ✭ 1,501 (+1205.22%)
Mutual labels:  x11
Clickhouse Rs
Asynchronous ClickHouse client library for Rust programming language.
Stars: ✭ 113 (-1.74%)
Mutual labels:  tokio
Xnotify
read notifications from stdin and pop them up on the screen
Stars: ✭ 97 (-15.65%)
Mutual labels:  x11

Cnx — Build Status

A simple X11 status bar for use with simple WMs.

Cnx doesn't rely on functionality from any specific WM, instead preferring to get its data from generic properties defined in EWMH. If your WM implements enough of EWMH, it should work with Cnx.

screenshot of cnx

Features

Cnx is written to be customisable, simple and fast.

Where possible, it prefers to asynchronously wait for changes in the underlying data sources (and uses mio/tokio to achieve this), rather than periodically calling out to external programs.

There are currently these widgets available:

  • Active Window Title — Shows the title (EWMH's _NET_WM_NAME) for the currently focused window (EWMH's _NEW_ACTIVE_WINDOW).
  • Pager — Shows the WM's workspaces/groups, highlighting whichever is currently active. (Uses EWMH's _NET_DESKTOP_NAMES, _NET_NUMBER_OF_DESKTOPS and _NET_CURRENT_DESKTOP).
  • Sensors — Periodically parses and displays the output of the sensors provided by the system.
  • Volume - Shows the current volume/mute status of the default output device.
  • Battery - Shows the remaining battery and charge status.
  • Clock — Shows the time.

The [Sensors], [Volume] and [Battery] widgets require platform support. They currently support Linux (see dependencies below) and OpenBSD. Support for additional platforms should be possible.

How to use

Cnx is a library that allows you to make your own status bar.

In normal usage, you will create a new binary project that relies on the cnx crate, and customize it through options passed to the main Cnx object and its widgets. (It's inspired by QTile and dwm, in that the configuration is done entirely in code, allowing greater extensibility without needing complex configuration handling).

An simple example of a binary using Cnx is:

use cnx::text::*;
use cnx::widgets::*;
use cnx::{Cnx, Position};

fn main() -> Result<()> {
    let attr = Attributes {
        font: Font::new("Envy Code R 21"),
        fg_color: Color::white(),
        bg_color: None,
        padding: Padding::new(8.0, 8.0, 0.0, 0.0),
    };

    let mut cnx = Cnx::new(Position::Top);
    cnx.add_widget(ActiveWindowTitle::new(attr.clone()));
    cnx.add_widget(Clock::new(attr.clone()));
    cnx.run()?;

    Ok(())
}

A more complex example is given in src/bin/cnx.rs alongside the project. (This is the default [bin] target for the crate, so you could use it by either executing cargo run from the crate root, or even running cargo install cnx; cnx. However, neither of these are recommended as options for customizing Cnx are then limited).

Before running Cnx, you'll need to make sure your system has the required dependencies.

Dependencies

In addition to the Rust dependencies in Cargo.toml, Cnx also depends on these system libraries:

  • x11-xcb
  • xcb-util: xcb-ewmh / xcb-icccm / xcb-keysyms
  • pango
  • cairo
  • pangocairo

The following Ubuntu packages should allow your system to meet these requirements:

apt-get install libx11-xcb-dev libxcb-ewmh-dev libpango1.0-dev libcairo2-dev

If the volume-widget feature is enabled (and it is by default), you will also need alsa-lib on Linux:

apt-get install libasound2-dev

Tests

Unfortunately there aren't many. You can run what's here with:

cargo test

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].