Skip to content

Repository files navigation

RobStat

Overview

Robstat is a status-bar generator for use with i3/sway, written and configured in Lisp.

Usage

Robstat is configured via ~/.config/robstat/stat.lisp. Example:

(status ()
 (wifi)
 (vpn)
 (battery)
 (disk-free "/")
 (system-load)
 (volume)
 (bluetooth)
 (local-time:format-timestring
  nil (local-time:now)
  :format '(:short-weekday #\  (:year 4) #\- (:month 2) #\-
            (:day 2) #\  (:hour 2) #\: (:min 2))))

STATUS takes a list of function calls to run periodically, outputting their result in i3stat format. Items can return a bare string or '(:text "words" :color :red).

Built-in Item Formatters

Predefined status formatters. These tend to be fairly opinionated; their associated queries are also exposed if you want it different.

  • WIFI

    Shows current wifi connection with strength and address, per NetworkManager.

  • VPN

    Shows current VPN connections, per NetworkManager.

  • BATTERY

    battery readout in “BAT 69% 3:00” / “CHG 20% 0:45” format. Turns red at <30min remaining.

  • DISK-FREE fs-path

    Shows free space on the fs at fs-path.

  • VOLUME

    Shows volume and muted-status.

  • BLUETOOTH

    Shows connected bluetooth devices, abbreviated, with battery if available.

    NB. bluez currently only queries battery stats with

    [General]
    Experimental=true
        

    in /etc/bluetooth/main.conf.

State Queries

  • BATTERY-LEVEL

    Battery level in $[0.0, 1.0]$

  • BATTERY-SECONDS

    How long does the battery have left to discharge/charge, in seconds

  • BATTERY-STATUS

    Get the battery status: "Charging", "Discharging" and "Full" are the commonly reported ones.

  • VOLUME-LEVEL

    Gets the current master volume, as (list :volume 0.7 :muted nil). Volume range is $[0.0, 1.0]$.

  • CONNECTIONS

    Active NetworkManager connections, returned as (list '(name type dbus-path))

  • BLUETOOTH-DEVICES

    Fetches currently connected bluetooth devices. Returned as (list '(:name "SomeTec Headphones" [:battery 69]))

Other Utilities

  • MEMOIZE-STATUS (args) &body body

    Memoizes calls to body, keyed by args (as compared by EQUAL). This is used on most of the builtin queries to cache their results. Cleared on refresh.

  • ROUND-BYTES bytes

    Rounds bytes to kibi/mebi/etc.

    > (round-bytes 20480)
    "20.0K"
        

About

Status bar, i3/sway, scriptable

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages