~ft/bar

bar/bar.man -rw-r--r-- 1.5 KiB
46d9e65bSigrid Solveig Haflínudóttir mkfile: clean up 4 months ago
                                                                                
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.TH BAR 1
.SH NAME
bar \- display a bar
.SH SYNOPSIS
.B bar
[
.I -b
]
[
.I -d dateformat
]
[
.I -p position
]
[
.I -s separator
]
.SH DESCRIPTION
.I 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.
.PP
.I 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
.I Examples
section.
.PP
By default,
.I bar
is placed at the bottom right corner of the screen.  This can be
changed by speicifying option
.I -p
with first letters of the required placement:
.I l
for "left",
.I r
for "right",
.I t
for "top" and
.I b
for "bottom".  If neither left nor right is chosen, the window will be
placed in either top or bottom center.
.PP
.I Bar
keeps itself as a top window. To make it stay at the bottom, use
.I -b .
.PP
Separator can be changed with
.I -s
option.
.PP
Date and time format may be set using
.I -d
option, see
.I tmdate(2).
.SH EXAMPLES
An example of how
.I bar
can be used along with
.I riow
to control
.I zuke
playback via mouse clicks:
.PP
.EX
#!/bin/rc
rfork ne
fn bar {
	sed -u 's/$/ │ ⏮ │ ⏯ │ ⏭/g' \\
	| /bin/bar \\
	| awk -v 'c=plumb -d audio ''key ' '
		/⏮/{system(c"<''")}
		/⏯/{system(c"p''")}
		/⏭/{system(c">''")}
		' >[2]/dev/null
}
/bin/riow
.EE
.PP
The script is used instead of executing
.I riow
directly.
.SH SOURCE
https://git.sr.ht/~ft/bar
.SH BUGS
Impossible.