From 5434e33b805776f79f5e5d879f15e64deff3081d Mon Sep 17 00:00:00 2001 From: Samuel Henrique Date: Mon, 6 Nov 2023 09:36:52 +0000 Subject: [PATCH] Import polybar_3.7.0.orig.tar.gz [dgit import orig polybar_3.7.0.orig.tar.gz] --- .clang-format | 14 + .clang-tidy | 52 + .editorconfig | 15 + .github/FUNDING.yml | 2 + .github/ISSUE_TEMPLATE/bug_report.yml | 112 + .github/ISSUE_TEMPLATE/config.yml | 11 + .github/PULL_REQUEST_TEMPLATE.md | 26 + .github/codecov.yml | 21 + .github/workflows/ci.yml | 160 + .github/workflows/release.yml | 105 + .gitignore | 17 + .gitmodules | 8 + .readthedocs.yaml | 22 + .valgrind-suppressions | 101 + CHANGELOG.md | 260 ++ CMakeLists.txt | 77 + CONTRIBUTING.md | 169 + LICENSE | 19 + README.md | 242 ++ SUPPORT.md | 34 + build.sh | 258 ++ cmake/01-core.cmake | 45 + cmake/02-opts.cmake | 24 + cmake/04-targets.cmake | 74 + cmake/05-summary.cmake | 60 + cmake/common/utils.cmake | 116 + cmake/cxx.cmake | 108 + cmake/libpoly.cmake | 106 + cmake/modules/FindALSA.cmake | 14 + cmake/modules/FindCURL.cmake | 14 + cmake/modules/FindCairoFC.cmake | 14 + cmake/modules/FindLibInotify.cmake | 14 + cmake/modules/FindLibMPDClient.cmake | 14 + cmake/modules/FindLibNlGenl3.cmake | 14 + cmake/modules/FindLibPulse.cmake | 14 + cmake/modules/FindLibUV.cmake | 13 + cmake/modules/FindLibiw.cmake | 21 + cmake/modules/FindXcb.cmake | 59 + cmake/templates/uninstall.cmake.in | 23 + common/ci/configure.sh | 45 + common/ci/summary.sh | 19 + common/clang-tidy.sh | 26 + common/file-runner.py | 50 + contrib/bash/CMakeLists.txt | 6 + contrib/bash/polybar | 107 + contrib/polybar-git.aur/PKGBUILD | 42 + contrib/vim/autoload/ft/cpphpp.vim | 19 + contrib/vim/ftplugin/cpp.vim | 8 + contrib/vim/ftplugin/dosini.vim | 11 + contrib/zsh/CMakeLists.txt | 6 + contrib/zsh/_polybar | 61 + contrib/zsh/_polybar_msg | 32 + doc/.gitignore | 1 + doc/CMakeLists.txt | 80 + doc/README.md | 19 + doc/_static/.gitignore | 0 doc/_static/banner-dark-mode.png | Bin 0 -> 10513 bytes doc/_static/banner.png | Bin 0 -> 12078 bytes doc/_static/default.png | Bin 0 -> 18104 bytes doc/_static/nerd-fonts/bad.png | Bin 0 -> 9388 bytes doc/_static/nerd-fonts/good.png | Bin 0 -> 9323 bytes doc/_templates/layout.html | 26 + doc/conf.py | 354 ++ doc/config.ini | 176 + doc/dev/getting-started.rst | 41 + doc/dev/packaging.rst | 87 + doc/dev/release-workflow.rst | 273 ++ doc/dev/style-guide.rst | 75 + doc/dev/testing.rst | 26 + doc/index.rst | 52 + doc/man/polybar-msg.1.rst | 75 + doc/man/polybar.1.rst | 92 + doc/man/polybar.5.rst | 184 + doc/migration/3.7/index.rst | 40 + doc/migration/3.7/tray.rst | 57 + doc/migration/index.rst | 24 + doc/requirements.txt | 7 + doc/user/actions.rst | 457 +++ doc/user/default-config.rst | 16 + doc/user/fonts/index.rst | 8 + doc/user/fonts/nerd-fonts.rst | 54 + doc/user/ipc.rst | 120 + doc/user/modules/defs.rst | 13 + doc/user/modules/index.rst | 31 + doc/user/modules/tray.rst | 116 + include/CMakeLists.txt | 15 + include/adapters/alsa/control.hpp | 41 + include/adapters/alsa/generic.hpp | 25 + include/adapters/alsa/mixer.hpp | 50 + include/adapters/mpd.hpp | 182 + include/adapters/net.hpp | 191 + include/adapters/pulseaudio.hpp | 87 + include/adapters/script_runner.hpp | 59 + include/cairo/context.hpp | 392 +++ include/cairo/font.hpp | 342 ++ include/cairo/fwd.hpp | 15 + include/cairo/surface.hpp | 76 + include/cairo/types.hpp | 77 + include/cairo/utils.hpp | 47 + include/common.hpp | 53 + include/components/bar.hpp | 120 + include/components/builder.hpp | 69 + include/components/command_line.hpp | 78 + include/components/config.hpp | 272 ++ include/components/config_parser.hpp | 258 ++ include/components/controller.hpp | 155 + include/components/eventloop.hpp | 459 +++ include/components/logger.hpp | 164 + include/components/renderer.hpp | 141 + include/components/renderer_interface.hpp | 45 + include/components/screen.hpp | 55 + include/components/types.hpp | 293 ++ include/debug.hpp | 51 + include/drawtypes/animation.hpp | 47 + include/drawtypes/iconset.hpp | 26 + include/drawtypes/label.hpp | 87 + include/drawtypes/layouticonset.hpp | 33 + include/drawtypes/progressbar.hpp | 45 + include/drawtypes/ramp.hpp | 33 + include/errors.hpp | 34 + include/events/signal.hpp | 113 + include/events/signal_emitter.hpp | 107 + include/events/signal_fwd.hpp | 43 + include/events/signal_receiver.hpp | 52 + include/ipc/decoder.hpp | 61 + include/ipc/encoder.hpp | 14 + include/ipc/ipc.hpp | 97 + include/ipc/msg.hpp | 85 + include/ipc/util.hpp | 16 + include/modules/alsa.hpp | 77 + include/modules/backlight.hpp | 77 + include/modules/battery.hpp | 121 + include/modules/bspwm.hpp | 104 + include/modules/counter.hpp | 25 + include/modules/cpu.hpp | 60 + include/modules/date.hpp | 51 + include/modules/fs.hpp | 78 + include/modules/github.hpp | 45 + include/modules/i3.hpp | 105 + include/modules/ipc.hpp | 75 + include/modules/memory.hpp | 53 + include/modules/menu.hpp | 53 + include/modules/meta/all.hpp | 45 + include/modules/meta/base.hpp | 230 ++ include/modules/meta/base.inl | 313 ++ include/modules/meta/event_handler.hpp | 33 + include/modules/meta/event_module.hpp | 46 + include/modules/meta/factory.hpp | 25 + include/modules/meta/inotify_module.hpp | 89 + include/modules/meta/static_module.hpp | 25 + include/modules/meta/timer_module.hpp | 78 + include/modules/meta/types.hpp | 37 + include/modules/mpd.hpp | 120 + include/modules/network.hpp | 62 + include/modules/pulseaudio.hpp | 61 + include/modules/script.hpp | 54 + include/modules/temperature.hpp | 46 + include/modules/text.hpp | 29 + include/modules/tray.hpp | 29 + include/modules/xbacklight.hpp | 65 + include/modules/xkeyboard.hpp | 75 + include/modules/xwindow.hpp | 59 + include/modules/xworkspaces.hpp | 113 + include/settings.hpp.cmake | 76 + include/tags/action_context.hpp | 136 + include/tags/context.hpp | 90 + include/tags/dispatch.hpp | 47 + include/tags/parser.hpp | 159 + include/tags/types.hpp | 119 + include/utils/action_router.hpp | 60 + include/utils/actions.hpp | 32 + include/utils/bspwm.hpp | 30 + include/utils/color.hpp | 69 + include/utils/command.hpp | 106 + include/utils/concurrency.hpp | 41 + include/utils/env.hpp | 12 + include/utils/factory.hpp | 17 + include/utils/file.hpp | 103 + include/utils/http.hpp | 23 + include/utils/i3.hpp | 35 + include/utils/inotify.hpp | 44 + include/utils/io.hpp | 14 + include/utils/math.hpp | 105 + include/utils/memory.hpp | 12 + include/utils/mixins.hpp | 33 + include/utils/process.hpp | 32 + include/utils/restack.hpp | 23 + include/utils/scope.hpp | 33 + include/utils/socket.hpp | 47 + include/utils/string.hpp | 106 + include/utils/time.hpp | 23 + include/utils/units.hpp | 34 + include/x11/atoms.hpp | 52 + include/x11/background_manager.hpp | 155 + include/x11/connection.hpp | 147 + include/x11/cursor.hpp | 29 + include/x11/ewmh.hpp | 61 + include/x11/extensions/all.hpp | 13 + include/x11/extensions/composite.hpp | 23 + include/x11/extensions/fwd.hpp | 21 + include/x11/extensions/randr.hpp | 67 + include/x11/extensions/xkb.hpp | 98 + include/x11/icccm.hpp | 21 + include/x11/legacy_tray_manager.hpp | 237 ++ include/x11/registry.hpp | 25 + include/x11/tray_client.hpp | 137 + include/x11/tray_manager.hpp | 212 ++ include/x11/types.hpp | 84 + include/x11/window.hpp | 24 + include/x11/winspec.hpp | 180 + include/x11/xembed.hpp | 63 + include/x11/xresources.hpp | 64 + lib/CMakeLists.txt | 38 + lib/i3ipcpp/.gitignore | 4 + lib/i3ipcpp/3rd/auss/LICENSE | 24 + lib/i3ipcpp/3rd/auss/README.md | 27 + lib/i3ipcpp/3rd/auss/include/auss.hpp | 47 + lib/i3ipcpp/CHANGELOG | 33 + lib/i3ipcpp/CMakeLists.txt | 65 + lib/i3ipcpp/Doxyfile | 2353 +++++++++++++ lib/i3ipcpp/LICENSE | 22 + lib/i3ipcpp/README.md | 129 + lib/i3ipcpp/examples/CMakeLists.txt | 23 + lib/i3ipcpp/examples/bar-configs.cpp | 43 + lib/i3ipcpp/examples/events.cpp | 46 + lib/i3ipcpp/examples/workspaces.cpp | 64 + lib/i3ipcpp/include/i3ipc++/ipc-util.hpp | 174 + lib/i3ipcpp/include/i3ipc++/ipc.hpp | 383 ++ lib/i3ipcpp/include/i3ipc++/log.hpp | 96 + lib/i3ipcpp/src/ipc-util.cpp | 167 + lib/i3ipcpp/src/ipc.cpp | 631 ++++ lib/i3ipcpp/test/test_ipc.hpp | 28 + lib/xpp/.gitignore | 7 + lib/xpp/CMakeLists.txt | 199 ++ lib/xpp/LICENSE | 8 + lib/xpp/README.md | 313 ++ lib/xpp/cmake/FindXCB.cmake | 254 ++ lib/xpp/generators/TODO | 53 + lib/xpp/generators/accessor.py | 126 + lib/xpp/generators/cpp_client.py | 3125 +++++++++++++++++ lib/xpp/generators/cppcookie.py | 202 ++ lib/xpp/generators/cpperror.py | 221 ++ lib/xpp/generators/cppevent.py | 380 ++ lib/xpp/generators/cppreply.py | 138 + lib/xpp/generators/cpprequest.py | 197 ++ lib/xpp/generators/extensionclass.py | 45 + lib/xpp/generators/interfaceclass.py | 86 + lib/xpp/generators/objectclass.py | 69 + lib/xpp/generators/parameter.py | 269 ++ lib/xpp/generators/resource_classes.py | 81 + lib/xpp/generators/utils.py | 64 + lib/xpp/include/xpp/atom.hpp | 34 + lib/xpp/include/xpp/colormap.hpp | 77 + lib/xpp/include/xpp/connection.hpp | 157 + lib/xpp/include/xpp/core.hpp | 325 ++ lib/xpp/include/xpp/cursor.hpp | 142 + lib/xpp/include/xpp/drawable.hpp | 35 + lib/xpp/include/xpp/event.hpp | 215 ++ lib/xpp/include/xpp/flags.makefile | 40 + lib/xpp/include/xpp/font.hpp | 74 + lib/xpp/include/xpp/fontable.hpp | 35 + lib/xpp/include/xpp/gcontext.hpp | 114 + lib/xpp/include/xpp/generic.hpp | 15 + lib/xpp/include/xpp/generic/error.hpp | 96 + lib/xpp/include/xpp/generic/event.hpp | 45 + lib/xpp/include/xpp/generic/extension.hpp | 59 + lib/xpp/include/xpp/generic/factory.hpp | 92 + .../xpp/generic/input_iterator_adapter.hpp | 163 + .../include/xpp/generic/iterator_traits.hpp | 24 + .../include/xpp/generic/reply_iterator.hpp | 376 ++ lib/xpp/include/xpp/generic/request.hpp | 129 + lib/xpp/include/xpp/generic/resource.hpp | 142 + lib/xpp/include/xpp/generic/signature.hpp | 16 + lib/xpp/include/xpp/pixmap.hpp | 78 + lib/xpp/include/xpp/valueparam.hpp | 50 + lib/xpp/include/xpp/window.hpp | 91 + lib/xpp/include/xpp/xpp.hpp | 19 + lib/xpp/src/examples/Makefile | 14 + lib/xpp/src/examples/demo_01.cpp | 138 + lib/xpp/src/examples/demo_02.cpp | 229 ++ lib/xpp/src/tests/.gitignore | 2 + lib/xpp/src/tests/Makefile | 25 + lib/xpp/src/tests/README.md | 2 + lib/xpp/src/tests/callable.cpp | 83 + lib/xpp/src/tests/error_test.cpp | 497 +++ lib/xpp/src/tests/event.cpp | 125 + lib/xpp/src/tests/iterator.cpp | 155 + lib/xpp/src/tests/requests.cpp | 910 +++++ lib/xpp/src/tests/resource.cpp | 49 + lib/xpp/src/tests/sizeof.cpp | 767 ++++ lib/xpp/src/tests/template.cpp | 101 + lib/xpp/src/tests/test.cpp | 1255 +++++++ lib/xpp/src/tests/xlib-test.cpp | 33 + lib/xpp/src/tests/xlib.cpp | 30 + lib/xpp/src/tests/xproto.cpp | 870 +++++ lib/xpp/src/xpp.cpp | 1 + src/CMakeLists.txt | 246 ++ src/adapters/alsa/control.cpp | 121 + src/adapters/alsa/mixer.cpp | 232 ++ src/adapters/mpd.cpp | 493 +++ src/adapters/net.cpp | 440 +++ src/adapters/net_iw.cpp | 137 + src/adapters/net_nl.cpp | 232 ++ src/adapters/pulseaudio.cpp | 344 ++ src/adapters/script_runner.cpp | 181 + src/cairo/utils.cpp | 88 + src/components/bar.cpp | 961 +++++ src/components/builder.cpp | 500 +++ src/components/command_line.cpp | 203 ++ src/components/config.cpp | 466 +++ src/components/config_parser.cpp | 333 ++ src/components/controller.cpp | 767 ++++ src/components/eventloop.cpp | 306 ++ src/components/logger.cpp | 100 + src/components/renderer.cpp | 852 +++++ src/components/screen.cpp | 149 + src/drawtypes/animation.cpp | 63 + src/drawtypes/iconset.cpp | 51 + src/drawtypes/label.cpp | 324 ++ src/drawtypes/layouticonset.cpp | 99 + src/drawtypes/progressbar.cpp | 137 + src/drawtypes/ramp.cpp | 83 + src/events/signal_emitter.cpp | 15 + src/events/signal_receiver.cpp | 1 + src/ipc/decoder.cpp | 135 + src/ipc/encoder.cpp | 33 + src/ipc/ipc.cpp | 220 ++ src/ipc/util.cpp | 71 + src/main.cpp | 181 + src/modules/alsa.cpp | 299 ++ src/modules/backlight.cpp | 189 + src/modules/battery.cpp | 395 +++ src/modules/bspwm.cpp | 510 +++ src/modules/counter.cpp | 30 + src/modules/cpu.cpp | 184 + src/modules/date.cpp | 95 + src/modules/fs.cpp | 217 ++ src/modules/github.cpp | 135 + src/modules/i3.cpp | 284 ++ src/modules/ipc.cpp | 261 ++ src/modules/memory.cpp | 178 + src/modules/menu.cpp | 157 + src/modules/meta/base.cpp | 186 + src/modules/meta/factory.cpp | 124 + src/modules/mpd.cpp | 453 +++ src/modules/network.cpp | 233 ++ src/modules/pulseaudio.cpp | 171 + src/modules/script.cpp | 161 + src/modules/temperature.cpp | 133 + src/modules/text.cpp | 82 + src/modules/tray.cpp | 36 + src/modules/xbacklight.cpp | 169 + src/modules/xkeyboard.cpp | 324 ++ src/modules/xwindow.cpp | 151 + src/modules/xworkspaces.cpp | 450 +++ src/polybar-msg.cpp | 294 ++ src/settings.cpp.cmake | 63 + src/tags/action_context.cpp | 130 + src/tags/context.cpp | 124 + src/tags/dispatch.cpp | 172 + src/tags/parser.cpp | 509 +++ src/utils/action_router.cpp | 45 + src/utils/actions.cpp | 59 + src/utils/bspwm.cpp | 127 + src/utils/color.cpp | 199 ++ src/utils/command.cpp | 218 ++ src/utils/concurrency.cpp | 19 + src/utils/env.cpp | 21 + src/utils/file.cpp | 367 ++ src/utils/http.cpp | 59 + src/utils/i3.cpp | 76 + src/utils/inotify.cpp | 130 + src/utils/io.cpp | 39 + src/utils/process.cpp | 204 ++ src/utils/restack.cpp | 109 + src/utils/socket.cpp | 120 + src/utils/string.cpp | 463 +++ src/utils/units.cpp | 165 + src/x11/atoms.cpp | 86 + src/x11/background_manager.cpp | 282 ++ src/x11/connection.cpp | 228 ++ src/x11/cursor.cpp | 43 + src/x11/ewmh.cpp | 231 ++ src/x11/extensions/composite.cpp | 20 + src/x11/extensions/randr.cpp | 275 ++ src/x11/extensions/xkb.cpp | 205 ++ src/x11/icccm.cpp | 66 + src/x11/legacy_tray_manager.cpp | 1298 +++++++ src/x11/registry.cpp | 11 + src/x11/tray_client.cpp | 374 ++ src/x11/tray_manager.cpp | 773 ++++ src/x11/window.cpp | 80 + src/x11/winspec.cpp | 139 + src/x11/xembed.cpp | 127 + src/x11/xresources.cpp | 17 + tests/CMakeLists.txt | 78 + tests/CMakeLists.txt.in | 15 + tests/common/test.hpp | 3 + tests/unit_tests/components/builder.cpp | 142 + tests/unit_tests/components/command_line.cpp | 113 + tests/unit_tests/components/config_parser.cpp | 314 ++ tests/unit_tests/drawtypes/iconset.cpp | 41 + tests/unit_tests/drawtypes/label.cpp | 109 + tests/unit_tests/drawtypes/layouticonset.cpp | 76 + tests/unit_tests/drawtypes/ramp.cpp | 49 + tests/unit_tests/ipc/decoder.cpp | 96 + tests/unit_tests/ipc/encoder.cpp | 58 + tests/unit_tests/ipc/util.cpp | 22 + tests/unit_tests/tags/action_context.cpp | 168 + tests/unit_tests/tags/dispatch.cpp | 270 ++ tests/unit_tests/tags/parser.cpp | 495 +++ tests/unit_tests/utils/action_router.cpp | 49 + tests/unit_tests/utils/actions.cpp | 72 + tests/unit_tests/utils/color.cpp | 141 + tests/unit_tests/utils/command.cpp | 49 + tests/unit_tests/utils/env.cpp | 27 + tests/unit_tests/utils/file.cpp | 46 + tests/unit_tests/utils/math.cpp | 74 + tests/unit_tests/utils/process.cpp | 44 + tests/unit_tests/utils/scope.cpp | 20 + tests/unit_tests/utils/string.cpp | 286 ++ tests/unit_tests/utils/units.cpp | 133 + version.txt | 4 + 423 files changed, 59340 insertions(+) create mode 100644 .clang-format create mode 100644 .clang-tidy create mode 100644 .editorconfig create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/codecov.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .readthedocs.yaml create mode 100644 .valgrind-suppressions create mode 100644 CHANGELOG.md create mode 100644 CMakeLists.txt create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 SUPPORT.md create mode 100755 build.sh create mode 100644 cmake/01-core.cmake create mode 100644 cmake/02-opts.cmake create mode 100644 cmake/04-targets.cmake create mode 100644 cmake/05-summary.cmake create mode 100644 cmake/common/utils.cmake create mode 100644 cmake/cxx.cmake create mode 100644 cmake/libpoly.cmake create mode 100644 cmake/modules/FindALSA.cmake create mode 100644 cmake/modules/FindCURL.cmake create mode 100644 cmake/modules/FindCairoFC.cmake create mode 100644 cmake/modules/FindLibInotify.cmake create mode 100644 cmake/modules/FindLibMPDClient.cmake create mode 100644 cmake/modules/FindLibNlGenl3.cmake create mode 100644 cmake/modules/FindLibPulse.cmake create mode 100644 cmake/modules/FindLibUV.cmake create mode 100644 cmake/modules/FindLibiw.cmake create mode 100644 cmake/modules/FindXcb.cmake create mode 100644 cmake/templates/uninstall.cmake.in create mode 100755 common/ci/configure.sh create mode 100755 common/ci/summary.sh create mode 100755 common/clang-tidy.sh create mode 100755 common/file-runner.py create mode 100644 contrib/bash/CMakeLists.txt create mode 100644 contrib/bash/polybar create mode 100644 contrib/polybar-git.aur/PKGBUILD create mode 100644 contrib/vim/autoload/ft/cpphpp.vim create mode 100644 contrib/vim/ftplugin/cpp.vim create mode 100644 contrib/vim/ftplugin/dosini.vim create mode 100644 contrib/zsh/CMakeLists.txt create mode 100644 contrib/zsh/_polybar create mode 100644 contrib/zsh/_polybar_msg create mode 100644 doc/.gitignore create mode 100644 doc/CMakeLists.txt create mode 100644 doc/README.md create mode 100644 doc/_static/.gitignore create mode 100644 doc/_static/banner-dark-mode.png create mode 100644 doc/_static/banner.png create mode 100644 doc/_static/default.png create mode 100644 doc/_static/nerd-fonts/bad.png create mode 100644 doc/_static/nerd-fonts/good.png create mode 100644 doc/_templates/layout.html create mode 100644 doc/conf.py create mode 100644 doc/config.ini create mode 100644 doc/dev/getting-started.rst create mode 100644 doc/dev/packaging.rst create mode 100644 doc/dev/release-workflow.rst create mode 100644 doc/dev/style-guide.rst create mode 100644 doc/dev/testing.rst create mode 100644 doc/index.rst create mode 100644 doc/man/polybar-msg.1.rst create mode 100644 doc/man/polybar.1.rst create mode 100644 doc/man/polybar.5.rst create mode 100644 doc/migration/3.7/index.rst create mode 100644 doc/migration/3.7/tray.rst create mode 100644 doc/migration/index.rst create mode 100644 doc/requirements.txt create mode 100644 doc/user/actions.rst create mode 100644 doc/user/default-config.rst create mode 100644 doc/user/fonts/index.rst create mode 100644 doc/user/fonts/nerd-fonts.rst create mode 100644 doc/user/ipc.rst create mode 100644 doc/user/modules/defs.rst create mode 100644 doc/user/modules/index.rst create mode 100644 doc/user/modules/tray.rst create mode 100644 include/CMakeLists.txt create mode 100644 include/adapters/alsa/control.hpp create mode 100644 include/adapters/alsa/generic.hpp create mode 100644 include/adapters/alsa/mixer.hpp create mode 100644 include/adapters/mpd.hpp create mode 100644 include/adapters/net.hpp create mode 100644 include/adapters/pulseaudio.hpp create mode 100644 include/adapters/script_runner.hpp create mode 100644 include/cairo/context.hpp create mode 100644 include/cairo/font.hpp create mode 100644 include/cairo/fwd.hpp create mode 100644 include/cairo/surface.hpp create mode 100644 include/cairo/types.hpp create mode 100644 include/cairo/utils.hpp create mode 100644 include/common.hpp create mode 100644 include/components/bar.hpp create mode 100644 include/components/builder.hpp create mode 100644 include/components/command_line.hpp create mode 100644 include/components/config.hpp create mode 100644 include/components/config_parser.hpp create mode 100644 include/components/controller.hpp create mode 100644 include/components/eventloop.hpp create mode 100644 include/components/logger.hpp create mode 100644 include/components/renderer.hpp create mode 100644 include/components/renderer_interface.hpp create mode 100644 include/components/screen.hpp create mode 100644 include/components/types.hpp create mode 100644 include/debug.hpp create mode 100644 include/drawtypes/animation.hpp create mode 100644 include/drawtypes/iconset.hpp create mode 100644 include/drawtypes/label.hpp create mode 100644 include/drawtypes/layouticonset.hpp create mode 100644 include/drawtypes/progressbar.hpp create mode 100644 include/drawtypes/ramp.hpp create mode 100644 include/errors.hpp create mode 100644 include/events/signal.hpp create mode 100644 include/events/signal_emitter.hpp create mode 100644 include/events/signal_fwd.hpp create mode 100644 include/events/signal_receiver.hpp create mode 100644 include/ipc/decoder.hpp create mode 100644 include/ipc/encoder.hpp create mode 100644 include/ipc/ipc.hpp create mode 100644 include/ipc/msg.hpp create mode 100644 include/ipc/util.hpp create mode 100644 include/modules/alsa.hpp create mode 100644 include/modules/backlight.hpp create mode 100644 include/modules/battery.hpp create mode 100644 include/modules/bspwm.hpp create mode 100644 include/modules/counter.hpp create mode 100644 include/modules/cpu.hpp create mode 100644 include/modules/date.hpp create mode 100644 include/modules/fs.hpp create mode 100644 include/modules/github.hpp create mode 100644 include/modules/i3.hpp create mode 100644 include/modules/ipc.hpp create mode 100644 include/modules/memory.hpp create mode 100644 include/modules/menu.hpp create mode 100644 include/modules/meta/all.hpp create mode 100644 include/modules/meta/base.hpp create mode 100644 include/modules/meta/base.inl create mode 100644 include/modules/meta/event_handler.hpp create mode 100644 include/modules/meta/event_module.hpp create mode 100644 include/modules/meta/factory.hpp create mode 100644 include/modules/meta/inotify_module.hpp create mode 100644 include/modules/meta/static_module.hpp create mode 100644 include/modules/meta/timer_module.hpp create mode 100644 include/modules/meta/types.hpp create mode 100644 include/modules/mpd.hpp create mode 100644 include/modules/network.hpp create mode 100644 include/modules/pulseaudio.hpp create mode 100644 include/modules/script.hpp create mode 100644 include/modules/temperature.hpp create mode 100644 include/modules/text.hpp create mode 100644 include/modules/tray.hpp create mode 100644 include/modules/xbacklight.hpp create mode 100644 include/modules/xkeyboard.hpp create mode 100644 include/modules/xwindow.hpp create mode 100644 include/modules/xworkspaces.hpp create mode 100644 include/settings.hpp.cmake create mode 100644 include/tags/action_context.hpp create mode 100644 include/tags/context.hpp create mode 100644 include/tags/dispatch.hpp create mode 100644 include/tags/parser.hpp create mode 100644 include/tags/types.hpp create mode 100644 include/utils/action_router.hpp create mode 100644 include/utils/actions.hpp create mode 100644 include/utils/bspwm.hpp create mode 100644 include/utils/color.hpp create mode 100644 include/utils/command.hpp create mode 100644 include/utils/concurrency.hpp create mode 100644 include/utils/env.hpp create mode 100644 include/utils/factory.hpp create mode 100644 include/utils/file.hpp create mode 100644 include/utils/http.hpp create mode 100644 include/utils/i3.hpp create mode 100644 include/utils/inotify.hpp create mode 100644 include/utils/io.hpp create mode 100644 include/utils/math.hpp create mode 100644 include/utils/memory.hpp create mode 100644 include/utils/mixins.hpp create mode 100644 include/utils/process.hpp create mode 100644 include/utils/restack.hpp create mode 100644 include/utils/scope.hpp create mode 100644 include/utils/socket.hpp create mode 100644 include/utils/string.hpp create mode 100644 include/utils/time.hpp create mode 100644 include/utils/units.hpp create mode 100644 include/x11/atoms.hpp create mode 100644 include/x11/background_manager.hpp create mode 100644 include/x11/connection.hpp create mode 100644 include/x11/cursor.hpp create mode 100644 include/x11/ewmh.hpp create mode 100644 include/x11/extensions/all.hpp create mode 100644 include/x11/extensions/composite.hpp create mode 100644 include/x11/extensions/fwd.hpp create mode 100644 include/x11/extensions/randr.hpp create mode 100644 include/x11/extensions/xkb.hpp create mode 100644 include/x11/icccm.hpp create mode 100644 include/x11/legacy_tray_manager.hpp create mode 100644 include/x11/registry.hpp create mode 100644 include/x11/tray_client.hpp create mode 100644 include/x11/tray_manager.hpp create mode 100644 include/x11/types.hpp create mode 100644 include/x11/window.hpp create mode 100644 include/x11/winspec.hpp create mode 100644 include/x11/xembed.hpp create mode 100644 include/x11/xresources.hpp create mode 100644 lib/CMakeLists.txt create mode 100644 lib/i3ipcpp/.gitignore create mode 100644 lib/i3ipcpp/3rd/auss/LICENSE create mode 100644 lib/i3ipcpp/3rd/auss/README.md create mode 100644 lib/i3ipcpp/3rd/auss/include/auss.hpp create mode 100644 lib/i3ipcpp/CHANGELOG create mode 100644 lib/i3ipcpp/CMakeLists.txt create mode 100644 lib/i3ipcpp/Doxyfile create mode 100644 lib/i3ipcpp/LICENSE create mode 100644 lib/i3ipcpp/README.md create mode 100644 lib/i3ipcpp/examples/CMakeLists.txt create mode 100644 lib/i3ipcpp/examples/bar-configs.cpp create mode 100644 lib/i3ipcpp/examples/events.cpp create mode 100644 lib/i3ipcpp/examples/workspaces.cpp create mode 100644 lib/i3ipcpp/include/i3ipc++/ipc-util.hpp create mode 100644 lib/i3ipcpp/include/i3ipc++/ipc.hpp create mode 100644 lib/i3ipcpp/include/i3ipc++/log.hpp create mode 100644 lib/i3ipcpp/src/ipc-util.cpp create mode 100644 lib/i3ipcpp/src/ipc.cpp create mode 100644 lib/i3ipcpp/test/test_ipc.hpp create mode 100644 lib/xpp/.gitignore create mode 100644 lib/xpp/CMakeLists.txt create mode 100644 lib/xpp/LICENSE create mode 100644 lib/xpp/README.md create mode 100644 lib/xpp/cmake/FindXCB.cmake create mode 100644 lib/xpp/generators/TODO create mode 100644 lib/xpp/generators/accessor.py create mode 100644 lib/xpp/generators/cpp_client.py create mode 100644 lib/xpp/generators/cppcookie.py create mode 100644 lib/xpp/generators/cpperror.py create mode 100644 lib/xpp/generators/cppevent.py create mode 100644 lib/xpp/generators/cppreply.py create mode 100644 lib/xpp/generators/cpprequest.py create mode 100644 lib/xpp/generators/extensionclass.py create mode 100644 lib/xpp/generators/interfaceclass.py create mode 100644 lib/xpp/generators/objectclass.py create mode 100644 lib/xpp/generators/parameter.py create mode 100644 lib/xpp/generators/resource_classes.py create mode 100644 lib/xpp/generators/utils.py create mode 100644 lib/xpp/include/xpp/atom.hpp create mode 100644 lib/xpp/include/xpp/colormap.hpp create mode 100644 lib/xpp/include/xpp/connection.hpp create mode 100644 lib/xpp/include/xpp/core.hpp create mode 100644 lib/xpp/include/xpp/cursor.hpp create mode 100644 lib/xpp/include/xpp/drawable.hpp create mode 100644 lib/xpp/include/xpp/event.hpp create mode 100644 lib/xpp/include/xpp/flags.makefile create mode 100644 lib/xpp/include/xpp/font.hpp create mode 100644 lib/xpp/include/xpp/fontable.hpp create mode 100644 lib/xpp/include/xpp/gcontext.hpp create mode 100644 lib/xpp/include/xpp/generic.hpp create mode 100644 lib/xpp/include/xpp/generic/error.hpp create mode 100644 lib/xpp/include/xpp/generic/event.hpp create mode 100644 lib/xpp/include/xpp/generic/extension.hpp create mode 100644 lib/xpp/include/xpp/generic/factory.hpp create mode 100644 lib/xpp/include/xpp/generic/input_iterator_adapter.hpp create mode 100644 lib/xpp/include/xpp/generic/iterator_traits.hpp create mode 100644 lib/xpp/include/xpp/generic/reply_iterator.hpp create mode 100644 lib/xpp/include/xpp/generic/request.hpp create mode 100644 lib/xpp/include/xpp/generic/resource.hpp create mode 100644 lib/xpp/include/xpp/generic/signature.hpp create mode 100644 lib/xpp/include/xpp/pixmap.hpp create mode 100644 lib/xpp/include/xpp/valueparam.hpp create mode 100644 lib/xpp/include/xpp/window.hpp create mode 100644 lib/xpp/include/xpp/xpp.hpp create mode 100644 lib/xpp/src/examples/Makefile create mode 100644 lib/xpp/src/examples/demo_01.cpp create mode 100644 lib/xpp/src/examples/demo_02.cpp create mode 100644 lib/xpp/src/tests/.gitignore create mode 100644 lib/xpp/src/tests/Makefile create mode 100644 lib/xpp/src/tests/README.md create mode 100644 lib/xpp/src/tests/callable.cpp create mode 100644 lib/xpp/src/tests/error_test.cpp create mode 100644 lib/xpp/src/tests/event.cpp create mode 100644 lib/xpp/src/tests/iterator.cpp create mode 100644 lib/xpp/src/tests/requests.cpp create mode 100644 lib/xpp/src/tests/resource.cpp create mode 100644 lib/xpp/src/tests/sizeof.cpp create mode 100644 lib/xpp/src/tests/template.cpp create mode 100644 lib/xpp/src/tests/test.cpp create mode 100644 lib/xpp/src/tests/xlib-test.cpp create mode 100644 lib/xpp/src/tests/xlib.cpp create mode 100644 lib/xpp/src/tests/xproto.cpp create mode 100644 lib/xpp/src/xpp.cpp create mode 100644 src/CMakeLists.txt create mode 100644 src/adapters/alsa/control.cpp create mode 100644 src/adapters/alsa/mixer.cpp create mode 100644 src/adapters/mpd.cpp create mode 100644 src/adapters/net.cpp create mode 100644 src/adapters/net_iw.cpp create mode 100644 src/adapters/net_nl.cpp create mode 100644 src/adapters/pulseaudio.cpp create mode 100644 src/adapters/script_runner.cpp create mode 100644 src/cairo/utils.cpp create mode 100644 src/components/bar.cpp create mode 100644 src/components/builder.cpp create mode 100644 src/components/command_line.cpp create mode 100644 src/components/config.cpp create mode 100644 src/components/config_parser.cpp create mode 100644 src/components/controller.cpp create mode 100644 src/components/eventloop.cpp create mode 100644 src/components/logger.cpp create mode 100644 src/components/renderer.cpp create mode 100644 src/components/screen.cpp create mode 100644 src/drawtypes/animation.cpp create mode 100644 src/drawtypes/iconset.cpp create mode 100644 src/drawtypes/label.cpp create mode 100644 src/drawtypes/layouticonset.cpp create mode 100644 src/drawtypes/progressbar.cpp create mode 100644 src/drawtypes/ramp.cpp create mode 100644 src/events/signal_emitter.cpp create mode 100644 src/events/signal_receiver.cpp create mode 100644 src/ipc/decoder.cpp create mode 100644 src/ipc/encoder.cpp create mode 100644 src/ipc/ipc.cpp create mode 100644 src/ipc/util.cpp create mode 100644 src/main.cpp create mode 100644 src/modules/alsa.cpp create mode 100644 src/modules/backlight.cpp create mode 100644 src/modules/battery.cpp create mode 100644 src/modules/bspwm.cpp create mode 100644 src/modules/counter.cpp create mode 100644 src/modules/cpu.cpp create mode 100644 src/modules/date.cpp create mode 100644 src/modules/fs.cpp create mode 100644 src/modules/github.cpp create mode 100644 src/modules/i3.cpp create mode 100644 src/modules/ipc.cpp create mode 100644 src/modules/memory.cpp create mode 100644 src/modules/menu.cpp create mode 100644 src/modules/meta/base.cpp create mode 100644 src/modules/meta/factory.cpp create mode 100644 src/modules/mpd.cpp create mode 100644 src/modules/network.cpp create mode 100644 src/modules/pulseaudio.cpp create mode 100644 src/modules/script.cpp create mode 100644 src/modules/temperature.cpp create mode 100644 src/modules/text.cpp create mode 100644 src/modules/tray.cpp create mode 100644 src/modules/xbacklight.cpp create mode 100644 src/modules/xkeyboard.cpp create mode 100644 src/modules/xwindow.cpp create mode 100644 src/modules/xworkspaces.cpp create mode 100644 src/polybar-msg.cpp create mode 100644 src/settings.cpp.cmake create mode 100644 src/tags/action_context.cpp create mode 100644 src/tags/context.cpp create mode 100644 src/tags/dispatch.cpp create mode 100644 src/tags/parser.cpp create mode 100644 src/utils/action_router.cpp create mode 100644 src/utils/actions.cpp create mode 100644 src/utils/bspwm.cpp create mode 100644 src/utils/color.cpp create mode 100644 src/utils/command.cpp create mode 100644 src/utils/concurrency.cpp create mode 100644 src/utils/env.cpp create mode 100644 src/utils/file.cpp create mode 100644 src/utils/http.cpp create mode 100644 src/utils/i3.cpp create mode 100644 src/utils/inotify.cpp create mode 100644 src/utils/io.cpp create mode 100644 src/utils/process.cpp create mode 100644 src/utils/restack.cpp create mode 100644 src/utils/socket.cpp create mode 100644 src/utils/string.cpp create mode 100644 src/utils/units.cpp create mode 100644 src/x11/atoms.cpp create mode 100644 src/x11/background_manager.cpp create mode 100644 src/x11/connection.cpp create mode 100644 src/x11/cursor.cpp create mode 100644 src/x11/ewmh.cpp create mode 100644 src/x11/extensions/composite.cpp create mode 100644 src/x11/extensions/randr.cpp create mode 100644 src/x11/extensions/xkb.cpp create mode 100644 src/x11/icccm.cpp create mode 100644 src/x11/legacy_tray_manager.cpp create mode 100644 src/x11/registry.cpp create mode 100644 src/x11/tray_client.cpp create mode 100644 src/x11/tray_manager.cpp create mode 100644 src/x11/window.cpp create mode 100644 src/x11/winspec.cpp create mode 100644 src/x11/xembed.cpp create mode 100644 src/x11/xresources.cpp create mode 100644 tests/CMakeLists.txt create mode 100644 tests/CMakeLists.txt.in create mode 100644 tests/common/test.hpp create mode 100644 tests/unit_tests/components/builder.cpp create mode 100644 tests/unit_tests/components/command_line.cpp create mode 100644 tests/unit_tests/components/config_parser.cpp create mode 100644 tests/unit_tests/drawtypes/iconset.cpp create mode 100644 tests/unit_tests/drawtypes/label.cpp create mode 100644 tests/unit_tests/drawtypes/layouticonset.cpp create mode 100644 tests/unit_tests/drawtypes/ramp.cpp create mode 100644 tests/unit_tests/ipc/decoder.cpp create mode 100644 tests/unit_tests/ipc/encoder.cpp create mode 100644 tests/unit_tests/ipc/util.cpp create mode 100644 tests/unit_tests/tags/action_context.cpp create mode 100644 tests/unit_tests/tags/dispatch.cpp create mode 100644 tests/unit_tests/tags/parser.cpp create mode 100644 tests/unit_tests/utils/action_router.cpp create mode 100644 tests/unit_tests/utils/actions.cpp create mode 100644 tests/unit_tests/utils/color.cpp create mode 100644 tests/unit_tests/utils/command.cpp create mode 100644 tests/unit_tests/utils/env.cpp create mode 100644 tests/unit_tests/utils/file.cpp create mode 100644 tests/unit_tests/utils/math.cpp create mode 100644 tests/unit_tests/utils/process.cpp create mode 100644 tests/unit_tests/utils/scope.cpp create mode 100644 tests/unit_tests/utils/string.cpp create mode 100644 tests/unit_tests/utils/units.cpp create mode 100644 version.txt diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..9f04cab --- /dev/null +++ b/.clang-format @@ -0,0 +1,14 @@ +--- +Language: Cpp +Standard: c++17 +BasedOnStyle: Google +ColumnLimit: 120 +NamespaceIndentation: Inner +AlignAfterOpenBracket: DontAlign +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: false +BreakConstructorInitializersBeforeComma: true +DerivePointerAlignment: false +PointerAlignment: Left +SpacesBeforeTrailingComments: 1 +--- diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..d28a132 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,52 @@ +--- +Checks: ' + -*, + performance-*, + readability-*, + clang-analyzer-alpha.core*, + clang-analyzer-alpha.security*, + clang-analyzer-alpha.unix.cstring*, + clang-analyzer-core.uninitialized*, + clang-analyzer-cplusplus.*, + clang-analyzer-nullability*, + clang-analyzer-unix*, + cppcoreguidelines*, + modernize-use-*, + modernize-*, + -modernize-raw-string-literal, + -modernize-use-bool-literals, + -modernize-use-trailing-return-type, + -readability-identifier-length, + -readability-implicit-bool-cast, + -readability-else-after-return, + -readability-named-parameter, + -readability-implicit-bool-conversion, + -cppcoreguidelines-pro-bounds-pointer-arithmetic, + -cppcoreguidelines-pro-bounds-array-to-pointer-decay, + -cppcoreguidelines-pro-type-vararg, + -cppcoreguidelines-pro-type-reinterpret-cast, + -cppcoreguidelines-pro-type-union-access, + -cppcoreguidelines-pro-type-cstyle-cast, + -cppcoreguidelines-pro-bounds-constant-array-index, + -cppcoreguidelines-owning-memory, + ' + +CheckOptions: + - key: modernize-loop-convert.NamingStyle + value: lower_case + - key: readability-identifier-naming.ClassCase + value: lower_case + - key: readability-identifier-naming.ClassConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.ClassMethodCase + value: lower_case + - key: readability-identifier-naming.MemberCase + value: lower_case + - key: readability-identifier-naming.ProtectedMemberPrefix + value: 'm_' + - key: readability-identifier-naming.PrivateMemberPrefix + value: 'm_' +HeaderFilterRegex: '' +WarningsAsErrors: '' +AnalyzeTemporaryDtors: false +... diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ff6aa42 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 +charset = utf-8 + +[*.py] +indent_size = 4 + +[Makefile] +indent_style = tab +indent_size = 2 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..ea49a3b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: polybar +open_collective: polybar diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..8f9fadf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,112 @@ +name: 🐞 Bug Report +description: Create a report for something that misbehaves +title: "[Bug]: " +labels: ["bug", "needs confirmation"] +body: + - type: checkboxes + id: checklist + attributes: + label: Checklist + description: Please carefully go through this checklist and check each option. + options: + - label: I have read the appropriate section in the [contributing guidelines](https://github.com/polybar/polybar/blob/master/CONTRIBUTING.md) + required: true + - label: I believe this issue is a problem with polybar itself and not a misconfiguration on my part + required: true + - label: I have searched for other open and closed [issues](https://github.com/polybar/polybar/issues?q=is%3Aissue) that may have already reported this problem + required: true + - label: I have checked the [known issues](https://github.com/polybar/polybar/wiki/Known-Issues) page for this problem. + required: true + - label: I have followed the [debugging guide](https://github.com/polybar/polybar/wiki/Debugging-your-Config) to narrow down the problem to a minimal config. + required: true + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce + description: Any steps to take and commands to run to reproduce this issue. + placeholder: | + 1. `polybar -c ... bar` + 2. ... + validations: + required: true + - type: textarea + id: config + attributes: + label: Minimal config + description: A minimal but **complete** config with which the problem occurs. + render: dosini + placeholder: | + [bar/example] + ... + + [module/...] + ... + validations: + required: true + - type: textarea + id: logs + attributes: + label: Polybar log + description: Post everything polybar prints to the terminal when you run it and the issue occurs. If possible, run polybar with a higher log level (e.g. `trace` or `info`). + render: text + placeholder: | + notice: Parsing config file: ... + ... + - type: textarea + id: expected + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen + validations: + required: true + - type: textarea + id: actual + attributes: + label: Actual behavior + description: What actually happens + validations: + required: true + - type: input + id: wm + attributes: + label: Window Manager and Version + placeholder: ex. i3-gaps 4.19.1 + validations: + required: true + - type: input + id: distro + attributes: + label: Linux Distribution + placeholder: ex. Ubuntu 21.04 + validations: + required: true + - type: textarea + id: version + attributes: + label: Polybar version + description: Output of `polybar -vvv` + render: text + placeholder: | + polybar 3.5.7 + + Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard + + X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor + + Build type: Release + Compiler: /usr/bin/c++ + Compiler flags: -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -O3 -DNDEBUG -Wall -Wextra -Wpedantic -Wsuggest-override + Linker flags: -Wall -Wextra -Wpedantic -Wsuggest-override -Wall -Wextra -Wpedantic -Wsuggest-override + validations: + required: true + - type: textarea + id: context + attributes: + label: Additional Context / Screenshots + description: If applicable, add screenshots and additional context to explain your problem + validations: + required: false + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! :heart: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..81b3623 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: 🙋 Ask a question + url: https://github.com/polybar/polybar/blob/master/SUPPORT.md + about: Have a look at our support resources and channels + - name: 💡 Feature request + url: https://github.com/polybar/polybar/discussions/categories/ideas + about: Suggest your idea over in Discussions + - name: 🛠️ Build Issues + url: https://github.com/polybar/polybar/discussions/categories/build-support + about: Get support when building polybar from source diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..442cf05 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ + + +## What type of PR is this? (check all applicable) + +* [ ] Refactor +* [ ] Feature +* [ ] Bug Fix +* [ ] Optimization +* [ ] Documentation Update +* [ ] Other: *Replace this with a description of the type of this PR* + +## Description + + +## Related Issues & Documents + + +## Documentation (check all applicable) + +* [ ] This PR requires changes to the Wiki documentation (describe the changes) +* [ ] This PR requires changes to the documentation inside the git repo (please add them to the PR). +* [ ] Does not require documentation changes diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..0a6287d --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,21 @@ +coverage: + status: + project: + default: + # Coverage can drop by 0.1% without failing the status + threshold: 0.1 + patch: + default: + # Patches don't need test coverage + # TODO remove once we have proper testing infrastructure and documentation + target: 0 + +ignore: + - "tests/**/*" + - "lib/**/*" + +comment: + require_changes: true + +github_checks: + annotations: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f5eb3a6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,160 @@ +name: CI +on: + workflow_dispatch: + inputs: + ref: + description: 'ref' + required: false + push: + pull_request: + +jobs: + docs: + runs-on: ubuntu-22.04 + env: + COLOR: "ON" + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.ref }} + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y python3-sphinx + - name: Build Documentation + run: | + mkdir -p build + cd build + cmake -DDISABLE_ALL=ON -DBUILD_DOC=ON -DSPHINX_FLAGS="-W" .. + make doc + + ipc: + runs-on: ubuntu-22.04 + env: + COLOR: "ON" + steps: + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + libxcb-composite0-dev \ + libxcb-ewmh-dev \ + libxcb-icccm4-dev \ + libxcb-image0-dev \ + libxcb-randr0-dev \ + libxcb-util0-dev \ + libxcb1-dev \ + libcairo2-dev \ + python3-xcbgen \ + libuv1-dev \ + xcb-proto + - uses: actions/checkout@v3 + with: + submodules: true + ref: ${{ github.event.inputs.ref }} + - name: Build polybar-msg + run: | + mkdir -p build + cd build + cmake -DDISABLE_ALL=ON -DBUILD_POLYBAR_MSG=ON .. + make polybar-msg + + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + cxx: [g++, clang++] + polybar_build_type: ["full"] + build_type: ["Release"] + include: + - cxx: g++ + polybar_build_type: "tests" + build_type: "Coverage" + - cxx: g++ + polybar_build_type: "minimal" + build_type: "Release" + env: + CXX: ${{ matrix.cxx }} + BUILD_TYPE: ${{ matrix.build_type }} + POLYBAR_BUILD_TYPE: ${{ matrix.polybar_build_type }} + POLYBAR_DIR: ${{ github.workspace }} + BUILD_DIR: "${{ github.workspace}}/build" + MAKEFLAGS: "-j4" + COLOR: "ON" + steps: + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + libxcb-composite0-dev \ + libxcb-ewmh-dev \ + libxcb-icccm4-dev \ + libxcb-image0-dev \ + libxcb-randr0-dev \ + libxcb-util0-dev \ + libxcb1-dev \ + libcairo2-dev \ + python3-xcbgen \ + libuv1-dev \ + xcb-proto + + if [ "$POLYBAR_BUILD_TYPE" != "minimal" ]; then + sudo apt-get install -y \ + libxcb-xkb-dev \ + libxcb-cursor-dev \ + libxcb-xrm-dev \ + i3-wm \ + libcurl4-openssl-dev \ + libjsoncpp-dev \ + libasound2-dev \ + libpulse-dev \ + libnl-genl-3-dev \ + libmpdclient-dev + fi + + if [ "$POLYBAR_BUILD_TYPE" = "tests" ]; then + sudo apt-get install -y lcov + fi + - uses: actions/checkout@v3 + with: + submodules: true + ref: ${{ github.event.inputs.ref }} + - name: Summary + run: ./common/ci/summary.sh + - name: Configure + run: ./common/ci/configure.sh + - name: Build + run: | + cd "$BUILD_DIR" + make + - name: Collect initial coverage + if: ${{ matrix.polybar_build_type == 'tests' }} + run: | + lcov --capture --initial --no-external --directory . -o cov_base.info + - name: Tests + if: ${{ matrix.polybar_build_type == 'tests' }} + run: | + cd "$BUILD_DIR" + make check + - name: Collect coverage + if: ${{ matrix.polybar_build_type == 'tests' }} + run: | + lcov --capture --no-external --directory . -o cov_tests.info + lcov --add-tracefile cov_base.info --add-tracefile cov_tests.info -o cov_total.info + lcov --remove cov_total.info "${PWD}/build/*" "${PWD}/tests/*" "${PWD}/lib/*" -o cov.info + - name: Upload Coverage + if: ${{ matrix.polybar_build_type == 'tests' }} + uses: codecov/codecov-action@v3 + with: + flags: unittests + files: ./cov.info + fail_ci_if_error: true + - name: Upload Logs + if: failure() + uses: actions/upload-artifact@v2 + with: + name: cmake + path: | + build/CMakeFiles/CMakeError.log + build/CMakeFiles/CMakeOutput.log + retention-days: 5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a0c408d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,105 @@ +# Workflow For Releases +# +# Automatically creates and uploads a complete release archive for the given +# release. +name: Release Workflow + +# Is triggered when a new release is published or by hand +# If triggered by hand, the release tag that this should target has to be +# specified. +on: + release: + types: [published] + workflow_dispatch: + inputs: + tag: + description: 'Release Tag' + required: true + +jobs: + upload: + runs-on: ubuntu-latest + steps: + - name: Get Version + if: ${{ github.event.inputs.tag }} != '' + run: | + if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then + echo "Manual Release Triggered" + RELEASE_TAG=${{ github.event.inputs.tag }} + else + echo "Automatic Release Triggered" + RELEASE_TAG=${GITHUB_REF#refs/tags/} + fi + echo "Publishing Version $RELEASE_TAG" + { + echo "RELEASE_TAG=$RELEASE_TAG" + echo "POLYBAR_DIR=polybar-$RELEASE_TAG" + echo "POLYBAR_ARCHIVE=polybar-$RELEASE_TAG.tar.gz" + } >> "$GITHUB_ENV" + + # Checks out the target tag + - uses: actions/checkout@v2 + with: + ref: ${{ env.RELEASE_TAG }} + submodules: true + path: ${{ env.POLYBAR_DIR }} + + - name: Create Release Archive + run: | + find "$DIR" -type d -name ".git" -exec rm -rf {} \+ + tar czf "$ARCHIVE" "$DIR" + echo "SHA256SUM=$(sha256sum "$ARCHIVE" | cut -d ' ' -f 1)" >> "$GITHUB_ENV" + env: + DIR: ${{ env.POLYBAR_DIR }} + ARCHIVE: ${{ env.POLYBAR_ARCHIVE }} + + - name: Get Upload URL + id: get_upload_url + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const tag = '${{ env.RELEASE_TAG }}'; + console.log(`Getting Upload URL for '${tag}'`); + const release = await github.repos.getReleaseByTag({ + owner: context.repo.owner, + repo: context.repo.repo, + tag: tag + }); + core.exportVariable('UPLOAD_URL', release.data.upload_url); + core.exportVariable('RELEASE_ID', release.data.id); + core.exportVariable('RELEASE_BODY', release.data.body); + + - name: Upload Release Archive + id: upload_archive + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.UPLOAD_URL }} + asset_path: "./${{ env.POLYBAR_ARCHIVE }}" + asset_name: ${{ env.POLYBAR_ARCHIVE }} + asset_content_type: application/gzip + + # Adds a download section to the beginning of the release body + - name: Update Release Body + uses: actions/github-script@v3 + env: + # Existing release body, fetched in the get_upload_url step. + RELEASE_BODY: ${{ env.RELEASE_BODY }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const fname = '${{ env.POLYBAR_ARCHIVE }}' + const url = '${{ steps.upload_archive.outputs.browser_download_url }}' + const hash = '${{ env.SHA256SUM }}' + let body = "## Download\n\n" + body += `[${fname}](${url}) (**sha256**: \`${hash}\`)\n\n` + body += process.env.RELEASE_BODY; + + const release = await github.repos.updateRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: '${{ env.RELEASE_ID}}', + body: body + }); diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8428eee --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +/build +/tags +/compile_commands.json +*.bak +*.pyc +*.swp +*.tmp +.tags +*.user + +# clangd +/.cache + +polybar-*.tar +*.cache + +.venv diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4b6f7f5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,8 @@ +[submodule "lib/i3ipcpp"] + path = lib/i3ipcpp + url = https://github.com/polybar/i3ipcpp + branch = master +[submodule "lib/xpp"] + path = lib/xpp + url = https://github.com/polybar/xpp + branch = master diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..1cebab8 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,22 @@ +--- +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: doc/conf.py + fail_on_warning: true + +python: + install: + - requirements: doc/requirements.txt diff --git a/.valgrind-suppressions b/.valgrind-suppressions new file mode 100644 index 0000000..6d33fd4 --- /dev/null +++ b/.valgrind-suppressions @@ -0,0 +1,101 @@ +{ + xft/fontconfig + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:FcPatternCreate + fun:FcFontRenderPrepare + fun:FcFontMatch + fun:XftFontMatch + fun:XftFontOpenName + ... + ... + ... + ... + ... + ... +} +{ + xft/fontconfig + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + obj:/usr/lib/libfontconfig.so.* + obj:/usr/lib/libfontconfig.so.* + fun:FcPatternAddDouble + obj:/usr/lib/libXft.so.* + obj:/usr/lib/libXft.so.* + obj:/usr/lib/libXft.so.* + obj:/usr/lib/libXft.so.* + fun:XftDefaultHasRender + fun:XftDefaultSubstitute + fun:XftFontMatch + fun:XftFontOpenName +} +{ + xft/fontconfig + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:XftFontCheckGlyph + fun:XftGlyphRender + fun:XftDrawGlyphs + fun:XftDrawString16 + ... + ... + ... + ... + ... + ... + ... +} +{ + xft/fontconfig + Memcheck:Leak + match-leak-kinds: definite + fun:realloc + obj:/usr/lib/libfontconfig.so.* + obj:/usr/lib/libfontconfig.so.* + fun:FcFontRenderPrepare + fun:FcFontMatch + fun:XftFontMatch + fun:XftFontOpenName + ... + ... + ... + ... + ... +} +{ + xresource manager + Memcheck:Leak + match-leak-kinds: definite + fun:realloc + obj:/usr/lib/libX11.so.* + obj:/usr/lib/libX11.so.* + obj:/usr/lib/libX11.so.* + fun:_XlcCreateLC + fun:_XlcDefaultLoader + fun:_XOpenLC + fun:_XrmInitParseInfo + obj:/usr/lib/libX11.so.* + fun:XrmGetStringDatabase + ... + ... +} +{ + xft conditional jump + Memcheck:Cond + obj:/usr/lib/libfreetype.so.* + obj:/usr/lib/libfreetype.so.* + fun:FT_Outline_Decompose + obj:/usr/lib/libfreetype.so.* + obj:/usr/lib/libfreetype.so.* + obj:/usr/lib/libfreetype.so.* + obj:/usr/lib/libfreetype.so.* + obj:/usr/lib/libfreetype.so.* + fun:XftFontLoadGlyphs + fun:XftGlyphExtents + ... + ... +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..62a622c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,260 @@ +# Changelog + +All notable changes to this project will be documented in this file. +Each release should have the following subsections, if entries exist, in the +given order: `Breaking`, `Build`, `Deprecated`, `Removed`, `Added`, `Changed`, +`Fixed`, `Security`. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [3.7.0] - 2023-11-05 +### Breaking +- `custom/script`: + - No longer hides the module if the `exec` command failed and did not change the output from the previous run ([`#2636`](https://github.com/polybar/polybar/issues/2636)). Somewhat similar original behaviour can be imitated with `format-fail`, if necessary. + - If the `exec` command produced no output and exited with a non-zero exit code the module is no longer completely empty, but just has an empty `%output%` token. If you relied on this behavior to hide the module under certain circumstances, make sure the script exits with an exit code of zero. ([`#2857`](https://github.com/polybar/polybar/discussions/2857), [`#2861`](https://github.com/polybar/polybar/pull/2861)) + +### Build +- Respect `CMAKE_INSTALL_PREFIX` when installing default config ([`#2770`](https://github.com/polybar/polybar/pull/2770), [`#2917`](https://github.com/polybar/polybar/pull/2917)) +- Change default `CMAKE_INSTALL_PREFIX` to `/usr`. Installations with default flags will now go into `/usr` instead of `/usr/local` ([`#2917`](https://github.com/polybar/polybar/pull/2917)) +- Bump C++ version to C++17 ([`#2847`](https://github.com/polybar/polybar/pull/2847)) + +### Deprecated +- `custom/text`: The `content` setting and all its properties are deprecated in favor of `format` with the same functionality. ([`#2676`](https://github.com/polybar/polybar/pull/2676)) +- tray: All tray-related settings in the bar section are deprecated. They are replaced by the new tray module ([`#3002`](https://github.com/polybar/polybar/pull/3002)) + - `tray-position`, `tray-detached`, `tray-maxsize`, `tray-scale`, `tray-transparent`, `tray-background`, `tray-foreground`, `tray-padding`, `tray-offset-x`, `tray-offset-y` + +### Added +- A tray module with type `internal/tray` for positioning the tray like a module ([`#2689`](https://github.com/polybar/polybar/issues/2689)) +- `internal/temperature`: `%temperature-k%` token displays the temperature in degrees Kelvin ([`#2774`](https://github.com/polybar/polybar/discussions/2774), [`#2784`](https://github.com/polybar/polybar/pull/2784)) +- `internal/pulseaudio`: `reverse-scroll` option ([`#2664`](https://github.com/polybar/polybar/pull/2664)) +- `custom/script`: Repeat interval for script failure (`interval-fail`) and `exec-if` (`interval-if`) ([`#943`](https://github.com/polybar/polybar/issues/943), [`#2606`](https://github.com/polybar/polybar/issues/2606), [`#2630`](https://github.com/polybar/polybar/pull/2630)) +- `custom/ipc`: + - Added support for `