* Create default config and install to /etc/polybar
Closes#2405
* Search for config in /etc
We search in XDG_CONFIG_DIRS, /etc/xdg, and /etc but only for config.ini
Closes#2016
* Remove config installation from build.sh
* Remove userconfig cmake file
* Cleanup
* Cleanup default config
* Update CHANGELOG.md
Co-authored-by: dvermd <315743+dvermd@users.noreply.github.com>
* Update src/main.cpp
Co-authored-by: dvermd <315743+dvermd@users.noreply.github.com>
* Add tests for string functions
* Support loading bars from fallbacks in /etc
* Combine duplicate string_util::contains test
Co-authored-by: dvermd <315743+dvermd@users.noreply.github.com>
Each major target of polybar can now be enabled/disabled while
configuring (even polybar itself).
The cmake code specific to each target will only run if the target is
enabled.
This allows us to for example just build the documentation without
having to run all the cmake code related to compilation or having the
polybar dependencies installed (other than sphinx).
If we build only the documentation by invoking `cmake` on the `doc`
folder, the `SPHINX_BUILD` variable is not set and instead of
```
sphinx-build -b html ...
```
it will just execute
```
-b html ...
```
This produces an error but doesn't fail the build because apparently if
the command starts with a dash an error is non-fatal.
Fixes#2191
* Use GNUInstallDirs instead of hardcoded paths
This change should be a no-op in the normal case and at the same time make it
easier to customise polybar builds on systems with special needs.
* Avoid creating /usr/share/doc/polybar/polybar/*
* Include GNUInstallDirs for the doc target itself
* cmake: Don't try to set CMAKE_INSTALL_* variables
Since we include GNUInstallDirs all these variables are already set
* cmake: Print install directories in summary
* fix(cmake): Make doc-only work like normal build
This is kind of a dirty hack to force CMAKE_INSTALL_DOCDIR to use
`polybar` as the project name when only polybar-doc is built.
Maybe it is wiser at some point to be able to do a doc only build (and
install) that can be done from the top level project. Then we would also
not need to include GNUInstallDirs here
rtd scans the project for a conf.py file so we cannot name it conf.py.in
unless we get rtd to run cmake before building.
The easier option is to have doc/conf.py be the file used by rtd and all
other builds use cmake to first configure it.
This also moves the doc generation completely into cmake (no more
Makefile).
To generate the docs the project needs to first be configured and then
`make doc` can be run.
The approach used is leaned on the cmake's project own use of Sphinx:
Utilities/Sphinx/CMakeLists.txt