Tarme
Tarme is a status generator for panels using the i3bar/swaybar protocol, written and configured in CHICKEN Scheme.
Get it on Codeberg
What’s Missing
- Click Events
Dependencies
- CHICKEN Scheme
- build-time dependency for static builds
- a runtime dependency for dynamic builds or running interpreted
- Eggs
- srfi-1
- srfi-18
- srfi-71
- srfi-99
- json
- queues
The included example config has extra dependencies.
Building
Simply compile tarme.scm
using csc
.
$ csc tarme.scm
Alternatively, you may run Tarme interpreted using csi
.
$ csi -script tarme.scm
Or to make use of the shebang (assumes csi
is in $PATH
and is the Chicken Scheme Interpreter)
$ chmod u+x tarme.scm
$ ./tarme.scm
Note: the Chicken Scheme Interpreter and Compiler may have different binary
names on some systems to avoid conflicts with the
Mono C# Interpreter and Compiler. For example
on Arch they are named chicken-csi
and chicken-csc
respectively.
Configuration
Tarme will look for a configuration file located at ~/.config/tarme/config
. Should
you choose to compile the configuration file (using the -shared
flag so Tarme
can (load ...)
it), Tarme will prefer loading config.so
when it is present.
config
(no file extension) will also be checked (before the .so
and .scm
variants) due to how Chicken’s load
form works, but it should be avoided as
it creates ambiguity.
You may also point Tarme to a different configuration file using the -c
or
--config
flag.
$ tarme --config path/to/config
Configuration file format
All (key . value)
pairs bellow are block proprieties as defined in the
swaybar-protocol,
represented as an association list; Scheme symbols are automatically casted to
strings before sending the blocks to the panel
The configuration file consists of three forms Tarme pays attention to, the first two being optional
header
(optional)- which defines the initial header block defined in the i3bar-protocol
- if no header is defined in the configuration file, Tarme will default to a minimal block
- the
(version . N)
key is required by the protocol, consult the protocol definition for information on what versions are available and what each means
(header '((version . 1)
(click_events . #t)))
global-defaults
(optional)- defines the default keys to be set for all blocks
(global-defaults '((separator . #f)
(separator_block_width . 0)))
define-blocks
(required)- defines what blocks Tarme should use
- takes any number of blocks as arguments (see bellow how you define them)
- blocks are defined from left to right
(define-blocks BLOCK ...)
Blocks
Each block is defined using the following form
(Block static: STATIC
data: DATA
update: UPDATE)
where
static
- a list of default block proprieties, just like
global-defaults
, which it overrides. - defaults to
'()
if left undefined
- a list of default block proprieties, just like
data
- unused by Tarme
- to be used to store block-specific persistent data
- defaults to
'()
if left undefined
update
- a single-argument lambda which must return a list of block proprieties
(just like the
global-defaults
andBLOCK
-localstatic
proprieties)- said argument is the whole block, allowing you to access any of its fields
- proprieties returned by it override both
global-defaults
and theBLOCK
-localDEFAULTS
- the list may also be empty
- defaults to
(void)
if left undefined
- a single-argument lambda which must return a list of block proprieties
(just like the
queue
- defined implicitly, but later accessible by the update lambda, requires
the
queues
egg be imported in the config file if it’s compiled - Tarme will send click events to the queue, from which the block’s update function can then retrieve and process them
- defined implicitly, but later accessible by the update lambda, requires
the
The configuration file should also import any Eggs used by the Blocks.
For examples, see here.
Themes
This repository also contains a Pywal template, and
the Base16 Classic Dark
theme in the same format.