BAR(1)BAR(1)
NAME
bar – display a bar
SYNOPSIS
bar
[
-b
]
[
-d dateformat
]
[
-p position
]
[
-s separator
]
DESCRIPTION
bar
displays a small window with current battery charge, date and time.
Additional data may be displayed by writing lines of text to its
standard input. Data items should be separated between each other
with a chosen separator character with spaces on both sides of it.
The default separator is
│
(Unicode codepoint 0x2502).
Bar
reacts to mouse clicks by writing the "clicked" portion of the text
(enclosed by the separator) to standard output. This can be used to
perform additional actions by a custom script. See
Examples
section.
By default,
bar
is placed at the bottom right corner of the screen. This can be
changed by specifying option
-p
with first letters of the required placement:
l
for "left",
r
for "right",
t
for "top" and
b
for "bottom". If neither left nor right is chosen, the window will be
placed in either top or bottom center.
Bar
keeps itself as a top window. To make it stay at the bottom, use
-b .
Separator can be changed with
-s
option.
Date and time format may be set using
-d
option, see
tmdate(2).
EXAMPLES
An example of how
bar
can be used along with
riow
to control
zuke
playback via mouse clicks:
#!/bin/rc
rfork ne
fn mybar {
sed -u 's/$/ │ ⏮ │ ⏯ │ ⏭/g' \\
| bar \\
| awk -v 'c=plumb -d audio ''key ' '
/⏮/{system(c"<''")}
/⏯/{system(c"p''")}
/⏭/{system(c">''")}
' >[2]/dev/null
}
riow </dev/kbdtap >/dev/kbdtap |[3] mybar
The script is used instead of executing
bar
directly.
SOURCE
/sys/src/cmd/bar.c
SEE
riow(1)
HISTORY
Bar first appeared in 9front (September, 2022).
BUGS
Impossible.