Commit graph

476 commits

Author SHA1 Message Date
Daniel Eklöf
7dd35f1159 module/xkb: remove assert: variable has been removed 2019-01-01 20:34:39 +01:00
Daniel Eklöf
aa477eaa32 module/xkb: remove unused variable 2019-01-01 20:31:54 +01:00
Daniel Eklöf
c01806d6fa module/xkb: declare and initialize 'symbols' before first goto err
This ensures we don't free() an invalid value.
2019-01-01 20:31:00 +01:00
Daniel Eklöf
a8a9ab28bd module/removables: log warning if action is something we didn't expect 2019-01-01 20:30:27 +01:00
Daniel Eklöf
bdd760a40b module/removables: cleanup 2019-01-01 20:18:48 +01:00
Daniel Eklöf
14f9aec088 module/removables: monitors removable devices using udev 2019-01-01 20:07:50 +01:00
Daniel Eklöf
0ab8dad7b9 module/network: initialize MAC address to 0
This fixes a valgrind "uninitialized value(s)" warning.
2019-01-01 13:10:44 +01:00
Daniel Eklöf
a96f901a15 module/network: disable debug logging 2019-01-01 13:10:35 +01:00
Daniel Eklöf
ea2cc50194 module/network: process_reply() -> parse_reply() 2018-12-31 13:44:49 +01:00
Daniel Eklöf
b2af90abbc module/network: IFA_ADDRESS: include add/del in log message 2018-12-31 13:42:32 +01:00
Daniel Eklöf
24842d9b28 module/network: RTM_NEWLINK/DELLINK: don't do anything if nothing's changed
We're only interrested in a few of the attributes. Thus, there's no
need to log or update anything, if none of those attributes haven't
changed.
2018-12-31 13:40:43 +01:00
Daniel Eklöf
dcf8051f1a module/network: break out message parsing code
This also allows us to actually handle errors (by aborting run())
2018-12-31 13:36:44 +01:00
Daniel Eklöf
8352d89491 module/network: break out message receiving code 2018-12-31 13:27:37 +01:00
Daniel Eklöf
b3f3f91dc2 module/network: drop libnl dependency, use raw netlink sockets instead 2018-12-31 13:19:01 +01:00
Daniel Eklöf
4c4f0ce7a0 module: network: monitor ethernet interfaces
State exposed (tag names):

* name: the interface name ("eth0" etc)
* index: the interface index, "ifindex"
* state: operational state (down, up etc)
* mac: the Ethernet hardware address
* ipv4: the *last* IPv4 address added to the interface
* ipv6: the *last* IPv6 address added to the interface

State we monitor (for changes):

* state
* ipv4 addresses
* ipv6 addresses
2018-12-30 20:40:10 +01:00
Daniel Eklöf
500aebe9ef module/mpd: free connection object when failing to connect 2018-12-30 14:04:40 +01:00
Daniel Eklöf
07d6564e79 module/mpd: raise connection retry interval from 1s -> 10s 2018-12-30 12:40:58 +01:00
Daniel Eklöf
b7e7ad522f remove module subfolders 2018-12-29 22:18:08 +01:00
Daniel Eklöf
52f13dec3d dynlist: move to particles folder 2018-12-29 22:13:00 +01:00
Daniel Eklöf
bd251cbf9f module/mpd: only auto-progress 'elapsed' when state is PLAYING 2018-12-29 18:33:00 +01:00
Daniel Eklöf
5a2f4a3ece module/battery: run(): return 0 on success 2018-12-29 18:01:40 +01:00
Daniel Eklöf
ab67d036ae tags: break out string formatting from particle/string 2018-12-29 17:03:41 +01:00
Daniel Eklöf
cc654eda57 module/mpd: cleanup 2018-12-28 15:26:22 +01:00
Daniel Eklöf
97b279ff82 module/mpd: don't detach refresh thread
Instead, abort and join previous thread (if any), just before creating
a new one.

Abort/join the last one when destroying the module.

Note: we may end up with a dangling (non-joined) thread for a
while (for example, when state goes from playing -> paused/stopped).

It will however be joined eventually; either when state goes to
'playing' again, or when the module is destroyed.
2018-12-28 14:22:17 +01:00
Daniel Eklöf
cc59593f29 module/mpd: idle mask variable is unused, when we don't debug log 2018-12-28 14:15:03 +01:00
Daniel Eklöf
0103eff3a0 module/mpd: free album/artist/title before replacing them 2018-12-28 14:14:43 +01:00
Daniel Eklöf
64af167d66 module/mpd: disable debug logging 2018-12-28 14:14:21 +01:00
Daniel Eklöf
d8274c2c9c module/mpd: refresh thread only resets refresh_abort_fd if it's "ours"
That is, we only reset it if the module main thread haven't already
done so (and quite possibly created another eventfd).
2018-12-28 14:08:45 +01:00
Daniel Eklöf
b40069616c module/mpd: refresh_abort_fd now uses -1 to indicate there are is no active thread 2018-12-28 14:08:16 +01:00
Daniel Eklöf
ba31a557f5 module/mpd: refresh thread calls bar->refresh() directly
This is possible, since content() now calculates the correct 'elapsed'
time, based on the time the original elapsed value was received from
MPD.
2018-12-28 14:07:06 +01:00
Daniel Eklöf
f74f2ad031 module/mpd: elapsed and duration are now tracked in millseconds 2018-12-28 14:06:13 +01:00
Daniel Eklöf
67bd38f5df module/mpd: implement refresh_in() 2018-12-28 12:47:18 +01:00
Daniel Eklöf
89ebfa0dbb module/mpd: remember *when* the 'elapsed' member was set.
This allows us to update the elapsed field without having to talk to
MPD.

In particular, it fixes a bug where we reported the same elapsed value
when we we're updated due to *other* modules calling bar->refresh().
2018-12-28 12:47:14 +01:00
Daniel Eklöf
904f9ff8e1 tag: all tag constructors must now be passed a module 'owner' 2018-12-28 12:40:41 +01:00
Daniel Eklöf
99008c5ad9 module/mpd: "elapsed" tag is now a realtime tag (when state == playing) 2018-12-27 11:44:46 +01:00
Daniel Eklöf
9a94c9c1f7 module/mpd: monitors MPD 2018-12-27 11:36:38 +01:00
Daniel Eklöf
ce68bdb59d exposable: add a 'width' member, set (at latest) in begin_expose() 2018-12-26 16:37:11 +01:00
Daniel Eklöf
1929099ca4 module/backlight: new module 2018-12-26 12:44:17 +01:00
Daniel Eklöf
5306ebd4ed bar: call refresh() after all modules have been loaded
This also means that modules do *not* have to call bar->refresh() just
before/after calling module_signal_ready().

As long as the module's initial state has been correctly/completely
set up before it calls module_signal_ready(), the module *only* has to
call bar->refresh() when it's state changes.
2018-12-26 11:48:09 +01:00
Daniel Eklöf
3af0280304 module/xwindow: replace assert with real error check 2018-12-26 11:44:21 +01:00
Daniel Eklöf
6d75fe64ef module/xkb: signal module-ready when failing early 2018-12-26 11:42:42 +01:00
Daniel Eklöf
b2121070f8 module/i3: replace asserts with real error checks 2018-12-26 11:31:28 +01:00
Daniel Eklöf
30332670aa module/battery: convert asserts to real error checks 2018-12-25 12:25:24 +01:00
Daniel Eklöf
d81547066d module/battery: log error message on failure during initialization 2018-12-19 21:12:42 +01:00
Daniel Eklöf
7e95862e12 module/battery: error handling during initialization 2018-12-19 20:54:36 +01:00
Daniel Eklöf
ffaec546f5 module/xwindow: use lock from generic module 2018-12-19 20:35:43 +01:00
Daniel Eklöf
60b72cc55a module/xkb: delay ready signal, until we've actually initialized 2018-12-19 20:29:58 +01:00
Daniel Eklöf
661cabfb69 module/i3: use lock provided by generic module 2018-12-19 20:26:15 +01:00
Daniel Eklöf
2c7362fefa module/battery: no need to lock before we've signaled ready 2018-12-19 20:24:36 +01:00
Daniel Eklöf
3413232ed6 module: add new function module_signal_ready() 2018-12-19 20:23:53 +01:00