mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-23 18:45:39 +02:00
Merge branch 'master' into master
This commit is contained in:
commit
47bc23c8f1
69 changed files with 2623 additions and 526 deletions
|
@ -1,7 +1,7 @@
|
|||
sh = find_program('sh', native: true)
|
||||
|
||||
scdoc = dependency('scdoc', native: true)
|
||||
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
|
||||
scdoc_prog = find_program(scdoc.get_variable('scdoc'), native: true)
|
||||
|
||||
foreach man_src : ['yambar.1.scd', 'yambar.5.scd', 'yambar-decorations.5.scd',
|
||||
'yambar-modules-alsa.5.scd', 'yambar-modules-backlight.5.scd',
|
||||
|
@ -13,6 +13,8 @@ foreach man_src : ['yambar.1.scd', 'yambar.5.scd', 'yambar-decorations.5.scd',
|
|||
'yambar-modules-script.5.scd', 'yambar-modules-sway-xkb.5.scd',
|
||||
'yambar-modules-sway.5.scd', 'yambar-modules-xkb.5.scd',
|
||||
'yambar-modules-xwindow.5.scd', 'yambar-modules.5.scd',
|
||||
'yambar-modules-cpu.5.scd',
|
||||
'yambar-modules-mem.5.scd',
|
||||
'yambar-particles.5.scd', 'yambar-tags.5.scd']
|
||||
parts = man_src.split('.')
|
||||
name = parts[-3]
|
||||
|
@ -23,7 +25,7 @@ foreach man_src : ['yambar.1.scd', 'yambar.5.scd', 'yambar-decorations.5.scd',
|
|||
out,
|
||||
output: out,
|
||||
input: man_src,
|
||||
command: [sh, '-c', '@0@ < @INPUT@'.format(scdoc_prog.path())],
|
||||
command: [sh, '-c', '@0@ < @INPUT@'.format(scdoc_prog.full_path())],
|
||||
capture: true,
|
||||
install: true,
|
||||
install_dir: join_paths(get_option('mandir'), 'man@0@'.format(section)))
|
||||
|
|
|
@ -70,6 +70,71 @@ content:
|
|||
color: ff0000ff
|
||||
```
|
||||
|
||||
|
||||
# OVERLINE
|
||||
|
||||
Similar to _underline_, this decoration renders a line of configurable
|
||||
size and color at the top of the particle.
|
||||
|
||||
## CONFIGURATION
|
||||
|
||||
[[ *Name*
|
||||
:[ *Type*
|
||||
:[ *Req*
|
||||
:[ *Description*
|
||||
| size
|
||||
: int
|
||||
: yes
|
||||
: The size (height/thickness) of the line, in pixels
|
||||
| color
|
||||
: color
|
||||
: yes
|
||||
: The color of the line. See *yambar*(5) for format.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
```
|
||||
content:
|
||||
string:
|
||||
deco:
|
||||
overline:
|
||||
size: 2
|
||||
color: ff0000ff
|
||||
```
|
||||
|
||||
|
||||
# BORDER
|
||||
|
||||
This decoration renders a border of configurable size (i.e border
|
||||
width) around the particle.
|
||||
|
||||
## CONFIGURATION
|
||||
|
||||
[[ *Name*
|
||||
:[ *Type*
|
||||
:[ *Req*
|
||||
:[ *Description*
|
||||
| color
|
||||
: color
|
||||
: yes
|
||||
: The color of the line. See *yambar*(5) for format.
|
||||
| size
|
||||
: int
|
||||
: no
|
||||
: Border width, in pixels. Defaults to 1px.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
```
|
||||
content:
|
||||
string:
|
||||
deco:
|
||||
border:
|
||||
size: 2
|
||||
color: ff0000ff
|
||||
```
|
||||
|
||||
|
||||
# STACK
|
||||
|
||||
This particles combines multiple decorations.
|
||||
|
|
|
@ -8,6 +8,17 @@ battery - This module reads battery status
|
|||
This module reads battery status from _/sys/class/power_supply_ and
|
||||
uses *udev* to monitor for changes.
|
||||
|
||||
Note that it is common (and "normal") for batteries to be in the state
|
||||
*unknown* under certain conditions.
|
||||
|
||||
For example, some have been seen to enter the *unknown* state when
|
||||
charging and the capacity reaches ~90%. The battery then stays in
|
||||
*unknown*, rather than *charging*, until it has been fully charged and
|
||||
enters the state *full*.
|
||||
|
||||
This does not happen with all batteries, and other batteries may enter
|
||||
the state *unknown* under other conditions.
|
||||
|
||||
# TAGS
|
||||
|
||||
[[ *Name*
|
||||
|
|
42
doc/yambar-modules-cpu.5.scd
Normal file
42
doc/yambar-modules-cpu.5.scd
Normal file
|
@ -0,0 +1,42 @@
|
|||
yambar-modules-cpu(5)
|
||||
|
||||
# NAME
|
||||
cpu - This module provides the CPU usage
|
||||
|
||||
# TAGS
|
||||
|
||||
[[ *Name*
|
||||
:[ *Type*
|
||||
:[ *Description*
|
||||
| cpu
|
||||
: range
|
||||
: Current usage of the whole CPU in percent
|
||||
| cpu<0..X>
|
||||
: range
|
||||
: Current usage of CPU core X in percent
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
[[ *Name*
|
||||
:[ *Type*
|
||||
:[ *Req*
|
||||
:[ *Description*
|
||||
| interval
|
||||
: int
|
||||
: no
|
||||
: Refresh interval of the CPU usage stats in ms (default=500). Cannot be less then 500 ms
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
bar:
|
||||
left:
|
||||
- cpu:
|
||||
interval: 2500
|
||||
content:
|
||||
string: {text: "{cpu1}%"}
|
||||
```
|
||||
|
||||
# SEE ALSO
|
||||
|
||||
*yambar-modules*(5), *yambar-particles*(5), *yambar-tags*(5), *yambar-decorations*(5)
|
|
@ -67,10 +67,9 @@ bar:
|
|||
- foreign-toplevel:
|
||||
content:
|
||||
map:
|
||||
tag: activated
|
||||
values:
|
||||
false: {empty: {}}
|
||||
true:
|
||||
conditions:
|
||||
~activated: {empty: {}}
|
||||
activated:
|
||||
- string: {text: "{app-id}: {title}"}
|
||||
```
|
||||
|
||||
|
|
|
@ -35,6 +35,9 @@ with the _application_ and _title_ tags to replace the X11-only
|
|||
| urgent
|
||||
: bool
|
||||
: True if the workspace has the urgent flag set
|
||||
| empty
|
||||
: bool
|
||||
: True if the workspace is empty (Sway only)
|
||||
| state
|
||||
: string
|
||||
: One of *urgent*, *focused*, *unfocused* or *invisible* (note:
|
||||
|
@ -65,6 +68,10 @@ with the _application_ and _title_ tags to replace the X11-only
|
|||
: enum
|
||||
: no
|
||||
: How to sort the list of workspaces; one of _none_, _ascending_ or _descending_, defaults to _none_.
|
||||
| strip-workspace-numbers
|
||||
: bool
|
||||
: no
|
||||
: If true, *N:* prefixes will be stripped from workspace names. Useful together with *sort*, to have the workspace order fixed.
|
||||
| persistent
|
||||
: list of strings
|
||||
: no
|
||||
|
@ -95,10 +102,9 @@ bar:
|
|||
content:
|
||||
"":
|
||||
map:
|
||||
tag: state
|
||||
default: {string: {text: "{name}"}}
|
||||
values:
|
||||
focused: {string: {text: "{name}*"}}
|
||||
conditions:
|
||||
state == focused: {string: {text: "{name}*"}}
|
||||
current: { string: {text: "{application}: {title}"}}
|
||||
```
|
||||
|
||||
|
|
51
doc/yambar-modules-mem.5.scd
Normal file
51
doc/yambar-modules-mem.5.scd
Normal file
|
@ -0,0 +1,51 @@
|
|||
yambar-modules-mem(5)
|
||||
|
||||
# NAME
|
||||
mem - This module provides the memory usage
|
||||
|
||||
# TAGS
|
||||
|
||||
[[ *Name*
|
||||
:[ *Type*
|
||||
:[ *Description*
|
||||
| free
|
||||
: int
|
||||
: Free memory in bytes
|
||||
| used
|
||||
: int
|
||||
: Used memory in bytes
|
||||
| total
|
||||
: int
|
||||
: Total memory in bytes
|
||||
| percent_free
|
||||
: range
|
||||
: Free memory in percent
|
||||
| percent_used
|
||||
: range
|
||||
: Used memory in percent
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
[[ *Name*
|
||||
:[ *Type*
|
||||
:[ *Req*
|
||||
:[ *Description*
|
||||
| interval
|
||||
: string
|
||||
: no
|
||||
: Refresh interval of the memory usage stats in ms (default=500). Cannot be less then 500 ms
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
bar:
|
||||
left:
|
||||
- mem:
|
||||
interval: 2500
|
||||
content:
|
||||
string: {text: "{used:mb}MB"}
|
||||
```
|
||||
|
||||
# SEE ALSO
|
||||
|
||||
*yambar-modules*(5), *yambar-particles*(5), *yambar-tags*(5), *yambar-decorations*(5)
|
|
@ -22,6 +22,10 @@ instantiates the provided _content_ particle for each detected drive.
|
|||
| optical
|
||||
: bool
|
||||
: True if the drive is an optical drive (CD-ROM, DVD-ROM etc)
|
||||
| audio
|
||||
: bool
|
||||
: True if an optical drive has an audio CD inserted (i.e. this
|
||||
property is always false for non-optical drives).
|
||||
| device
|
||||
: string
|
||||
: Volume device name (typically */dev/sd?*)
|
||||
|
@ -70,13 +74,12 @@ bar:
|
|||
- removables:
|
||||
content:
|
||||
map:
|
||||
tag: mounted
|
||||
values:
|
||||
false:
|
||||
conditions:
|
||||
~mounted:
|
||||
string:
|
||||
on-click: udisksctl mount -b {device}
|
||||
text: "{label}"
|
||||
true:
|
||||
mounted:
|
||||
string:
|
||||
on-click: udisksctl unmount -b {device}
|
||||
text: "{label}"
|
||||
|
|
|
@ -79,10 +79,9 @@ bar:
|
|||
title: {string: { text: "{seat} - {title}" }}
|
||||
content:
|
||||
map:
|
||||
tag: occupied
|
||||
values:
|
||||
false: {empty: {}}
|
||||
true:
|
||||
conditions:
|
||||
~occupied: {empty: {}}
|
||||
occupied:
|
||||
string:
|
||||
margin: 5
|
||||
text: "{id}: {state}"
|
||||
|
|
|
@ -77,6 +77,7 @@ User defined.
|
|||
: Arguments to pass to the script/binary.
|
||||
| poll-interval
|
||||
: integer
|
||||
: no
|
||||
: Number of seconds between each script run. If unset, continuous mode
|
||||
is used.
|
||||
|
||||
|
@ -132,10 +133,9 @@ bar:
|
|||
title|string|{{title}}
|
||||
content:
|
||||
map:
|
||||
tag: status
|
||||
values:
|
||||
Paused: {empty: {}}
|
||||
Playing:
|
||||
conditions:
|
||||
status == Paused: {empty: {}}
|
||||
status == Playing:
|
||||
content: {string: {text: "{artist} - {title}"}}
|
||||
```
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ instantiated from this template, and represents an input device.
|
|||
| identifiers
|
||||
: list of strings
|
||||
: yes
|
||||
: Identifiers of input devices to monitor. Use _swaymsg -t get_inputs | grep 'identifier.*keyboard' | cut -d'"' -f4_ to see available devices.
|
||||
: Identifiers of input devices to monitor. Use _swaymsg -t get_inputs | grep 'identifier.\*keyboard' | cut -d'"' -f4_ to see available devices.
|
||||
| content
|
||||
: particle
|
||||
: yes
|
||||
|
|
|
@ -68,20 +68,17 @@ in red.
|
|||
```
|
||||
content:
|
||||
map:
|
||||
tag: carrier
|
||||
values:
|
||||
false: {empty: {}}
|
||||
true:
|
||||
conditions:
|
||||
~carrier: {empty: {}}
|
||||
carrier:
|
||||
map:
|
||||
tag: state
|
||||
default: {string: {text: , font: *awesome, foreground: ffffff66}}
|
||||
values:
|
||||
up:
|
||||
conditions:
|
||||
state == up:
|
||||
map:
|
||||
tag: ipv4
|
||||
default: {string: {text: , font: *awesome}}
|
||||
values:
|
||||
"": {string: {text: , font: *awesome, foreground: ffffff66}}
|
||||
conditions:
|
||||
ipv4 == "": {string: {text: , font: *awesome, foreground: ffffff66}}
|
||||
```
|
||||
|
||||
## Use yaml anchors
|
||||
|
|
|
@ -31,20 +31,67 @@ following attributes are supported by all particles:
|
|||
: Font to use. Note that this is an inherited attribute; i.e. you can
|
||||
set it on e.g. a _list_ particle, and it will apply to all
|
||||
particles in the list.
|
||||
| font-shaping
|
||||
: enum
|
||||
: no
|
||||
: font-shaping; one of _full_ or _none_. When set to _full_ (the
|
||||
default), strings will be "shaped" using HarfBuzz. Requires support
|
||||
in fcft.
|
||||
| foreground
|
||||
: color
|
||||
: no
|
||||
: Foreground (text) color. Just like _font_, this is an inherited attribute.
|
||||
| on-click
|
||||
: associative array/string
|
||||
: no
|
||||
: When set to a string, executes the string as a command when the particle
|
||||
is left-clicked. Tags can be used. Note that the string is *not*
|
||||
executed in a shell. The same applies to all attributes associated with
|
||||
it, below.
|
||||
| on-click.left
|
||||
: string
|
||||
: no
|
||||
: Command to execute when the particle is clicked. Tags can be
|
||||
used. Note that the string is *not* executed in a shell.
|
||||
: Command to execute when the particle is left-clicked.
|
||||
| on-click.right
|
||||
: string
|
||||
: no
|
||||
: Command to execute when the particle is right-clicked.
|
||||
| on-click.middle
|
||||
: string
|
||||
: no
|
||||
: Command to execute when the particle is middle-clicked.
|
||||
| on-click.wheel-up
|
||||
: string
|
||||
: no
|
||||
: Command to execute every time a 'wheel-up' event is triggered.
|
||||
| on-click.wheel-down
|
||||
: string
|
||||
: no
|
||||
: Command to execute every time a 'wheel-down' event is triggered.
|
||||
| deco
|
||||
: decoration
|
||||
: no
|
||||
: Decoration to apply to the particle. See *yambar-decorations*(5)
|
||||
|
||||
## EXAMPLES:
|
||||
|
||||
*on-click* as a string (handles left click):
|
||||
```
|
||||
content:
|
||||
<particle>:
|
||||
on-click: command args
|
||||
```
|
||||
|
||||
*on-click* as an associative array (handles other buttons):
|
||||
```
|
||||
content:
|
||||
<particle>:
|
||||
on-click:
|
||||
left: command-1
|
||||
wheel-up: command-3
|
||||
wheel-down: command-4
|
||||
```
|
||||
|
||||
# STRING
|
||||
|
||||
This is the most basic particle. It takes a format string, consisting
|
||||
|
@ -161,48 +208,102 @@ content:
|
|||
# MAP
|
||||
|
||||
This particle maps the values of a specific tag to different
|
||||
particles. In addition to explicit tag values, you can also specify a
|
||||
particles based on conditions. A condition takes either the form of:
|
||||
|
||||
<tag> <operation> <value>
|
||||
|
||||
Or, for boolean tags:
|
||||
|
||||
<tag>
|
||||
|
||||
Where <tag> is the tag you would like to map, <operation> is one of:
|
||||
|
||||
[- ==
|
||||
:- !=
|
||||
:- >=
|
||||
:- >
|
||||
:- <=
|
||||
:- <
|
||||
|
||||
and <value> is the value you would like to compare it to.
|
||||
|
||||
For boolean tags, negation is done with a preceding '~':
|
||||
|
||||
~<tag>
|
||||
|
||||
To match for empty strings, use ' "" ':
|
||||
|
||||
<tag> == ""
|
||||
|
||||
In addition to explicit tag values, you can also specify a
|
||||
default/fallback particle.
|
||||
|
||||
Note that conditions are evaluated in the order they appear. *If
|
||||
multiple conditions are true, the first one will be used*. This means
|
||||
that in a configuration such as:
|
||||
|
||||
```
|
||||
tx-bitrate > 1000:
|
||||
tx-bitrate > 1000000:
|
||||
```
|
||||
|
||||
the second condition would never run, since whenever the second
|
||||
condition is true, the first is also true. The correct way of doing
|
||||
this would be to invert the order of the conditions:
|
||||
|
||||
```
|
||||
tx-bitrate > 1000000:
|
||||
tx-bitrate > 1000:
|
||||
```
|
||||
|
||||
|
||||
## CONFIGURATION
|
||||
|
||||
[[ *Name*
|
||||
:[ *Type*
|
||||
:[ *Req*
|
||||
:[ *Description*
|
||||
| tag
|
||||
: string
|
||||
: yes
|
||||
: The tag (name of) which values should be mapped
|
||||
| values
|
||||
| conditions
|
||||
: associative array
|
||||
: yes
|
||||
: An associative array of tag values mapped to particles
|
||||
: An associative array of conditions (see above) mapped to particles
|
||||
| default
|
||||
: particle
|
||||
: no
|
||||
: Default particle to use, when tag's value does not match any of the
|
||||
mapped values.
|
||||
: Default particle to use, none of the conditions are true
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
```
|
||||
content:
|
||||
map:
|
||||
tag: tag_name
|
||||
default:
|
||||
string:
|
||||
text: this is the default particle; the tag's value is now {tag_name}
|
||||
values:
|
||||
one_value:
|
||||
conditions:
|
||||
tag == one_value:
|
||||
string:
|
||||
text: tag's value is now one_value
|
||||
another_value:
|
||||
tag == another_value:
|
||||
string:
|
||||
text: tag's value is now another_value
|
||||
|
||||
```
|
||||
|
||||
For a boolean tag:
|
||||
|
||||
```
|
||||
content:
|
||||
map:
|
||||
conditions:
|
||||
tag:
|
||||
string:
|
||||
text: tag is true
|
||||
~tag:
|
||||
string:
|
||||
text: tag is false
|
||||
```
|
||||
|
||||
# RAMP
|
||||
|
||||
This particle uses a range tag to index into an array of
|
||||
|
|
|
@ -12,7 +12,8 @@ and reference them using anchors.
|
|||
Besides the normal yaml types, there are a couple of yambar specific
|
||||
types that are frequently used:
|
||||
|
||||
- *font*: this is a string in _fontconfig_ format. Example of valid values:
|
||||
- *font*: this is a comma separated list of fonts in _fontconfig_
|
||||
format. Example of valid values:
|
||||
- Font Awesome 5 Brands
|
||||
- Font Awesome 5 Free:style=solid
|
||||
- Dina:pixelsize=10:slant=italic
|
||||
|
@ -124,7 +125,17 @@ types that are frequently used:
|
|||
| font
|
||||
: font
|
||||
: no
|
||||
: Default font to use in modules and particles
|
||||
: Default font to use in modules and particles. May also be a comma
|
||||
separated list of several fonts, in which case the first font is
|
||||
the primary font, and the rest fallback fonts. These are yambar
|
||||
custom fallback fonts that will be searched before the fontconfig
|
||||
provided fallback list.
|
||||
| font-shaping
|
||||
: enum
|
||||
: no
|
||||
: Default setting for font-shaping, for use in particles. One of
|
||||
_full_ or _none_. When set to _full_ (the default), strings will be
|
||||
"shaped" using HarfBuzz. Requires support in fcft.
|
||||
| foreground
|
||||
: color
|
||||
: no
|
||||
|
@ -161,8 +172,8 @@ bar:
|
|||
|
||||
right:
|
||||
- clock:
|
||||
content:
|
||||
- string: {text: "{time}"}
|
||||
content:
|
||||
- string: {text: "{time}"}
|
||||
```
|
||||
|
||||
# FILES
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue