Commit graph

1271 commits

Author SHA1 Message Date
Daniel Eklöf
5c9030129d
module/script: use NULL terminated ‘value’ when converting to int/bool/float 2020-11-25 20:36:46 +01:00
Daniel Eklöf
37447cd955
module/script: initialize string tags from our NULL-terminated ‘value’
`_value` is a pointer into the receive buffer, and may not be NULL
terminated, and may also contain data belonging to the next tag.
2020-11-25 20:36:46 +01:00
Daniel Eklöf
9945fce2d2
module/script: explicitly ignore return value of write(3) 2020-11-25 20:36:45 +01:00
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
008235d904
bar/wayland: close command pipe FDs in cleanup 2020-11-25 20:36:45 +01:00
Daniel Eklöf
328ebe8fe9
bar/wayland: plug memory leak: free seat name 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
99aa8dea82
main: block SIGCHLD globally
This allows threads (modules) to create signal FDs for SIGCHLD.
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
1262f1b3d1
bar/wayland: use wl_*_release() instead of wl_*_destroy()
This lets the compositor free up internal state.
2020-11-09 19:53:57 +01:00
Daniel Eklöf
5113357fb2
Merge branch 'document-river' 2020-11-01 13:08:42 +01:00
Daniel Eklöf
fcfc7442c7
doc: yambar-modules: document the river module
Closes #9
2020-11-01 13:08:09 +01:00
Daniel Eklöf
c55153bad8
readme installation: mention -Dbackend-*=disabled|enabled 2020-09-24 20:15:06 +02: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
41d0a17ea5
doc: yambar-tags: document the :hex and :oct suffixes 2020-09-24 17:03:36 +02:00
Daniel Eklöf
a5faf4896a
changelog: add issue link for alsa: volume as percentage 2020-09-24 16:01:46 +02:00
Daniel Eklöf
bd29bf765b
Merge branch 'clock-seconds-granularity' into master 2020-09-24 16:01:25 +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
a041b8f971
changelog: don’t do escaping in backtick quoted string 2020-09-24 14:01:30 +02:00
Daniel Eklöf
1d579dff6b
changelog: use backticks for filenames and properties 2020-09-24 14:00:50 +02:00
Daniel Eklöf
88f0b7b8c0
changelog: highlight “unknown error” + spell fix ‘encountered’ 2020-09-24 13:59:58 +02:00
Daniel Eklöf
51e9dbd4fc
changelog: alsa: percentage -> percent 2020-09-24 13:59:15 +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
eceee99fb0
yml: don’t overwrite errors from yml_parser_parse()
When we detect an error in yml_parser_parse(), we handle that
specifically, and then jump to the generic error handler.

The generic error handler overwrites the previously formatted error
before cleaning up and returning.

This meant that a) the actual error message was lost, and replaced
with a generic “unknown error”, and b) the dynamically allocated error
string buffer was leaked.
2020-09-24 13:38:56 +02:00
Daniel Eklöf
57e755477c
changelog: new 'unreleased' section 2020-09-05 09:28:06 +02:00
Daniel Eklöf
f3db670455
Merge branch 'releases/1.5' into master 2020-09-05 09:27:20 +02:00
Daniel Eklöf
6dfa6ec1db
changelog: add missing '#' to 'changed' header 2020-09-05 09:26:16 +02:00
Daniel Eklöf
8d4e2e14a4
meson/pkgbuild: bump version to 1.5.0 2020-09-05 09:25:13 +02:00
Daniel Eklöf
a2866aad0f
changelog: add a changelog 2020-09-05 09:24:03 +02:00
Daniel Eklöf
c17e4b1110
meson: bar: remove unused list variable 2020-08-30 11:01:40 +02:00
Daniel Eklöf
a7820e1db7
meson: install LICENSE and README.md 2020-07-25 09:08:11 +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
e04b678518
meson/pkgbuild: we don't depend on wlroots 2020-07-22 17:50:24 +02:00
Daniel Eklöf
d32698c042
ci: log toolchain version information 2020-07-20 19:17:02 +02:00
Daniel Eklöf
771d090c18
readme: add a 'bugs' section, describing how to report bugs 2020-07-20 17:37:52 +02:00