Commit graph

434 commits

Author SHA1 Message Date
Yutaro Ohno
963b9d47ee modules/dwl: handle the appid status
dwl added an "appid" field as output status [1]. We currently don't
handle this field, and thus output warnings that say "UNKNOWN action".

Handle the "appid" field correctly and expose a value of this field to
users. Also, suppress the warnings.

Link: 7f9a212476 [1]
2023-03-26 16:08:55 +09:00
Armin Fisslthaler
f21db9caca i3: add "native" sway/i3 sort mode
This adds a sort mode for workspaces which corresponds to the default
behavior in sway/i3.
2023-03-24 17:48:26 +01:00
Oleg Hahm
8ccd79ad08 modules/network: do not use IPv6 link-local
Probably you don't want to see your IPv6 link-local address but rather a
global one.
2023-03-08 18:41:20 +01:00
Daniel Eklöf
d1776714ed
Merge branch 'pipewire-roundf'
Closes #262
2023-01-21 15:50:22 +01:00
Leonardo Hernández Hernández
5da51210de
module/dwl: allow specify the name of tags 2023-01-16 19:53:21 -06:00
Ogromny
bdbcc0100a modules/pipewire: change type of volume from uint8 to uint16 2023-01-16 10:29:16 +01:00
Ogromny
10fde4dd0a modules/pipewire: use roundf instead of ceilf for more accuracy 2023-01-16 10:29:16 +01:00
Daniel Eklöf
134ae847dc
module/river: add support for ‘layout’ events 2023-01-12 18:15:16 +01:00
Daniel Eklöf
f75168796a
module/pipewire: handle failures when trying to connect to pipewire
* Replace asserts() with error logs
* Handle not being connected in content()
* Return from run() with an error
2023-01-02 14:08:21 +01:00
Daniel Eklöf
73ccafdade
module/i3: fix regression in handling of persistent workspaces
bbd2394601 added support for ‘rename’
and ‘move’ events. In order to do that, it changed how workspace
events are matched against our internal workspace list: from string
comparing the workspace name, to checking i3/sway’s workspace ID
parameter.

This introduced a regression in our handling of persistent
workspaces. A persistent workspace is one that isn’t removed from the
bar when it’s deleted (empty, and switched away from) by i3/sway.

This concept doesn’t exist in i3/sway, but is something we’ve
added. Put simple, the way we do this is be keeping the workspace in
our list, even when i3/sway tells us it has been deleted.

However, at this point the workspace doesn’t have an ID anymore. And
the same is true at startup; when we initialize the persistent
workspaces, we only have their names. Not their IDs (since the
workspaces don’t actually exist yet).

To this the regression, we need to:

a) fallback to looking up workspaces by name. That is, if we fail to
  find one with a matching ID, try again using the workspace name. For
  _this_ to match, we also required the matched workspace to be a
  persistent workspace, with an ID < 0 (which essentially means the
  workspace doesn’t exist yet).

b) reset the ID to -1 when a persistent workspace is "deleted".

Closes #253
2022-12-28 15:21:46 +01:00
Leonardo Hernández Hernández
02d281df58
module/dwl: correctly handle the title
Uupdate the title when process a new batch of info instead of call
strtok_r and looping until `string` is NULL.

This fixes an issue where only the last part of the title was kept.
2022-12-28 15:19:11 +01:00
Daniel Eklöf
e4edbd26c6
modules: change min poll interval from 500ms to 250ms 2022-12-27 13:20:31 +01:00
Daniel Eklöf
310c07b03d
module/battery: using a static buffer in readline_from_fd() isn’t thread safe 2022-12-27 13:17:06 +01:00
Daniel Eklöf
c4f820e486
module/script: poll-interval: convert value from ‘seconds’ to ‘milliseconds’ 2022-12-22 12:06:25 +01:00
Daniel Eklöf
500b051fe4
module/network: poll-interval: convert value from ‘seconds’ to ‘milliseconds’ 2022-12-22 12:06:15 +01:00
Daniel Eklöf
8fbbce10a5
module/battery: poll-interval: convert value from ‘seconds’ to ‘milliseconds’ 2022-12-22 11:59:02 +01:00
Daniel Eklöf
ac8e45c331
module/mem: cleanup poll-interval
* man page: spell out ‘milliseconds’
* use a ‘static const’ variable for min_poll_interval, instead of a
  macro
2022-12-22 11:47:44 +01:00
Daniel Eklöf
a18296a179
module/disk-io: cleanup poll-interval
* man page: spell out ‘milliseconds’
* use a ‘static const’ variable for min_poll_interval, instead of a
  macro
2022-12-22 11:47:44 +01:00
Daniel Eklöf
1f25978eb4
module/cpu: cleanup poll-interval
* man page: spell out ‘milliseconds’
* use a ‘static const’ variable for min_poll_interval, instead of a
  macro
2022-12-22 11:46:00 +01:00
Daniel Eklöf
cb8acf261a
module/mem: rename ‘interval’ to ‘poll-interval’ 2022-12-18 16:51:41 +01:00
Daniel Eklöf
63c9c90a61
module/disk-io: rename ‘interval’ to ‘poll-interval’ 2022-12-18 10:38:56 +01:00
Daniel Eklöf
710cede371
module/pipewire: disable debug logging 2022-12-17 18:26:31 +01:00
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
3ca274759a
module: const:ify ‘module’ argument to module->description() 2022-12-14 12:05:17 +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
Timur Celik
24a3b90a01
modules: Implement workspace move event
Implementing the move event required to pass the IPC socket to
`i3_ipc_callback_t`, because we won't get notified about any visibility
changes of other workspaces.  That's why we query all workspaces again
after a focused workspace was moved.
2022-12-13 16:21:55 +01:00
Timur Celik
8f89545b32
modules: Warn for all unknown workspace events 2022-12-13 16:19:11 +01:00
Timur Celik
bbd2394601
modules: Implement workspace rename event
A renamed workspace caused yambar to abort in a failed assertion,
because workspace lookup was done by name and the `rename` event was not
implemented.  To resolve this issue this patch implements the `rename`
event and as a necessity changes workspace_lookup() to use ids instead
of names.
2022-12-13 16:16:16 +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