1 Introduction
2 Function Reference
start-status
system-time
cpu-time
battery-charge
mail
mpd
5.3.5

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?
Starts a process that will provide status bar data to i3. The status-fn should return a list of hash-map, each hash-map containing the content of a status bar item. The status-fn will be invoked once every second to provide updated data to the status bar.

procedure

(system-time)  hash-map

Returns a hash-map of of status content that displays the current system time.

procedure

(cpu-time)  hash-map

Returns a hash-map of of status content that displays the current CPU usage.

procedure

(battery-charge)  hash-map

Returns a hash-map of of status content that displays the current battery status.

procedure

(mail)  hash-map

Returns a hash-map of of status content that displays the number of read and unread messages in the current user’s notmuch mailbox.

procedure

(mpd)  hash-map

Returns a hash-map of of status content that displays track currently being played by MPD. If no track is playing, this content item will not be displayed.