Commit Graph

120 Commits

Author SHA1 Message Date
Patrick Ziegler
8afd5b71df
Integrate bar taskqueue into eventloop (#2510)
* Remove DEBUG_SHADED

Was disabled by default AND behind an #if 0

* Make TimerHandle expose more libuv functions

* Prepare for moving double clicks into eventloop

* Make eventloop available to bar

* Remove bar mutex

Everything in the bar is now in the same thread

* Move double-click handling to eventloop

* Extract double click deferred function into method

* Stop throttling clicks

* Increase double click interval to 400 and add option

double-click-interval in the bar section

Closes #1441

* Implement dimming using timer handles

* Remove taskqueue

* Remove unused dependencies

* Cleanup & Comments
2021-09-27 17:35:45 +02:00
patrick96
85d308cec8 Use libuv >= 1.3.0 2021-09-21 20:36:23 +02:00
patrick96
74d8cf281c cmake: Fix FindLibUV 2021-09-21 20:36:23 +02:00
patrick96
249c3ec141 Use libuv for the controller's event loop 2021-09-21 20:36:23 +02:00
patrick96
c901826317 Use CMAKE_EXE_LINKER_FLAGS
The newere target_link_options is not supported by our minimum cmake
version (3.5)
2021-07-11 14:47:26 +02:00
patrick96
3652d5fe0d cmake: Stop using CMAKE_* variables for flags
It is not recommended anyway and the -Werror flag set in CI was getting
set when compiling gtest, breaking our build.
2021-07-11 14:47:26 +02:00
patrick96
43d754bd1d cmake: Add modules for curl and alsa
Older versions of cmake (e.g. in Ubuntu 18.04) did not provide cmake
modules for these libraries that also created a target.

Fixes #2393
2021-03-01 00:05:44 +01:00
patrick96
63819d62f0 cmake: Use set_target_properties for include dirs
target_include_directories for INTERFACE IMPORTED targets is only
supported since cmake 3.11

Fixes #2387

Ref: https://gitlab.kitware.com/cmake/cmake/-/issues/15689
2021-03-01 00:05:44 +01:00
Patrick Ziegler
d5be8cad97
Add compiler warning for missing override specifier (#2341)
* build: Add -Wsuggest-override

We should always use the override specifier when overriding virtual
functions. This helps prevent errors when a subclass tries to create a
function with the same name as a virtual function in a super-class but
with a different purpose.

* clang-format

* Upload logs on failure

* Add override to unsupported.hpp

* cmake: Make -Wsuggest-override flag conditional
2021-01-04 10:38:43 +01:00
patrick96
bb70b7c743 Cleanup 2020-12-24 02:20:38 +01:00
patrick96
3c51a1d955 cmake: Remove empty files 2020-12-24 02:20:38 +01:00
patrick96
74903d49a7 cmake: Mark checklib variables as advanced 2020-12-24 02:20:38 +01:00
patrick96
64e246e734 cmake: Add option to enable/disable shell files 2020-12-24 02:20:38 +01:00
patrick96
9d47b83697 cmake: Add option to enable/disable sample config 2020-12-24 02:20:38 +01:00
patrick96
ddfec6fc8f build: Add option to enable/disable html/manpages 2020-12-24 02:20:38 +01:00
patrick96
923d9ae061 Add cmake files for configuring individual targets
This makes the code a bit less messy. We barely need if(BUILD_...)
guards inside the cmake files, just the root CMakeLists.txt.
2020-12-24 02:20:38 +01:00
patrick96
c24a6999a4 refactor(cmake): Allow targets to be enabled individually
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).
2020-12-24 02:20:38 +01:00
patrick96
16b2970bd7 build: Bump cmake version to 3.5.0
This includes the changes from polybar/xpp#30 which also updates the
minimum cmake version in the xpp submodule
2020-12-24 02:20:38 +01:00
patrick96
1dc8d2f30e cmake: Make xrandr and xcomposite required
They were required before, but could technically be deactived (the
compilation would fail, but configuration was possible).

The WITH_XRANDR and WITH_XCOMPOSITE now no longer appear in the cmake
part. It still appears in the source code, but is always set to 1

Fixes #1536
2020-12-22 00:37:07 +01:00
patrick96
dc8d7fd0e0 Add documentation 2020-12-22 00:37:07 +01:00
patrick96
fd2edfdc08 cmake: Display package versions in summary 2020-12-22 00:37:07 +01:00
patrick96
84da909b47 Fix FindXcb not doing version checks for components
Version checks for FindXcb only make sense if all components have the
same version or only a single component is specified
2020-12-22 00:37:07 +01:00
patrick96
ade8b40b36 cmake: Fix find_package_handle_standard_args warning 2020-12-22 00:37:07 +01:00
Jérôme BOULMIER
cb0aeacbf2 refactoring find packages 2020-12-22 00:37:07 +01:00
Jérôme BOULMIER
b143e43491 enhancement(cmake): remove all mentions of "dirs" variable 2020-12-22 00:37:07 +01:00
Jérôme BOULMIER
31fafa86f7 feat(cmake): removing globs and using imported targets 2020-12-22 00:37:07 +01:00
patrick96
0b713047aa doc: Allow custom SPHINX_BUILD 2020-02-21 16:17:12 +01:00
patrick96
2b31a3f112 fix(backlight): Use 'brightness' with amdgpu_bl0
The amdgpu driver seems to set 'actual_brightness' wrong.

Fixes #1870
Ref: https://github.com/Alexays/Waybar/issues/335
2019-10-21 14:37:29 +02:00
patrick96
c6bc8a6ee6 build: Remove pulseaudio binary dependency check
The binary is not needed to compile and run polybar with pulseaudio
support. Though of course there is no use in having a pulse module when
you don't have pulseaudio installed.
2019-07-31 00:37:05 +02:00
Rune Morling
43556b5d92 cmake: Use GNUInstallDirs (#1818)
* 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
2019-06-24 18:08:59 +02:00
patrick96
a3e2e51ac9 build: remove xdamage extension
Unused

Ref: #1730
2019-06-03 00:46:12 +02:00
patrick96
38af08d29a build: remove xsync extension
Unused

Ref: #1730
2019-06-03 00:46:12 +02:00
patrick96
6ff2b2b37f build: remove xrender extension
Some build recipes (exherbo, sourcemage) for some reason enable this
even though it doesn't do anything any only causes compilation issues.

Ref: #1730
2019-06-03 00:46:12 +02:00
Jérôme BOULMIER
28b8877edc cleanup(cmake): remove useless variables (#1767)
They also caused a cmake warning when compiling with debug symbols
2019-05-17 16:51:16 +02:00
patrick96
9103d232a5 build: Remove -Werror
Whenever a new gcc version is released that introduces new warnings,
this breaks lots of builds on the user's side. This change pushes the
detection of these new warnings a bit back until either a user reports
warnings or developers get the new compiler updates. I think this is a
good tradeoff since release builds are no longer totally broken as soon
as a new compiler version comes out.

Travis still uses -Werror because there we actually want builds to fail.
2019-05-08 12:23:48 +02:00
patrick96
bfaeb71cb8 build: create config even when docs are disabled
Fixes #1733
2019-04-24 08:11:27 +02:00
patrick96
0251a80e75 build: Remove C compiler
There isn't a single .c file in the project. It just added bloat
2019-04-08 09:01:48 +02:00
patrick96
a67b824e25 cmake: Make Release default build type
The polybar executable with RelWithDebInfo gets over 100MB. And there
really isn't any reason to have users install such huge executables.

Release build type gives you approx. 3.6M executables

Fixes #1497
2019-04-08 09:01:48 +02:00
Jérôme BOULMIER
627c4ac2af fix(brightness): reading brightness in actual_brightness (#1689)
As the kernel documentation said:
https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-class-backlight

    This file will also show the brightness level stored in the driver, which may not be the actual brightness (see actual_brightness).

Therefore the brightness value should be read in the actual_brightness file.

Fix #1180
2019-04-07 17:04:55 +02:00
patrick96
5b7bb2514e refactor(doc): Enable only if sphinx is available 2019-04-05 23:43:37 +02:00
patrick96
73de9257a1 refactor(cmake): Remove unused querybin 2019-04-05 23:43:37 +02:00
patrick96
754673bff8 refactor(cmake): Make documentation optional 2019-04-05 23:43:37 +02:00
patrick96
3596001de1 refactor(cmake): Add version information to summary 2019-04-05 23:43:37 +02:00
patrick96
9aefbd5d34 build: Add UndefinedBehaviorSanitizer 2019-01-20 15:12:22 +01:00
NBonaparte
35c0c4a343 fix(xcb): check for composite extension (#1430)
* fix(xcb): check for composite extension

* fix(travis): add xcb-composite to deps

* fix(xcb): always include composite when building
2018-12-02 16:39:14 +01:00
sam-lunt
d3e37918e5 CMake refactor (#1510)
* Clean up CMake logic

- removed logic to find CppUnit (no longer used)
- removed "dirs" variable used to pass include directories
- removed add_library function (no longer used)
- removed make_executable function
    * only used in 2 places (polybar and polybar-msg)
    * it was more general than needed, logic is simpler without it
- split polybar into static library and executable
    * this allows linking unit tests to the library

* rename library

* add coverage build

- Added a CMake build type "Coverage" that builds C and C++
  code with the "--coverage" flag (recognized by both GCC and Clang)
- removed "-Wno-missing-field-initializers" from test flags,
  since it didn't seem to be needed any more
- removed logic from tests/CMakeLists to disable "-Werror" and "-pedantic-errors"
  since there didn't seem to be any warnings during the build

* fix whitespace

* update travis

* remove O2 from defalt flags

* allow tests to be built by default make target

* disable Werror for debug builds
2018-11-21 18:46:33 +01:00
patrick96
a881d49d9d doc(net): Indicate the wireless library used
This helps us to more easily debug network issues because before it
wasn't clear if a user had built polybar with the libnl or libiw
adapter
2018-09-18 15:29:05 -07:00
Andre Schröder
b632e7da38 fix(cmake): Use name of found font (#1350)
Before queryfont would never change the name of the font, this ensure that it is propery updated in the caller's scope
2018-08-07 17:04:42 +02:00
taschenb
3afc341c7b feat(net): Add nl80211 support (#1009)
This patch enables support for nl80211. In case the libnl-genl-3.0
library isn't found, it will fall back to Wext instead.
The library to use can also be manually set with the CMake option
WITH_LIBNL.

The Wireless-Extensions (WE or Wext) are deprecated and long replaced
by cfg80211.

Although Wext isn't used by WiFi drivers anymore, CFG80211_WEXT allows
old tools to communicate with modern drivers by providing a wrapper
API.
2018-06-18 20:16:09 -07:00
patrick96
6157c697bc refactor(build): List xkeyboard in cmake and polybar -v 2018-06-18 11:49:31 +02:00