i3status
1 Introduction
This package provides makes it easy to create your own status bar for the i3 window manager. It provide functions that you can use to populate your status bar, as well as functions for providing your status bar to i3. It’s very likely that you’ll want items in your status bar that aren’t available in this package, it’s my hope that this will be enough to get you started.")
The i3 window manager status bar works like this: i3 will start the status bar process, this process will output a continuous stream of JSON data and this data will be used to populate the status bar. This package includes a sample shell script that i3 may invoke to start the status bar.
#!/usr/local/bin/racket #lang racket (require (planet cmiles74/i3status:1:0)) (start-status (lambda () (list (mpd) (mail) (battery-charge) (cpu-time) (system-time))))
The stanza above requires this library and then starts a new status bar process and passes it a function that produces the content for the status bar. The start-status function will invoke that content function once every second, updating the i3 status bar.
Each content function returns a hash-map, the keys of which correspond to the keys the JSON structure that makes up the i3bar input protocol.
2 Function Reference
The following reference documents the exported functions in the "main.rkt" file.
(require "main.rkt") |
In practice, you’ll want to require the Planet package.
(require (planet cmiles74/i3status:1:0))
procedure
(start-status status-fn) → string
status-fn : procedure?
procedure
(system-time) → hash-map
procedure