Commit graph

930 commits

Author SHA1 Message Date
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
Daniel Eklöf
54798567c0 module/alsa: track all channels
Warn if volume and/or muted state is inconsistent (as we only expose a
single volume/muted state).

Also, don't query for current volume if max == 0 (i.e. typically a
digital output).

Finally, make absolutely sure that volume min is really less (or
equal) to volume max, and that the current volume level is between min
and max.
2019-01-09 18:50:26 +01:00
Daniel Eklöf
558f75a54b module/particle: remove cairo context from begin_expose() 2019-01-09 18:50:26 +01:00
Daniel Eklöf
f6977417e0 font: use font-config to load font
This allows us to a) move away from cairo's "toy" API, and b) let the
user specify font options in a single font "name" string:

  Serif:size=10:weight=bold:slant=italic

This also allows us to simplify the font code significantly (except
for the fontconfig parts...); the font no longer sets itself in a
cairo surface - font users do that; the font simply returns a
cairo_scaled_font_t.

Furthermore, font_clone() has now been simplified to basically just
refcount the scaled font. I.e. there's no need to run the full
constructor and lookup and instantiate the cairo scaled font again.
2019-01-09 18:50:16 +01:00
Daniel Eklöf
b52bdf14b2 xcb: log version info as debug, rather than info 2019-01-09 18:29:51 +01:00
Daniel Eklöf
2b2c5bbf4d config: not true 2019-01-07 18:32:27 +01:00
Daniel Eklöf
91826ff176 module/removables: handle optical media (CDROMs) 2019-01-07 18:32:09 +01:00
Daniel Eklöf
af13df3045 module/i3: trigger a bar refresh after a workspace event 2019-01-07 18:31:55 +01:00
Daniel Eklöf
072a508291 module/i3: add more debug logging 2019-01-07 18:31:47 +01:00
Daniel Eklöf
552739fa20 module/i3: fix gcc warning
Gcc (correctly) figured out that we may end up truncating the socket
path. In practice, it's something that should never happen.

Never the less, silence the warning by writing the socket path
directly into the sockaddr_un object.
2019-01-07 18:30:30 +01:00
Daniel Eklöf
efe3dd06ab alsa: initialize values, fixes valgrind warning
When snd_mixer_selem_get_*() fails, the values were left
uninitialized, trigger a valgrind warning.

In addition to fixing this, the error(s) are now logged (but only as
warnings, as they are not fatal).
2019-01-07 18:29:03 +01:00
Daniel Eklöf
fdadf577e9 main: detect when X server dies, and abort
This is done by creating an XCB connection, whose only purpose is to
detect a POLLHUP (xcb disconncet).

Furthermore, make sure SIGINT is blocked in all threads except the
main thread.
2019-01-07 18:27:43 +01:00
Daniel Eklöf
3f226d8cce bar: detect XCB disconnect (and abort) 2019-01-07 18:27:28 +01:00
Daniel Eklöf
400a92fa04 tag: rename and rewrite sbuf_strcat()
In particular, don't use strncat() with a length derived from the
source.
2019-01-07 18:26:48 +01:00
Daniel Eklöf
f0cc0b4383 yml: initialize return value, fixes gcc warning (-O3 -Wall) 2019-01-07 18:26:29 +01:00
Daniel Eklöf
bf5ad4d6b7 module/network: both thrd_current() and getpid() are 32-bit 2019-01-06 20:41:34 +01:00
Daniel Eklöf
aa38063e37 wip: verify configuration
We now verify the configuration (currently down to module level, but
not including particles) that are present are of the expected type.
2019-01-06 20:04:01 +01:00
Daniel Eklöf
45e5f11fea modules: remove "connected to " prefix from info logs 2019-01-02 18:14:49 +01:00
Daniel Eklöf
43aeb1c224 module/alsa: include volume min/max/cur and muted state in info log 2019-01-02 18:14:26 +01:00
Daniel Eklöf
64a52656b1 module/alsa: log info message when up and running 2019-01-02 18:11:39 +01:00
Daniel Eklöf
2d5d1d5a46 module/alsa: disable debug logging 2019-01-02 18:08:32 +01:00
Daniel Eklöf
0d8704737e module/alsa: monitors volume and muted state of selected card/mixer 2019-01-02 18:07:16 +01:00
Daniel Eklöf
cba97a0e65 yml: remove commented out (old) code 2019-01-02 12:32:19 +01:00
Daniel Eklöf
2977af835c yml: add TODO to handle duplicate keys when merging dictionaries 2019-01-02 12:14:23 +01:00
Daniel Eklöf
91fa8a0217 yml: cleanup 2019-01-02 12:09:42 +01:00
Daniel Eklöf
305058deab yml: detect (and report to user) duplicate keys in dictionaries 2019-01-02 12:08:41 +01:00
Daniel Eklöf
de34d734a0 license: MIT 2019-01-02 11:24:28 +01:00
Daniel Eklöf
e159b596d9 bar: ignore XCB_MAPPING_NOTIFY events 2019-01-01 23:32:59 +01:00
Daniel Eklöf
b13305526a yml: apparently, libyaml's line number in the error context is 0 based
Which makes zero sense when reporting the error to the user.
2019-01-01 23:27:54 +01:00
Daniel Eklöf
4d46a14a67 main: print a descriptive error message when yaml parsing fails 2019-01-01 23:26:10 +01:00
Daniel Eklöf
5abd825137 yml: yml_load(): optionally allocates an error string (on error) 2019-01-01 23:25:36 +01:00
Daniel Eklöf
3dc7d0e39d yml: yml_destroy(): return immediately if node is NULL
This can happen for example when destroying a partially created
dictionary entry, where only the key node has been created.
2019-01-01 23:24:27 +01:00
Daniel Eklöf
a9110cc936 config: allow simple lists without actually declaring a list node
That is, instead of writing:

  content:
    list:
      items:
        - string: ..
        - string: ..

It is now possible to write:

  content:
    - string: ...
    - string: ...

Obviously, this means it's not possible to assign spacing, margin or
on-click handlers to such a list.
2019-01-01 20:50:49 +01:00
Daniel Eklöf
ed4716a600 module/removables: remove debug logging 2019-01-01 20:37:04 +01:00
Daniel Eklöf
94dbe3b892 bar: ignore events we're not interrested in 2019-01-01 20:35:36 +01:00
Daniel Eklöf
7dd35f1159 module/xkb: remove assert: variable has been removed 2019-01-01 20:34:39 +01:00
Daniel Eklöf
9351d3b6d9 yml: yml_value_as_bool(): return false if value didn't match any known values 2019-01-01 20:32:12 +01:00
Daniel Eklöf
28b0f150cd xcb: replace asserts with error checks 2019-01-01 20:32:03 +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
410b7635d7 log: ensure variables are always initialized. Fixes gcc warning 2019-01-01 20:30:15 +01:00
Daniel Eklöf
e711a6f103 config: deco_from_config() return NULL if we didn't match a deco 2019-01-01 20:29:55 +01:00
Daniel Eklöf
ba1c52d291 bar: remove unused variable 2019-01-01 20:29:48 +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