@aminnairi/i3status

Library to create your own i3 status bar in Node.js using the Flux architecture

Usage no npm install needed!

<script type="module">
  import aminnairiI3status from 'https://cdn.skypack.dev/@aminnairi/i3status';
</script>

README

@aminnairi/i3status

NPM badge Bundle size Tree shaking support Vulnerabilities count

Library to create your own i3 status bar in Node.js using the Flux architecture

Status Bar

Why

  • Because it is inspired by The Elm Architecture, Redux, and the Flux architecture.
  • Because it is written using modern ECMAScript syntax.
  • Because it is written using modern ECMAScript Modules.
  • Because it is written with functional programming in mind.
  • Because it is well documented with many examples (and many to come).
  • Because it is tested from integration to end-to-end.
  • Because it is powered by the Node.js platform and all of its operating system's API and ecosystem.
  • Because it allows you to build complex, dynamic status bars with ease.
  • Because it does not require any global installation (but you can if you want).
  • Because it does not require any yaml, env files, and is just plain JavaScript, nothing else.
  • Because it has full support for asynchronous updates through dispatches.
  • Because it has full support for i3wm click events (buttons, modfiiers, coordinates, ...).
  • Because it has full supports for i3wm blocks configuration (color, padding, separator, ...).
  • Because it has no external dependencies.
  • Because it has been made with love.

Instructions

Recommended

Requirements

Installation

Open a new terminal emulator and type the following commands.

mkdir ~/my-i3status
cd ~/my-i3status
touch index.mjs
npm install --save-exact --save @aminnairi/i3status

Open the created file index.mjs and copy/paste the following block of code into it.

import {createInterface} from "readline/promises";
import {stdin as input, stdout as output} from "process";
import {createRenderer} from "@aminnairi/i3status";

const render = createRenderer({
  createInterface,
  input,
  output
});

render({
  initialBlocks: [
    {
      full_text: "Hello, world!"
    }
  ]
});

Open the file ~/.config/i3/config and replace the following option status_command if it already exists, or add it to the bar block.

bar {
  status_command node ~/my-i3status/index.mjs
}

In the same terminal emulator you just opened, type the following command.

i3-msg reload

Manual

Requirements

Installation

Open a new terminal emulator and type the following commands

git clone https://github.com/aminnairi/i3status ~/my-i3status
cd ~/my-i3status
docker-compose run --rm npm install
docker-compose run --rm npm test
docker-compose run --rm npm run build

Choose one of the example script (for instance, simple.mjs) in the examples folder and replace the import path @aminnairi/i3status to ../build/index.mjs. Then open the file ~/.config/i3/config and replace the following option status_command if it already exists, or add it to the bar block.

bar {
  status_command node ~/my-i3status/example/simple.mjs
}

In the same terminal emulator you just opened, type the following command.

i3-msg reload

Examples

See examples.

Changelog

See CHANGELOG.md.

Contributing

See CONTRIBUTING.md.

Code of conduct

See CODE_OF_CONDUCT.md.

License

See LICENSE.