Commit graph

468 commits

Author SHA1 Message Date
Daniel Eklöf
7f1ffd126b
module/script: close script communication pipe FD on error 2020-11-25 20:36:45 +01:00
Daniel Eklöf
fb0d443e1d
module/script: plug memory leak: free ‘tags’ array 2020-11-25 20:36:45 +01:00
Daniel Eklöf
73407853e4
module/script: can’t use logical OR when building a base 10 number 2020-11-25 20:36:45 +01:00
Daniel Eklöf
08bac77907
module/script: script arguments
Add new config attribute, ‘args’. This is a list of strings, that will
be passed as arguments to the script.
2020-11-25 20:36:45 +01:00
Daniel Eklöf
8702378c74
module/script: restore signal handlers and mask in child process
This fixes the issue where `killpg()` didn’t manage to kill the
sub-process tree.
2020-11-25 20:36:45 +01:00
Daniel Eklöf
c911d20e73
module/script: add debug logging of raw received data 2020-11-25 20:36:45 +01:00
Daniel Eklöf
f2814f786e
module/script: copy ‘value’ to a NULL-terminated string
This ensures e.g. strtol() doesn’t parse data beyond current
tag/value.
2020-11-25 20:36:45 +01:00
Daniel Eklöf
430e505bd2
module/script: remove debug output that wasn’t actually using LOG_DBG() 2020-11-25 20:36:44 +01:00
Daniel Eklöf
fbaa208768
module/script: disable debug output 2020-11-25 20:36:44 +01:00
Daniel Eklöf
80d0025e64
module/script: drop setsid() call 2020-11-25 20:36:44 +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
cadf227bc6
module/battery: doh! fix spelling of ‘status’ 2020-11-14 23:03:11 +01:00
Daniel Eklöf
c0c5df0f6a
module/battery: map “Not charging” to STATE_DISCHARGING 2020-11-14 23:02:18 +01:00
Daniel Eklöf
8a7e07af28
module/mpd: don’t overload enum mpd_state
We overloaded enum mpd_state to add an “offline” state. Don’t do
this. We can detect the offline state by checking if our connection
object is NULL.

Closes #16
2020-11-09 20:27:42 +01:00
Daniel Eklöf
d645aff48e
module/clock: silence compiler warning: ensure timeout_ms is initialized 2020-09-24 17:47:20 +02: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
0cde404d2a
module/clock: detect when we need to update every second
Closes #12
2020-09-24 16:01:18 +02:00
Daniel Eklöf
318965b715
module/clock: internally use either minutes or seconds granularity 2020-09-24 14:32:39 +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
85ae4cca37
module/alsa: add ‘percent’ tag - volume level as a percentage
Fixes part of #10
2020-09-24 13:54:41 +02:00
Daniel Eklöf
06c2a69120
moduel/river: at startup, don't instantiate seat-status before binding outputs 2020-07-24 17:44:35 +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
6433373f93
module/i3-common: fix compilation warning with asan 2020-07-07 14:06:29 +02:00
Daniel Eklöf
cc8a54a0de
Merge branch 'battery-charge-current'
Closes #6
2020-06-22 10:58:34 +02:00
Daniel Eklöf
19d91dbb44
module/battery: estimate remaining time from charge+current
Time remaining is now taken from 'time_to_empty_now' if available. If
not, use 'energy' + 'power' if available, and if those does not exist,
use 'charge' + 'current'.

If neither exists, hardcode to 99:00.
2020-06-21 20:44:34 +02:00
Daniel Eklöf
87a8054ae2
module/removable: 'ignore' is now applied to partitions too
This means you can now do either

  ignore: [/dev/sda]

to ignore all partitions on /dev/sda, or

  ignore: [/dev/sda1]

to ignore only the first partition on /dev/sda.
2020-06-21 10:24:52 +02:00
Daniel Eklöf
5d17f1eb57
module/removables: add 'ignore' configuration option
This is a list of devnames (e.g. /dev/sr0). Devices listed here will
be ignored.
2020-06-20 21:46:03 +02:00
Daniel Eklöf
205801625f
Merge branch 'master' into sd-card 2020-06-20 11:26:30 +02:00
Daniel Eklöf
ae871853ca
module/battery: don't crash if 'sysname' in udev event is NULL 2020-06-20 11:21:44 +02:00
Daniel Eklöf
86e6aea152
module/battery: poll-interval = 0 now disables polling 2020-06-20 11:02:57 +02:00
Daniel Eklöf
ddd5911410 module/removables: check for removable or SD card in add_device() 2020-06-18 20:17:55 +02:00
Daniel Eklöf
0fc2a29296 module/removables: initial support for detecting SD cards at startup
SD cards aren't removable
2020-06-18 20:09:57 +02:00
Daniel Eklöf
bdc5dea428 module/alsa: set unmuted=false if we device doesn't have the muted property 2020-06-18 20:08:47 +02:00
Daniel Eklöf
0b1333aa03
module/battery: add support for 'charge_full' and 'charge_full_design' 2020-06-05 13:44:59 +02:00
Daniel Eklöf
1864d68961
module/battery: don't need 'energy' unless we're estimating time left 2020-06-05 13:44:38 +02:00
Daniel Eklöf
50b4bf3783
module/battery: use time_to_empty_now if available 2020-06-05 13:36:10 +02:00
Daniel Eklöf
cc9c5109e9
module/battery: handle 'manufacturer' and 'model_name' not being present 2020-06-05 13:29:38 +02:00
Daniel Eklöf
0e3bded42d
module/mpd: thrd_success isn't necessarily 0 2020-05-03 14:25:17 +02:00
Daniel Eklöf
c3b3d6a637
module/i3: workaround 'workspace init' event being sent twice
Sway 1.4 sends two identical 'workspace init' events when a display is
plugged in.
2020-04-28 18:56:39 +02:00
Daniel Eklöf
1d24755f6b
module/i3: log errors when IPC replies/events are missing data 2020-01-24 21:27:07 +01:00
Daniel Eklöf
f4e456a0ad
module/i3: 'pid' is not a standard property of windows event
Don't fail (and terminate the i3 plugin) if we receive a window event
where the 'container' doesn't have a 'pid' property.

This means we won't be able to determine the application the window
belongs to.

Closes #2
2020-01-24 21:27:07 +01:00
Daniel Eklöf
9675b86478
module/i3: window event: use 'app_id' for 'application', if available
We previously used the 'pid' property of the 'container' object in a
window event to lookup the application name under /proc/<pid>/comm.

In many cases, the application name is already available in the window
event itself, in the 'app_id' property.

Use this, if available, and fallback to the old PID method otherwise.

A quick experiment suggests 'app_id' is set for all Wayland native
applications, but not for X11 applications running under XWayland.
2020-01-24 21:23:21 +01:00
Daniel Eklöf
86522d653d
modules: move 'content' and 'anchors' to MODULE_COMMON_ATTRS
All modules implement these. The only one that differs is the i3
module. It still implements them, but 'content' uses an internal
verifier function.
2020-01-24 21:08:39 +01: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
0e7db5f397
module/removables: relaxed mountinfo matching criteria
Fixes mount detection on e.g. Artix Linux.
2019-09-27 19:31:12 +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