Commit 3ae5f31d0 introduced the I3SOCK environment variable. This
prevents us from having to call `i3 --get-socketpath'. In case the
variable doesn't exist, fall back to the old ways.
Signed-off-by: Wesley Schwengle <wesleys@opperschaap.net>
Add simple `if exists' construct in the subscribe function. This
prevents a somewhat cryptic warnings such as these:
Use of uninitialized value $type in hash element at
/usr/share/perl5/AnyEvent/I3.pm line 309.
We still warn the user, but it is much clearer as to what the cause is.
It now shows something like this:
Could not subscribe to event type 'foo'. Supported events are _error
barconfig_update binding mode output shutdown tick window workspace
Signed-off-by: Wesley Schwengle <wesleys@opperschaap.net>
Sending the sync command via IPC ensures pending IPC messages are handled by i3
before the sync response is read. This is rarely useful for direct IPC
connections to i3, but becomes useful when synchronizing with i3bar, which might
have pending IPC messages in response to button clicks.
All other message types are verbs, only our first-ever message COMMAND wasn’t.
While we’re here, also change the message type dictionary into a table with
clickable links to the corresponding reply type.
Authors of downstream IPC libraries are encouraged to keep the old name around
so as to not break existing code, but mark it as deprecated.
This introduces memory usage by one copy of the config file, which is an
acceptable trade-off for being able to easily revert data loss.
The default config is 6KB, user configs will be in the same ballpark.
fixes#2856