Commit graph

162 commits

Author SHA1 Message Date
Daniel Eklöf
f37dfbc727 module/mpd: free strdup:ed path string 2019-01-29 20:58:55 +01:00
Daniel Eklöf
8d1afd027b module/xkb: initialize indicators
This fixes a bug where we tried to free invalid indicator names.
2019-01-27 22:05:00 +01:00
Daniel Eklöf
452c4b6015 plugins: export a const function pointer interface struct 2019-01-26 18:32:04 +01:00
Daniel Eklöf
18ba3723d4 module/i3: avoid stack-allocating large buffers
This fixes a stack-overflow issue with musl (which uses small stacks).
2019-01-26 13:19:02 +01:00
Daniel Eklöf
a827cc80d4 cmake: make sure we can find i3/ipc.h
There's no pkg-config file shipped with i3, so our only option is to
manually look for the file (and assume it can be found in the "normal"
include paths).
2019-01-26 12:30:14 +01:00
Daniel Eklöf
9e2ebf3cab module/network: thrd_t isn't an integer in musl 2019-01-20 14:30:39 +01:00
Daniel Eklöf
2b3d432164 cmake: we don't *really* need 3.13 2019-01-20 13:07:38 +01:00
Daniel Eklöf
4f5e22e231 module/xwindow: de-registering events from active window may fail
De-registering events from the previous active window may fail (when
the previous window has been destroyed).

Catch this early, and only log a debug message. This avoids having a
normal occurrence polluting the output with error messages.
2019-01-20 12:04:29 +01:00
Daniel Eklöf
d86c9914e5 module/mpd: silence overflow warning 2019-01-20 11:35:20 +01:00
Daniel Eklöf
cffb007009 module/alsa: handle failure(s) to attach to card or find mixer 2019-01-19 19:58:02 +01:00
Daniel Eklöf
fbb6cd47c4 module/xkb: log all available layouts at startup 2019-01-19 18:54:31 +01:00
Daniel Eklöf
dff3104c85 misc: make use of the xcb-aux library 2019-01-19 18:47:34 +01:00
Daniel Eklöf
9d5bbe0566 misc: xcb_connect() always returns a non-NULL pointer
Instead, we need to check if xcb_connection_has_error() says something
went wrong. We also need to call xcb_disconnect() on the disfunctional
XCB connection object.
2019-01-19 18:45:15 +01:00
Daniel Eklöf
406d6b3b83 module/backlight: fix logging name 2019-01-19 17:06:23 +01:00
Daniel Eklöf
174b1f05e0 module/xkb: log initial state 2019-01-19 17:05:34 +01:00
Daniel Eklöf
502c2bd746 module/network: remove debug logging 2019-01-19 17:01:38 +01:00
Daniel Eklöf
e6745f55dd module/mpd: socket may already exist, but not be connectable 2019-01-19 17:00:08 +01:00
Daniel Eklöf
cecd5d3e6f module/mpd: use inotify, when possible, to watch for MPD socket creation
When we're connecting to a unix domain socket, use inotify to watch
for it's creation, instead of trying to re-connect over and over
again.
2019-01-19 13:49:58 +01:00
Daniel Eklöf
4ff9af1ebd module/xkb: add define for debug logging, but don't enable it 2019-01-19 13:49:44 +01:00
Daniel Eklöf
01be29d660 module/xkb: update scroll lock state on indicator state notify event 2019-01-19 13:22:40 +01:00
Daniel Eklöf
925dfb736a module/xkb: implement indicator state
For now, we only expose caps-, num- and scroll-lock, as booleans.
2019-01-19 12:30:07 +01:00
Daniel Eklöf
1bbdaf145f module/xwindow: add missing break to switch case 2019-01-17 20:17:04 +01:00
Daniel Eklöf
85d1971ac3 module/i3: read socket path from root window's I3_SOCKET_PATH property
This way, we don't have to execute another process just to get the
path.
2019-01-16 17:22:13 +01:00
Daniel Eklöf
77f8e6fa28 xcb: xcb_error() no longer prefixes error message with "XCB: " 2019-01-16 16:27:25 +01:00
Daniel Eklöf
bf558eca1b module/xwindow: log X errors 2019-01-16 16:26:27 +01:00
Daniel Eklöf
c5309abbd0 module/xwindow: don't crash if there is no active window 2019-01-16 16:24:56 +01:00
Daniel Eklöf
fae2e5cb18 xcb: add xcb_error(), a generic describe-an-x-error function
By default, generates an error message with the major/minor opcodes,
the error code and sequence number.

If available, it will use xcb-errors to generate an even better
description.
2019-01-15 20:44:21 +01:00
Daniel Eklöf
b0e384b2f3 module/xwindow: don't crash if window doesn't have a correctly sized PID property 2019-01-15 19:18:01 +01:00
Daniel Eklöf
d264a6a067 module/xwindow: correct logging "module" (name) 2019-01-15 19:17:37 +01:00
Daniel Eklöf
0d591fe5a1 allow plugins to be compiled into the f00bar main binary 2019-01-14 20:57:03 +01:00
Daniel Eklöf
2f83ed1fc3 particle/dynlist: compile as a shared library 2019-01-13 21:43:56 +01:00
Daniel Eklöf
4a26664d8d particles: remove config-verify.h from particle.h 2019-01-13 17:41:39 +01:00
Daniel Eklöf
f952347c84 module/backlight: don't divide by zero 2019-01-13 17:40:17 +01:00
Daniel Eklöf
bc62843c91 modules: get rid of struct module_info
Since this struct only contained function pointers, make all modules
export those functions directly.

The plugin manager now defines a module interface struct, and fills it
it by dlsym:ing the functions that used to be in module_info.
2019-01-13 17:09:11 +01:00
Daniel Eklöf
76d135e257 module: remove module_run_context
Store abort_fd directly in the module struct instead. This then allows
us to pass the module pointer as-is to the modules' run functions.
2019-01-13 15:34:59 +01:00
Daniel Eklöf
acdeff3b6e module: remove ready_fd
All modules are expected to handle a call to content() after having
been instantiated.

I.e. modules *cannot* even expect run() to have started running.
2019-01-13 15:25:39 +01:00
Daniel Eklöf
65cfcfb2de module/battery: initialize state in constructor 2019-01-13 15:08:09 +01:00
Daniel Eklöf
f04ff31d0f module/xkb: lock in content, and handle no layout available 2019-01-13 15:04:18 +01:00
Daniel Eklöf
a425378576 config: allow font/foreground attributes on modules too
Previously we allowed it on the bar, and on all particles. Now we also
allow it on all modules.

This allows us to specify a "default" font/foreground on a per-module
basis, having it applied to all the modules particles.
2019-01-13 14:24:44 +01:00
Daniel Eklöf
8dc278aaf2 config: pass a struct with inheritable values
For now, font and foreground color
2019-01-13 14:13:14 +01:00
Daniel Eklöf
9944a8f972 modules: don't assume module content is a dictionary
This is done by having each module implement a top-level verifier
function.
2019-01-13 11:54:57 +01:00
Daniel Eklöf
e471c2357d cmake: set _GNU_SOURCE globally, and only once 2019-01-13 11:40:09 +01:00
Daniel Eklöf
71515e4079 config: conf_verify_dict() now assumes attr list is NULL-terminated 2019-01-13 11:37:05 +01:00
Daniel Eklöf
45280416ff modules, particles: type-specific filename prefix
Instead of naming the shared libraries libfoo.so, add a type-specific
prefix: module_foo.so, or particle_foo.so
2019-01-13 11:26:31 +01:00
Daniel Eklöf
ec4a47e5db modules: rename module_info -> plugin_info
This is the same name used by particles.
2019-01-13 11:18:32 +01:00
Daniel Eklöf
47018104da particles: compile as shared libraries (plugins) 2019-01-13 11:13:47 +01:00
Daniel Eklöf
dea5055e37 cmake: cleanup 2019-01-12 22:23:49 +01:00
Daniel Eklöf
42104db1ca modules: move files back to a common directory (again) 2019-01-12 21:24:20 +01:00
Daniel Eklöf
e7e7284cba modules: remove header files 2019-01-12 21:20:52 +01:00
Daniel Eklöf
f7fd305821 build: install targets for f00bar binary + module plugins
Module plugins are (still) built in <build-dir>/modules.

When installing, f00bar binary is installed to <install-dir>/bin, and
the module plugins to <install-dir>/lib/f00bar.

For this to work, we now also set RPATH correctly. Since the installed
module plugins end up in a different location then when building,
different settings is required for BUILD_RPATH and INSTALL_RPATH.
2019-01-12 21:07:48 +01:00