~ma3ke/tid

A small system information bar.
Update README about weft
Set event loop control flow state consistently
Move scale factor determination logic to a function

clone

read-only
https://git.sr.ht/~ma3ke/tid
read/write
git@git.sr.ht:~ma3ke/tid

You can also use your local clone with git send-email.

#tid — a small system information bar

screenshot of tid in action

This little program is in a pretty good state, right now. It is intended for my personal use, and it is polished enough that it is useful to others as well. I am enjoying it a lot and it fits my needs.

(See also, accompanying labbook entry.)

The uf2 font parsing depends on fleck, which is based on the original uf2 parsing code from this project.

tid is part of the broader weft ecosystem.

A pictogram of a line in a zig-zag pattern like the weft on a loom.

#installation

#from source

git clone https://git.sr.ht/~ma3ke/tid
cd tid
cargo install --path .
sudo mkdir /etc/tid
sudo cp -r fonts /etc/tid/fonts
sudo cp tid.config /etc/tid

(I may put these operations into a makefile or shell script at some point, but it's quite trivial.)

#AUR

The tid package is available on the AUR!

(Feel free to package tid for other package managers :)

#what it does

  • Displays the date and time.
  • Can display the battery percentage.
  • Displays the memory usage as a percentage.
  • Displays the cpu usage as a percentage.
  • Displays the cpu usage history as a graph.
  • Can show the current playback state of mpd.

#usage & configuration

tid can be configured through a /etc/tid/tid.config file and command line arguments.

#config file

The config file must (as of now) be located at /etc/tid/tid.config. An example file is provided in the repository.

Any of the following keywords are recognized, followed by some form of whitespace and an appropriate argument. Each setting is on a separate line. The arguments are interpreted in the same manner as the command line arguments.

  • elements
  • font_name
  • font_path
  • foreground
  • background
  • mpd_addr

Whitespace may precede or trail the lines. Any part of a line beyond # is a comment and is ignored.

#command line arguments

  • Want to change the font? Fonts can be specified through command line arguments. Use, for example, --font-name geneva12.uf2 or --font-path /etc/tid/fonts/geneva12.uf2. Currently, the supported font formats are uf2 and psf2. For instance, here you can see tid running with the beautiful sun12x22.psfu font. Note that uf2 fonts require a .uf2 extension to be accepted, while psf2 can be recognized through its magic number.

  • Want to change the color? You can set the foreground and background color by providing a 0x{r}{g}{b}{a} formatted hex string as parameters after the --fg and --bg flags, respectively. For example,

    tid --fg 0xcc33aaff --bg 0xffffff00
    

    will set the foreground to a dark magenta and the background to white transparent, like this. By default, the background is black and transparent (if supported), and the foreground white.

  • Want to change the order and selection of elements? You can :) The elements can be specified through the command line arguments, or through the config file. The format for the elements specification string is a space delimited list of any of the following items:

    • padding(<width>)
    • space
    • date
    • time
    • label(<text>)
    • battery
    • mem
    • cpu
    • cpugraph(<width>)
    • playbackstate

    For an example, check the line in the tid.config file.

#full usage information

Usage:
    tid [OPTIONS]

Options:
    --elements        Define the elements to be displayed.
                      This is a space-delimited list of any of the following
                      items:
                        - padding(<width>)       - space
                        - date                   - time
                        - label(<text>)          - battery
                        - mem                    - cpu
                        - cpugraph(<width>)      - playbackstate
    --font-name -n    Set the font name from the default directory.
                      (default: 'cream12.uf2' in '/etc/tid/fonts')
    --font-path -p    Set the font path.
    --fg              Specify the foreground color as an rgba hex string.
                      (default: 0xffffffff)
    --bg              Specify the background color as an rgba hex string.
                      (default: 0x00000000)
    --position        Set the requested position to spawn the window.
                      Must be set as 'x,y' without a space, where x and y are
                      unsigned integers.  (default: '0,0')
    --mpd-address     Specify the address for the mpd connection.
                      (default: 127.0.0.1:6600)
    --version   -v    Display function.
    --help      -h    Display help.

To set the scale factor manually, the TID_SCALE_FACTOR environment variable is available. For example,

TID_SCALE_FACTOR=3 tid

would make each logical pixel that is rendered 3×3 display pixels in size.

#contributing

The issue tracker for tid can be found at todo.sr.ht/~ma3ke/tid. We use todo.sr.ht/~ma3ke/weft to keep track of ideas and tasks that pertain to the project as a whole.

NOTE: If you would like to submit changes, but feel intimidated by doing it by email, that is no problem at all! Another fine way is to fork the repository elsewhere, push your changes to there, and send me the link to the commit you want me to consider. Or, just get in touch with a DM or email :)

Patches can be submitted to the weft mailing list (~ma3ke/weft@lists.sr.ht).

Before submitting a patch, it is wise and fun to reach out through DM or on the email list for help and discussion.

When submitting a patch via email, please set the subject prefix to [PATCH tid].

git config format.subjectPrefix "PATCH tid"

(If you don't know how this stuff works, but want to learn about this, git-send-email.io is a fantastic hands-on resource.)

#thanks

Thanks to Maya and Bauke for testing and suggesting changes to allow tid to run on MacOS.


Made with <3 ma3ke