Commit graph

52 commits

Author SHA1 Message Date
Daniel Eklöf
ede6a541e1
modules: meson: add missing ‘m’ (math) dependency
The following modules used functions from the ‘m’ (math)
library (e.g. round()), but didn’t explicitly link against it. This
caused build failures when no other plugin that _did_ link against ‘m’
was enabled.

* cpu
* mem
* pulse
* pipewire
* foreign-toplevel

Closes #239
2022-12-17 18:26:25 +01:00
Daniel Eklöf
b195bc4dcb
module/cpu: make ‘content’ particle a template
Before this patch, the cpu module instantiated a single particle (the
‘content’ particle), with one tag ("cpu") representing the total CPU
usage, and then one tag (cpuN) for each core.

This makes it cumbersome to configure, since you need to explicitly
reference each cpuN tag to get per-core usage.

This patch rewrites this, so that ‘content’ is now a template. It’s
instantiated once to represent the total CPU usage, and then once for
each core.

Each instance has a "cpu" tag, representing the CPU usage of that
core (or total usage). It also has an "id" tag. The ID is 0..n for
actual cores, and -1 for total usage.

This means you can do something like this in your config:

- cpu:
    content:
      map:
        conditions:
          id < 0: {string: {text: "Total: {cpu}%"}}
          id >= 0: {string: {text: "Core #{id}: {cpu}%"}}

Closes #207
2022-12-14 12:06:00 +01:00
Daniel Eklöf
95b1f5f261
modules: meson: regression: it’s ‘libudev’, not ‘udev’ 2022-12-14 11:01:05 +01:00
Daniel Eklöf
9ef6d73663
meson: make ‘foreign-toplevel’ plugin compile time optional 2022-12-14 10:08:48 +01:00
Daniel Eklöf
56b0047004
meson: make ‘river’ plugin compile time optional 2022-12-14 10:05:23 +01:00
Daniel Eklöf
1a81255579
meson: make ‘xwindow’ plugin compile time optional 2022-12-14 10:02:13 +01:00
Daniel Eklöf
a14d38b0cb
meson: make ‘xkb’ plugin compile time optional 2022-12-14 09:58:45 +01:00
Daniel Eklöf
b6450446a8
meson: make ‘sway-xkb’ plugin compile time optional 2022-12-14 09:53:24 +01:00
Daniel Eklöf
0cf0d64970
meson: pipewire-specific ‘json’ dependency 2022-12-14 09:50:22 +01:00
Daniel Eklöf
ec9ed66b6b
meson: make ‘script’ plugin compile time optional 2022-12-14 09:48:50 +01:00
Daniel Eklöf
eb26f64ea7
meson: make ‘removables’ plugin compile time optional 2022-12-14 09:46:08 +01:00
Daniel Eklöf
b901ac50ee
meson: make ‘network’ plugin compile time optional 2022-12-14 09:43:14 +01:00
Daniel Eklöf
8d5e8b5f20
meson: make ‘label’ plugin compile time optional 2022-12-14 09:41:44 +01:00
Daniel Eklöf
f54f583be1
meson: make ‘i3’ plugin compile time optional 2022-12-14 09:39:47 +01:00
Daniel Eklöf
85d55905f9
meson: make ‘mem’ plugin compile time optional 2022-12-14 09:36:48 +01:00
Daniel Eklöf
659b282445
meson: make ‘disk-io’ plugin compile time optional 2022-12-14 09:36:45 +01:00
Daniel Eklöf
b23365ccac
meson: make ‘cpu’ plugin compile time optional 2022-12-14 09:32:04 +01:00
Daniel Eklöf
25e123fbe6
meson: make ‘clock’ plugin compile time optional 2022-12-14 09:32:04 +01:00
Daniel Eklöf
aeef3eca0e
meson: make ‘battery’ plugin compile time optional 2022-12-14 09:32:04 +01:00
Daniel Eklöf
881359183f
meson: make ‘backlight’ plugin compile time optional 2022-12-13 16:47:48 +01:00
Daniel Eklöf
4c1398f1a5
meson: make ‘alsa’ plugin compile time optional 2022-12-13 16:41:50 +01:00
Ogromny
f5cfc103d0
modules/dwl: new module 2022-12-13 15:56:16 +01:00
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
Baptiste Daroussin
b331473a6b
meson: add missing dependencies on wayland_client 2022-07-02 23:21:38 +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
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
Stanislav Ochotnický
e723b039ad Make libmpdclient an optional dependency
Without this change yambar can't be installed/used without libmpdclient even for
people who do not use MPD. Let's make this optional.

We could put the optional module summary in the module meson.build but we'd have
to move summary() in main meson.build so that they appear in proper order.
2021-09-16 11:46:22 +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
560d7464b4
module/foreign-toplevel: initial support
* ‘content’ is a template; the module returns a list of toplevels,
  each one instantiated using the content template.
* Each toplevel has 6 tags:
  - app-id (string)
  - title (string)
  - maximized (bool)
  - minimized (bool)
  - activated (bool)
  - fullscreen (bool)

To show the application name and title of the currently active window,
one can do:

    - foreign-toplevel:
        content:
          map:
            tag: activated
            values:
              false: {empty: {}}
              true: {string: {text: "{app-id}: {title}"}}
2021-08-25 18:46:18 +02:00
Daniel Eklöf
fef40d18e1
module/sway-xkb: fix name of .so file, fixes load failures when built as shared module 2020-11-25 20:41:09 +01:00
Daniel Eklöf
19fe2f5a6f
module/script: wip: new plugin, reads data from a user provided script/binary
This module exec’s a script (or binary), specified by the ‘path’
attribute in the configuration.

It then reads tags from the script’s stdout.

The format of the output is:

  tag|type|value
  tag|type|value
  <empty line>

I.e. the script writes N tags followed by an empty  line. This
constitutes a transaction.

When a new transaction is received, its tags replaces *all* previous
tags.
2020-11-25 20:36:44 +01:00
Daniel Eklöf
e25c42dc87
module/river: meson: explicitly add wl_proto_src + wl_proto_headers to sources
The ‘river’ module depends on generated protocol sources. These are
normally provided, indirectly, by the Wayland bar backend. But when
building plugins as shared modules, the plugins no longer depend on
the bar, and thus ‘river’ fails to build.

Fix this by doing two things:

* **Remove** the ‘river’ protocol from the ‘generic’ Wayland protocols
* Explicitly add both the generic and the ‘river’ specific protocols
  to the ‘river’ module.
2020-09-24 17:30:18 +02:00
Daniel Eklöf
db53cf9245
module/alsa+backlight: round() percentage values
Closes #10
2020-09-24 13:57:05 +02:00
Daniel Eklöf
7b2d524598
moduel/river: wip: new module; 'tags' status on Wayland compositor 'river' 2020-07-23 19:00:42 +02:00
Daniel Eklöf
3719bbc593
meson: add 'fcft' dependency to decorations and modules
This should fix build failures when building plugins as shared
modules.
2019-12-01 18:02:23 +01:00
Daniel Eklöf
51a6631c19
fcft: use fcft instead of local copy of font.{c,h} 2019-12-01 16:00:15 +01:00
Daniel Eklöf
0550d2799d
tllist: use tllist from external git repository 2019-11-17 19:17:34 +01:00
Daniel Eklöf
9dbbc480e4
Rename project: f00bar -> yambar 2019-09-28 20:39:45 +02:00
Daniel Eklöf
e8a1efeeb5
meson: add freetype dependency to decorations and modules
Fixes build failures when building plugins as shared libraries
2019-09-22 12:25:11 +02:00
Daniel Eklöf
c11fee4ce3
cairo: replace cairo with pixman in decos, particles and modules
All decoration, particle and module interfaces now takes a
pixman_image_t parameter, and all drawing is done using pixman APIs.

The wayland/xcb backends implement a new interface functions,
get_pixman_image(), that should return a pixman image instance that is
suitable for rendering.

In the wayland backend, the image uses the same backing data as the
cairo surface.

In the XCB backend, we create a new image each time, and then blit it
to the cairo surface at commit time.
2019-09-22 01:56:58 +02:00
Daniel Eklöf
d576802e49
modules/sway-xkb: new module, uses sway 'input' events to expose kbd layout
We subscribe to Sway's 'input' events, and use these to expose input
devices' active XKB layout.

The module is configured by specifying a list of 'identifiers'; these
are the input devices (keyboards, typically), that we'll be
monitoring. All other input devices are ignored.

'content' is a template, and the module will instantiate a dynlist
with a 'content' for each *existing* input found in the 'identifiers'
list.

We also monitor for device 'added' and 'removed' events, and update
our internal list of existing inputs.

This means the user can configure a set of identifiers, and only those
that are actually present will be displayed. If a device that is
listed in the 'identifiers' list is added, it will be displayed. If it
is removed, it will no longer be displayed.
2019-08-14 21:51:43 +02:00
Daniel Eklöf
89538f96fa meson: modules: dictionaries can be added 2019-05-06 22:03:19 +02:00
Daniel Eklöf
08e21a4d3b meson: assign get_option('core-plugins-as-shared-libraries') to variable 2019-05-06 21:49:20 +02:00
Daniel Eklöf
121b2f1575 meson: enable_x11 -> backend_x11, enable_wayland -> backend_wayland 2019-05-06 21:45:01 +02:00
Daniel Eklöf
789cdd949b meson: use join_paths() 2019-05-03 23:10:01 +02:00
Daniel Eklöf
e563761093 meson: install plugins 2019-05-01 22:08:15 +02:00
Daniel Eklöf
ded98baa4e meson: don't reference xcb_stuff in wayland-only builds 2019-05-01 20:27:17 +02:00
Daniel Eklöf
3995464d49 meson: modules: make it data-driven 2019-05-01 20:24:31 +02:00