Commit graph

171 commits

Author SHA1 Message Date
Ogromny
19a9f099e2 modules/pipewire: new module 2022-12-13 10:16:58 +01:00
Willem van de Krol
dcf21f0b06 modules: add pulse
The pulse module shows information about PulseAudio sinks and sources.
2022-12-12 18:51:28 +01:00
Leonardo Gibrowski Faé
4a41d4296a
Implement '&&' and '||' operators on map
'-' is a valid character for tags.

Commit 03e1c7d (module/network: Add link stats, 2022-04-30) introduced
two new tags for the network module: `ul-speed` and `dl-speed`. These
use the `-` character, that was previously never used in any tag.

We had two options: either change those tags to use `_` instead, or just
accept `-`s as a valid character. Going forward, I can see many people
deciding to name their tags with `-` instead of `_`, so I believe it is
better to just accept it once and for all.

Note that `-` cannot be used as the first character of a tag (e.g.
`-tag1`) since the `-` has a special meaning in `.yml` files. I don't
believe this will happen often, however, and should be easy to both
detect and correct if it does.
2022-12-10 22:53:30 -03:00
Leonardo Gibrowski Faé
87854fa101
float tag: let user specify number of decimals
Closes #200
2022-12-09 15:24:59 +01:00
Peter Rice
6ed576c719
particle/on-click: support next/previous buttons 2022-10-04 21:14:29 +02:00
Midgard
d1a8029e6c
module/mpd: add “file” tag 2022-09-03 12:12:11 +02:00
Midgard
aa09d88d8e
doc: string particle’s “max” uses Unicode … now
And fix a typo in the yambar-particles file.
2022-09-01 12:18:49 +02:00
Daniel Eklöf
6c10eb2153
module/alsa: use channel’s dB range instead of raw volume, if available
For channels that have a defined dB range, use that instead of the raw
volume range when calculating the volume percent.

Also use the same logic as alsamixer when calculating the percent from
the dB values: assume a linear scale if the dB range is “small
enough”, and otherwise normalize it against a logarithmic scale.

With this, yambar’s “percent” value matches alsamixer’s exactly.

The ‘volume’ tag remains unchanged - it always reflects the raw volume
values.

Instead, we add a new tag ‘dB’, that reflects the dB values.

Closes #202
2022-06-21 19:49:06 +02:00
Leonardo Gibrowski Faé
a0c07d7836
modules: creates disk-io-module
This creates the disk-io-module, which displays io information read from
`/proc/diskstats`. Details on `diskstats` can be found on:
https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
2022-06-17 12:04:13 -03:00
Johannes
03e1c7dc13 module/network: Add link stats
Exports two new tags from network module, `ul-speed` and `dl-speed`.
Because these work through polling, poll-interval must be set.
Otherwise, these two tags always will be 0.
2022-06-06 15:11:24 +02:00
Daniel Eklöf
ca077447c2
module/network: tx/rx-bitrate is now in bits/s instead of Mb/s 2022-06-02 22:25:53 +02:00
Daniel Eklöf
d9d5671e04
doc: tags: fix divisors for kb/mb/gb and kib/mib/gib
They were inversed: kb/mb/gb uses 1000^n, while kib/mib/gib uses
1024^n.
2022-06-02 22:21:09 +02:00
Daniel Eklöf
c738f1c63d
module/river: add support for the ‘mode’ event
Seat status v3 adds a new ‘mode’ event, that informs us of the current
mode (as set by e.g. ‘riverctl enter-mode passthrough’)

The mode is exposed as a tag (named “mode”) on river’s “title”
particle:

  - river:
      title:
        map:
          default: {empty: {}}
          conditions:
            mode == passthrough:
              string: {text: " {mode} ", deco: {background: {color: ff0000ff}}}
2022-06-02 17:24:42 +02:00
Leonardo Gibrowski Faé
3b5845370c doc: explain that order in map conditions matter 2022-04-24 15:47:53 -03:00
Leonardo Gibrowski Faé
0d878e8b5c Trimming outer '"' when parsing the values. 2022-04-23 17:13:24 -03:00
Leonardo Gibrowski Faé
4c4a20d835 Updated docs to comply with new map syntax 2022-04-23 17:13:24 -03:00
Leonardo Gibrowski Faé
2b103b7acd Implement conditions on tag
A condition is formed by:
    <tag> <op> <value>

<tag> is the normal yambar tag. <op> is one of '==', '!=', '<', '<=', '>', or
'>='. <value> is what you wish to compare it to.

'boolean' tags must be used directly. They falsehood is matched with '~':

    <tag>
    ~<tag>

Finally, to match an empty string, one must use ' "" ':
    <tag> <op> ""
2022-04-23 17:13:24 -03:00
Daniel Eklöf
4daa3d9904
meson: stop using deprecated functions, require meson >= 0.58
* get_pkgconfig_variable() -> get_variable()
* prog.path() -> prog.full_path()
* meson.build_root() -> meson.global_build_root()
2022-02-27 11:32:46 +01:00
Daniel Eklöf
ffccabbb13
config: add inheritable option “font-shaping”
This patch adds an inheritable option, “font-shaping”, that controls
whether a particle that renders text should enable font-shaping or
not.

The option works similar to the ‘font’ option: one can set it at the
top-level, and it gets inherited down through all modules and to their
particles.

Or, you can set it on a module and it gets inherited to all its
particles, but not to other modules’ particles.

Finally, you can set it on individual particles, in which case it only
applies to them (or “child” particles).

When font-shaping is enabled (the default), the string particle shapes
full text runs using the fcft_rasterize_text_run_utf32() API. In fcft,
this results in HarfBuzz being used to shape the string.

When disabled, the string particle instead uses the simpler
fcft_rasterize_char_utf32() API, which rasterizes individual
characters.

This gives user greater control over the font rendering. One example
is bitmap fonts, which HarfBuzz often doesn’t get right.

Closes #159
2022-02-23 18:43:13 +01:00
Daniel Eklöf
c44970717b
module/i3: workspace::focus is apparently Sway only
On i3, users are currently greeted with:

  err: modules/i3.c:94: workspace reply/event without 'name' and/or
       'output', and/or 'focus' properties

This patch makes ‘focus’ an optional attribute. When missing, we
assume a node-count of 0, which means the workspace’s ‘empty’ tag will
always be true. Document this in the i3 man page.
2022-02-15 21:14:08 +01:00
Daniel Eklöf
a2cf05a64d
module/i3: add ‘strip-workspace-numbers’ option
This is a boolean option. When set, “N:” prefixes will be stripped
from the workspaces’ name tag, *after* having been sorted (if the
‘sort’ option is being used).

This makes it useful to arrange the workspaces in a fixed order, by
prefixing the names with a number in the Sway config:

  set $ws1 “1:xyz”
  set $ws2 “2:abc”

Then, in the yambar config:

  i3:
    sort: ascending
    strip-workspace-numbers: true
2022-02-11 21:44:43 +01:00
Daniel Eklöf
605490c872
overline: new decoration
Similar to the ‘underline’ decoration
2022-02-10 20:49:09 +01:00
Daniel Eklöf
6ac046dec3
config: implement font fallback
Fonts in the configuration may now be a comma separated list of
fonts (all using the fontconfig format). The first font is the primary
font, and the rest are fallback fonts that will be searched, in order.
2022-02-10 18:34:15 +01:00
Daniel Eklöf
52e2540d42
doc: yambar-modules-removables: add ‘audio’ tag 2021-12-26 12:25:00 +01:00
Alexandre Acebedo
ae5c7e0fc3 modules: add cpu module 2021-12-21 18:44:36 +01:00
Alexandre Acebedo
337ce7681f modules: add mem module 2021-12-21 18:44:14 +01:00
Daniel Eklöf
0af9ce354b
Merge branch 'document-on-click-advanced-syntax'
Closes #138
2021-12-20 19:52:41 +01:00
horus645
f7206ef08d Added documentation for discriminated on-click events 2021-12-20 14:03:19 -03:00
Daniel Eklöf
8475ca1603
doc: i3: document the new ‘empty’ tag 2021-12-19 17:54:41 +01:00
Catterwocky
b562f1310b Fix yaml indentation in docs
It is unfortunate that the first example given by the manpage is not working.
2021-12-04 17:49:39 +01:00
Daniel Eklöf
11bb45aa87
doc: script: add missing column in options table 2021-11-15 18:15:52 +01:00
Daniel Eklöf
58038a4236
doc: battery: some batteries enter "unknown" under normal operation 2021-10-31 21:07:09 +01:00
Daniel Eklöf
134141b7c5
doc: decorations: document the new ‘border’ decoration 2021-10-24 18:22:21 +02:00
Daniel Eklöf
76225a8366
doc: particles: line wrap 2021-09-20 19:30:37 +02:00
Vincent Fischer
535d49e9c3 allow ramp particles to overwrite min and max 2021-09-20 19:08:18 +02:00
Stanislav Ochotnický
13b5934e65 Add MPRIS example in script module documentation 2021-09-16 19:27:10 +02:00
anb
ba5b28f437 clock: add a config option to show UTC time 2021-09-12 11:19:53 -07:00
Daniel Eklöf
eff890ab9d
tag: add kib/mib/gib formatters 2021-09-01 19:12:29 +02:00
Daniel Eklöf
8c2e5d8bde
doc: yambar-tags: add missing last column to kb/mb formatters 2021-09-01 19:12:29 +02:00
Daniel Eklöf
f0b16033fe
doc: yambar-tags: codespell: mininum -> minimum 2021-09-01 19:12:28 +02:00
Daniel Eklöf
a6194c63e6
tag: add kb/mb/gb formatters 2021-09-01 19:12:27 +02:00
Daniel Eklöf
e201cc3d30
tag: add a ‘%’ formatter
Range tags can now be rendered as a percentage value, by using a ‘%’
formatter:

  {tag_name:%}
2021-09-01 19:12:16 +02:00
Daniel Eklöf
dabb2e1407
module/network: add support for periodically polling Wi-Fi stats
This adds a new ‘poll-interval’ option to the network module. When set
to a non-zero value, the following Wi-Fi stats will be updated:

* Signal strength
* RX+TX bitrate
2021-09-01 19:10:23 +02:00
Daniel Eklöf
01ee028c4d
doc: network: document ssid, signal, rx-bitrate and tx-bitrate 2021-09-01 19:10:22 +02:00
Daniel Eklöf
103c3102a9
module/river: rename the ‘per-output’ option to ‘all-monitors’
This also inverts its meaning.
2021-08-25 18:47:33 +02:00
Daniel Eklöf
589a6f528a
module/foreign-toplevel: track outputs each toplevel is mapped on
* Bind the foreign-toplevel-manager object *after* the first round of
  global objects. This ensures we bind all pre-existing wl-output
  objects before binding the toplevel manager. This is important, since
  otherwise we wont get any output_enter() events for the initial set of
  toplevels.

* Bind xdg-output-manager, to be able to bind xdg-output objects for
  each wl-output.

* Add xdg-output-listener to each wl/xdg-output, to be able to get the
  outputs’ names.

* Add a list of outputs to each toplevel. The output_enter() event
  adds to this list, and output_leave() removes from it.

* Add option ‘all-monitors’. When not set (the default), toplevels are
  only included in the generated content if they are mapped on the same
  output as the bar itself. When *not* set, all toplevels are always
  included in the generated content.
2021-08-25 18:46:19 +02:00
Daniel Eklöf
fe6cc43ad8
doc: river: provide -> provides 2021-08-25 18:46:19 +02:00
Daniel Eklöf
2173e0dc4d
doc: add man page for the new foreign-toplevel module 2021-08-25 18:46:19 +02:00
Nulo
eb94c8cceb
Add layer option
Only applies to Wayland and the default is still bottom.
2021-08-25 18:42:46 +02:00
Daniel Eklöf
db12ceb026
module/alsa: volume/muted: default to “unset”; use first available channel 2021-08-20 21:41:21 +02:00