Baptiste Daroussin
bfff39b7c9
main: cast sig_atomic_t to long, to fix the printf portability
2021-10-01 17:22:55 +02:00
Daniel Eklöf
be10465a3b
main: add -d,--log-level=info|warning|error|none
...
Closes #84
2021-08-15 11:43:49 +02:00
Daniel Eklöf
7d3851046e
log: pull in log.{c,h} from foot
2021-08-15 11:41:12 +02:00
Daniel Eklöf
db7a4af80a
main: call fcft_log_init(). Note that this requires fcft >= 2.3.90
2021-04-17 20:35:48 +02:00
Daniel Eklöf
2fe602a6a2
main: no need to block SIGCHLD anymore, we don’t use it
2020-11-25 20:41:10 +01:00
Daniel Eklöf
99aa8dea82
main: block SIGCHLD globally
...
This allows threads (modules) to create signal FDs for SIGCHLD.
2020-11-25 20:36:44 +01:00
Daniel Eklöf
44fb0b83ba
main: call setlocale() *after* loading fonts
...
This ensures the fonts are instantiated while LC_NUMERICAL is "C",
which required to handle FontConfig strings like "size=12.5".
2020-04-29 18:58:43 +02:00
Daniel Eklöf
6af8b52012
main: use DAEMON facility for syslog
2020-02-20 20:00:53 +01:00
Daniel Eklöf
0794b453dd
log: make syslog facility and level configurable, always log filename+lineno
2020-02-20 19:49:27 +01:00
Daniel Eklöf
7397ab9457
log: make more logging options configurable
...
* Add --log-colorize=never|always|auto
* Add --log-no-syslog
2020-02-05 19:42:48 +01:00
Daniel Eklöf
3f940ec2a8
main: bytes (from write() when printing PID) *is* used
2020-02-05 19:41:30 +01:00
Daniel Eklöf
d4755d94b0
main: add -p,--print-pid=FILE|FD
...
When specified, print our PID to the file, or FD, after everything has
started up.
2020-02-04 18:28:09 +01:00
Daniel Eklöf
c4f9168191
meson: fix version generation from git
...
run_command() was only run at configure time, meaning the generated
version (that was passed on to the sources via -DYAMBAR_VERSION)
became stale.
Fix by implementing a shell script that generates a header file, and
wrap this in a custom target that is run every time (but the generated
file is only updated when the version changes)
2019-10-19 21:47:21 +02:00
Daniel Eklöf
9dbbc480e4
Rename project: f00bar -> yambar
2019-09-28 20:39:45 +02:00
Daniel Eklöf
5eef162d39
main: add -b,--backend command line option
...
This option allows the user to explicitly select the backend to
use. The default is still to auto-detect.
2019-05-11 10:53:09 +02:00
Daniel Eklöf
937a684f9e
main: add -c,--config command line option
...
This option tells f00bar to load the configuration from this file
instead of searching the default locations.
2019-05-09 19:31:34 +02:00
Daniel Eklöf
f6ed729cf3
main: rename --check-config -> --validate
2019-05-09 19:24:17 +02:00
Daniel Eklöf
cfc644ba49
main: move --check-config short option from -c to -C
2019-05-09 19:22:11 +02:00
Daniel Eklöf
55c5cfab46
main: add -c,--check-config
...
When this option is used, we exit after loading the
configuration. Either with an error message and a non-zero exit
code (bad config), or no messages and a zero exit code (good config).
2019-05-09 19:20:24 +02:00
Daniel Eklöf
87cf6ab10f
main: use getopt() to parse command line arguments
2019-05-09 19:04:11 +02:00
Daniel Eklöf
37fe45b0d2
main: add -v,--version command line option
2019-05-07 20:24:51 +02:00
Daniel Eklöf
8cc6e67c16
main: check return value of write()
...
Fixes build with -D_FORTIFY_SOURCE=2
2019-05-04 11:26:27 +02:00
Daniel Eklöf
63f7f6b3d8
main: get_config_path: look in XDG_CONFIG_HOME first
2019-04-29 18:55:08 +02:00
Daniel Eklöf
aba597d5cc
main: print error and exit when we fail to find a conf file
2019-04-29 18:47:21 +02:00
Daniel Eklöf
8c72d1f2a9
main: config: also support XDG_CONFIG_HOME/f00bar/config.yml
2019-02-12 20:53:09 +01:00
Daniel Eklöf
8b527e3fe5
main: load config from config.yml, not config-wayland.yml
2019-02-07 13:48:41 +01:00
Daniel Eklöf
ae5029826b
cmake: break out bar stuff to separate CMakeLists.txt
2019-02-07 12:06:16 +01:00
Daniel Eklöf
ed8e17c6c9
wayland: mucho wip: initial sort-of-working wayland backend
...
Bar is drawn, though only TOP is supported atm. No
screen/display/output selection is possible yet. Mouse *click* works,
but not setting the cursor.
Lots of debug output, crappy code yada yada.
2019-02-03 11:08:53 +01:00
Daniel Eklöf
785fe8bb0c
main: poll() return value is unused in release builds
...
Because it's only used in an assert()
2019-01-29 21:38:21 +01:00
Daniel Eklöf
deb9105d3e
main: move xcb_init() call to bar's XCB backend
2019-01-29 21:37:38 +01:00
Daniel Eklöf
9239d4298c
main: drop xcb dependency
...
Handle program termination by a) using a signal handler to detect
e.g. ctrl-c, and b) listening on the abort_fd to detect when the bar
aborts (e.g. due to XCB disconnect, i.e. when the X server dies).
2019-01-29 21:35:38 +01:00
Daniel Eklöf
314b43b4f0
main: initialize locale
...
This affects e.g. the clock module, which (by default) formats the
date according to the locale's preferred format.
2019-01-19 20:50:02 +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
dc7fde335e
main: refactor
2019-01-16 17:22:08 +01:00
Daniel Eklöf
b195c19599
bar: remove struct bar_run_context; store abort_fd in bar struct
2019-01-16 16:38:04 +01:00
Daniel Eklöf
a4ce3372ce
main: refactor
2019-01-16 16:34:59 +01:00
Daniel Eklöf
c18b5a1bbe
main: catch SIGTERM
...
And when exiting, log which signal we were killed by.
2019-01-09 18:50:26 +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
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
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
449210cc07
main: use bar's return value as exit value
2018-12-29 17:57:30 +01:00
Daniel Eklöf
10877d7c2e
main: error handling
2018-12-29 17:56:26 +01:00
Daniel Eklöf
825c5c82b5
main: load config file from ~/.config/f00bar/config.yml
2018-12-29 17:54:33 +01:00
Daniel Eklöf
c2e53a6bf7
main: no need for EFD_NONBLOCK
2018-12-28 12:41:21 +01:00
Daniel Eklöf
db2535bd72
main: remove ifdef
2018-12-13 19:05:52 +01:00
Daniel Eklöf
7c468c20c0
xcb: add xcb_init(): checks the x server + extensions, and caches atoms
2018-11-17 11:47:34 +01:00
Daniel Eklöf
8bf8a398b9
initial commit: wip
2018-11-17 11:30:33 +01:00