Commit graph

339 commits

Author SHA1 Message Date
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
Daniel Eklöf
7f2501334d modules: use the same name for the module_info in all modules 2019-01-12 20:34:43 +01:00
Daniel Eklöf
64b77a0efc config: dlopen() modules on-demand
TODO: optimizations and proper cleanup

* We currently reload the shared library for each *instance* of the
  module, and we do it twice; once when verifying, and once when
  instantiating.

* The shared libraries are never dlclosed()
2019-01-12 19:03:49 +01:00
Daniel Eklöf
731ab848e1 config: fix: attributes always use dash, not underscore 2019-01-12 13:56:02 +01:00
Daniel Eklöf
6f9e48698e module/xwindow: export module info through the new module_info struct type 2019-01-12 13:03:41 +01:00
Daniel Eklöf
905f289659 module/xkb: export module info through the new module_info struct type 2019-01-12 13:01:24 +01:00
Daniel Eklöf
87640339e1 module/removables: export module info through the new module_info struct type 2019-01-12 12:59:21 +01:00
Daniel Eklöf
697e613b2e module/network: export module info through the new module_info struct type 2019-01-12 12:56:54 +01:00
Daniel Eklöf
a16e2f5a53 module/mpd: export module info through the new module_info struct type 2019-01-12 12:52:42 +01:00
Daniel Eklöf
fb9f07dcad module/label: export module info through the new module_info struct type 2019-01-12 12:52:36 +01:00
Daniel Eklöf
f3721d9d80 module/i3: export module info through the new module_info struct type 2019-01-12 12:12:14 +01:00
Daniel Eklöf
550d4ad534 module/clock: export module info through the new module_info struct type 2019-01-12 12:05:39 +01:00
Daniel Eklöf
e24923e7cc module/battery: export module info through the new module_info struct type 2019-01-12 12:02:41 +01:00
Daniel Eklöf
3d36735f88 module/backlight: export module info through the new module_info struct type 2019-01-12 11:59:01 +01:00
Daniel Eklöf
e536391df6 module/alsa: export module info through the new module_info struct type 2019-01-12 11:58:57 +01:00
Daniel Eklöf
6cb2f52328 config: conf_particle_from() -> conf_to_particle() 2019-01-12 11:28:20 +01:00
Daniel Eklöf
8809cbb481 Put each module in its own subdirectory 2019-01-12 11:19:57 +01:00
Daniel Eklöf
e54e19e2c4 module/mpd: expose repeat/random/consume state 2019-01-11 20:10:36 +01:00
Daniel Eklöf
7b2dfd1399 module/i3: implement 'urgent' event handling 2019-01-11 20:05:38 +01:00
Daniel Eklöf
b9b90d8b9e module/i3: 'reload' events don't have a 'current' element 2019-01-11 20:01:36 +01:00
Daniel Eklöf
67767e6f54 module/backlight: expose brightness as percent too 2019-01-09 21:17:27 +01:00
Daniel Eklöf
7fc9749c28 module/clock: user can now specify the date/time format strings 2019-01-09 18:50:26 +01:00
Daniel Eklöf
9037aadd04 module/xwindow: some windows have a zero-length PID property 2019-01-09 18:50:26 +01:00
Daniel Eklöf
128716c8aa module/i3: if there's no specific workspace template, try a default one
If the user hasn't specified a specific template for a workspace, try
to lookup a default one (the empty string).

This allows the user to configure a "fallback" template to be used for
"extra", or not-often-used workspaces.
2019-01-09 18:50:26 +01:00