aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: c698f636b8d8798edaa94cee95d196bab08fa72f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Description
Tsarbar is a suckless statusbar for X11.

It can draw text on the left, center and right part of the screen.
Text and background color of each component may be set individually.
And it only updates when you give it new data.

# Installation
To install:
```
git clone https://codeberg.org/iamcheeseman/tsarbar
cd tsarbar
sudo make install
```
To uninstall, run:
```
sudo make uninstall
```

# Usage
Run the bar with `tsarbar`.

You might notice it's not showing up, and that's because we need to give it something to render.
This is done using `tsarc`; tsarc is a script that forwards data to tsarbar.
```
tsarc [command] [args]
```

Available commands:
```
# Variable is any of {text, foreground/fg, background/bg, margin-left, margin-right, margin}
tsarc set [component] -[variable] [value]

# Variable is any of {height, font, gap, padding, foreground/fg, background/bg}
tsarc config -[variable] [value]

# Side is any of {left, center, right}
# Components 1 2 ... n are any components you previously set to
tsarc layout -[side] [component 1 2 ... n] -[side] [component 1 2 ... n] ...
```

## Examples
ne_mene's bar :)
![image](images/nemenes.png)

iamcheeseman's bar :D
![image](images/iamcheesemans.png)

This will set the text value of the component `label` to `"Lorem ipsum"`.
Since that component doesn't exist yet, it will also implicitly create it.
```
tsarc set label -text "Lorem ipsum"
```

This will configure the font to use Liberation Mono regular with a size of 9px.
```
tsarc config -font "Liberation Mono:style=Regular:pixelsize=9"
```

This will set the layout of the bar.
On the right, left, and center there will be a `label` component.
If these components do not have any text associated with them, they will not be rendered.
```
tsarc layout -left label -center label -right label
```

Consider the following script:
```
while true; do
  tsarc set date -text "$(date)"
  sleep 1
done
```
If our tsarbar has a component named `date` somewhere in the layout and this script is running.
It will update the date to `$(date)`, this is a clock in our bar!