Commit Graph

1674 Commits

Author SHA1 Message Date
patrick96
6975c0ec26 build: Update i3ipcpp submodule
With this we no longer distribute the jsoncpp 1.7.7 source with polybar.
It is possible that polybar will no longer build on older systems that
have an ancient version of jsoncpp (>= 5 years).

Ref: polybar/i3ipcpp#9
2020-02-22 18:02:13 +01:00
patrick96
fab8437ff1 doc: Write syntax definition in polybar.5 2020-02-21 16:17:12 +01:00
patrick96
0b713047aa doc: Allow custom SPHINX_BUILD 2020-02-21 16:17:12 +01:00
patrick96
0276d11fd9 config_parser: Improve message for invalid names 2020-02-21 16:17:12 +01:00
Patrick Ziegler
5a695c7065
doc: Update links to https (#2012) 2020-02-21 15:39:39 +01:00
Cooper Pierce
683cfc0738
feat(github): offline label (#1825)
Adds `format-offline` and `label-offline`

* feat(github): offline label & fixes

* Clear label if there are no notifications and empty-notifications = false

* clang-format

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2020-02-21 13:58:23 +01:00
patrick96
8d2b0d2747 build: Update xpp submodule
Ref: polybar/xpp#21
2020-02-08 17:37:15 +01:00
patrick96
8d07f2aa23 build: Update xpp submodule
PR #1683 downgraded the xpp submodule
2020-01-31 07:12:21 +01:00
patrick96
3854fc91b5 fix(xworkspaces): Show _NET_NUMBER_OF_DESKTOPS desktops
In the case where _NET_NUMBER_OF_DESKTOPS > |_NET_DESKTOP_NAMES|
the last branch of the get_desktop_names method would return a vector
with _NET_NUMBER_OF_DESKTOPS + 1 elements because we iterate until
_NET_NUMBER_OF_DESKTOPS + 1.

Fixes #1983
2020-01-24 16:56:38 +01:00
Jérôme BOULMIER
51f9f35599 cleanup(logger): use universal references to avoid useless copies 2020-01-24 16:32:26 +01:00
Jérôme BOULMIER
982a22cd62 use steady clock instead of system clock 2020-01-23 23:45:56 +01:00
Jérôme BOULMIER
e6e010e45b fix(battery): animation framerate 2020-01-23 23:45:56 +01:00
Christoph Schiessl
d3844c40b6 refactor(battery): simplify animation subthread 2020-01-23 23:45:56 +01:00
patrick96
4ef2bd5575 fix(test): Gtest compilation failure
In master gtest fails to build with the error

/home/travis/build/polybar/polybar/build/googletest-src/googlemock/include/gmock/gmock-more-actions.h:138:1: error: ISO C++11 requires at least one argument for the "..." in a variadic macro [-Werror]
 ACTION_P(ReturnPointee, pointer) { return *pointer; }

We had a lot of failed builds because gtest often breaks stuff in
master. From now on we will just use a release tag. Whenever there is a
new release, we manually update this file.

Ref: google/googletest#2678
2020-01-22 00:33:07 +01:00
Artem Polishchuk
34bb35ca96 Add Fedora installation instructions (#1976) 2020-01-20 11:36:28 +01:00
Gus Caplan
068bf5a311 feat(backlight): Add enable-scroll (#1957)
* backlight: enable changing via scroll

* squash! feedback

* Update src/modules/backlight.cpp

Co-Authored-By: Jérôme BOULMIER <jerome.boulmier@outlook.fr>

Co-authored-by: Jérôme BOULMIER <jerome.boulmier@outlook.fr>
2020-01-15 16:32:17 +01:00
patrick96
0dbcb28a2c fix(net): Query IP addresses for tun/ tap devices
Before tuntap devices would never call the generic `network::query`
method and just return true.

Fixes #1986
2020-01-12 15:03:18 +01:00
patrick96
e43ba9bd3a controller: Stop printing errors for non-unique modules
Functionality-wise reverts the changes from #1534

In #1907 we have decided to allow the same module to appear multiple
times (and deliver actions to all matching modules). But since that PR
will likely take longer to get merged, I want to remove the error from
polybar because the message it prints isn't really true anymore.
2020-01-12 13:08:45 +01:00
Nicholas Baron
8db9c89e0b build: Add -j to build.sh (#1961)
* Added -j and --jobs as command line options

* Added parallelizing option to the set_build_opts function

* Aligned parallel option to the previous options
2020-01-07 16:35:48 +01:00
patrick96
98187debfb font: Show context in unmatched character warning
As suggested by @kronn.

This is a slightly modified patch introduced by @ayosec in their repo
for packaging polybar .deb packages.

Ref: https://github.com/ayosec/polybar-debian
Ref: https://github.com/ayosec/polybar-debian/blob/master/patches/0001-Show-full-contents-when-an-unmatched-character-is-fo.patch
2020-01-07 16:28:07 +01:00
Jérôme BOULMIER
d93a50836d update xpp submodule 2020-01-05 20:20:15 +01:00
patrick96
85721d3d10 doc: Write page for package maintainers. 2019-12-28 21:53:44 +01:00
patrick96
d3d868a08c aur: Update PKGBUILD for 3.4.2 2019-12-28 10:22:34 +01:00
patrick96
5eb293cb71 doc: Add gitter room to issue template chooser 2019-12-27 17:21:14 +01:00
Jeremy Ong
34e742e000 Add missing <stdexcept> header
This is dependent on a PR to xpp that does the same. Newer compilers
(GCC10 in particular) are stricter about which headers provide the
std exception types.
2019-12-25 01:00:29 +01:00
Patrick Ziegler
fdf4d0c1a5 Revert "fix(aur): Add xorgproto package as make dependency"
This reverts commit a902b5a449.
2019-12-25 00:53:21 +01:00
patrick96
1fe679d6b3 fix(ipc): Clear content if no output is produced
Before, if the command produced no output, the `m_output` field would
not have been overwritten and the old output was displayed.

But since this is an explicit trigger of the hook, the user would expect
the output to be updated to whatever the script produces (even if that
is nothing).

Ref: https://www.reddit.com/r/Polybar/comments/e9a8ww
2019-12-23 01:23:40 +01:00
patrick96
a902b5a449 fix(aur): Add xorgproto package as make dependency
xorgproto always was a make dependency (I think) but it was
automatically included indirectly by another dependency.
Arch recently cleaned up some xorg related packages which made xorgproto
no longer an indirect dependency of polybar which spams cmake with
messages like:

```
Package 'xproto', required by 'xau', not found
Package 'xproto', required by 'xdmcp', not found
Package 'xproto', required by 'xau', not found
Package 'xproto', required by 'xdmcp', not found
Package 'xproto', required by 'xau', not found
Package 'xproto', required by 'xdmcp', not found
Package 'xproto', required by 'xau', not found
Package 'xproto', required by 'xdmcp', not found
```

And during `make` finally completely fails the build because some
library's include directories are not honored because the xproto.pc file
cannot be found:

```
In file included from /home/patrick96/Projects/github.com/patrick96/polybar/include/cairo/utils.hpp:3,
                 from /home/patrick96/Projects/github.com/patrick96/polybar/src/cairo/utils.cpp:3:
/usr/include/cairo/cairo-ft.h:46:10: fatal error: ft2build.h: No such file or directory
   46 | #include <ft2build.h>
      |          ^~~~~~~~~~~~
```

Ref: https://bugs.archlinux.org/task/64892
2019-12-22 17:12:49 +01:00
patrick96
63cb05d35d fix(renderer): make center position more robust
The old code didn't really work when the right block was pushing against
the center block. Also `fixed-center` wasn't properly defined. I have
now fixed it to the following:

* `fixed-center = true`: The center block stays at the center of the bar
whenever possible. It can be pushed to the left if the right block takes
too much space and to the right if the left block takes too much space
* `fixed-center = false`: The center block will be in the middle between
the left and right block whenever possible. If there is not enough space
between those two, the center block will be directly to the right of the
left block and pushes out the right block
2019-12-21 15:43:31 +01:00
patrick96
00274c57a9 fix(renderer): Falloff gradient
Before it did not take into account borders or a tray on the left.
It also sometimes rendered the gradient way to large
2019-12-21 15:43:31 +01:00
patrick96
ec2bad004a fix(renderer): Correctly position right block if center is empty
The issue was that it used the position of the center module to
calculate the leftmost possible position of the block. However, if the
center module is empty that position is disastrously wrong.

Fixes #591
Fixes #1903
2019-12-21 15:43:31 +01:00
patrick96
4bc7a09c7e refactor(builder): Remove unused condition parameter
Same as in #1952, the methods are never called with the optional
parameter, except once where it is called with the default value.

Ref: #1952
2019-12-18 21:22:47 +01:00
Tudor Brindus
bc560952e0 cpu: Consider steal time for load calculation (#1955)
* Add steal time to cpu_time struct

* Consider steal time as part of load calculations

* Typo fix
2019-12-16 17:05:18 +01:00
Tudor Brindus
ad3960e050 fix(build): GCC 6.3 discarded qualifiers (#1953)
This fixes the below error:

     /code/polybar/src/components/controller.cpp:110:117:   required from here
     /code/polybar/src/components/controller.cpp💯60: error: passing ‘const volatile std::shared_ptr<polybar::modules::module_interface>’ as ‘this’ argument discards qualifiers [-fpermissive]
          auto equal_predicate = [](auto& m1, auto& m2) { return m1->name() == m2->name(); };
2019-12-13 00:04:27 +01:00
patrick96
37628f8691 refactor(builder): Remove unused add_space parameter
the `node` and `node_repeat` were never called with the optional
parameter add_space. And its default value is false, so the
corresponding code was never used.

I think in general it is better to just have the user of those functions
call `builder::space` when they need to instead of adding more
complexity to the `node*` functions.
2019-12-12 22:08:34 +01:00
infokiller
fb6e874235 feat(label): Add minlen with alignment (#1546)
* Add label minlen and alignment.

Fix build

* Update src/drawtypes/label.cpp

Co-Authored-By: infokiller <infokiller@users.noreply.github.com>

* Use existing alignment type.

* Remove redundant max_len handling in label::get.

* Fix shadowing.

* Add label alignment tests.

* Handle minlen/maxlen and alignment in same function.

Also add a test for a test case brought up in the PR discussion.

* Format files with clang-format

* Move builder::get_label_text tests into label tests

builder::get_label_text doesn't really do anything anymore

* builder: remove get_label_text

* label: Clean up label::get()

* Fix comment style.

* Set default label alignment to left.

* Update src/drawtypes/label.cpp

Co-Authored-By: Patrick Ziegler <p.ziegler96@gmail.com>

* Update include/drawtypes/label.hpp

Co-Authored-By: Patrick Ziegler <p.ziegler96@gmail.com>
2019-12-01 01:28:41 +01:00
Justin Dubs
70bf0339b8 feat(pulse): Add click-(middle|right) keys (#1941) 2019-11-28 17:36:14 +01:00
patrick96
7f09784548 doc: Add Gitter room
The Gitter room https://gitter.im/polybar/polybar should serve a similar
purpose as the IRC room with the benefit that messages persist and can
be received when offline.

From now on gitter should be the place where the polybar community
lives. Reddit is great for asking longer questions in the style of a
forum but not so great for quick back and forth conversations. IRC is
better in that aspect but has the serious downside that you have to stay
connected to get an answer and messages are not logged (only by your
client).

Both reddit and IRC are here to stay and I will still check them
regularly, but we should encourage people to join gitter.
2019-11-28 11:12:22 +01:00
Jérôme BOULMIER
e5783d4113 Include empty tokens when splitting if necessary (#1893)
Fixes #1881
2019-11-21 22:26:53 +01:00
patrick96
8d3dedc2bd github: Add subreddit as contact link
This is yet another way to steer people towards reddit for questions
instead of using the github issue tracker

Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
2019-11-03 12:55:32 +01:00
patrick96
7ee6093a6e aur: Update maintainer 2019-11-01 14:06:02 +01:00
patrick96
54381fd554 Update PKGBUILD for 3.4.1 2019-11-01 14:06:02 +01:00
patrick96
51184c7ead ipc: Remove unused global setting
None of the payload fields seem to be used. They were the only place
where EVENT_SIZE was used and why it had to be a macro (no variable
length arrays).
2019-11-01 11:12:40 +01:00
patrick96
3ea7600412 build: Move all possible variables into settings.cpp
Anything that doesn't have to be used as a macro
2019-11-01 11:12:40 +01:00
patrick96
100632cce3 fix(http): Pass char* as CURLOPT_USERAGENT 2019-11-01 11:12:40 +01:00
patrick96
6f882ba3b2 build: Move non-macro variables into settings.cpp
Since APP_VERSION is different for every commit and almost all file
include settings.hpp, the whole project has to be rebuilt for every
commit. With this, hopefully, this can be greatly reduced and only
changed files need to be rebuilt. This will also help ccache
2019-11-01 11:12:40 +01:00
Michael Vetter
c6194c06eb Update spec file
Adjust version number.
Add new dependencies.
Explicitly ask for Python 3.
2019-10-31 16:07:00 +01:00
patrick96
6849b8a56b clang-format 2019-10-27 16:02:33 +01:00
patrick96
587dc6c84d bar: Make module separator a label
Some people use text modules instead of the `separator` key in the bar
section to better configure the separator (colors, fonts).
Since we disallowed the same module being used multiple times in #1534,
this will now print an error message.

This should help with this a bit.

Ref #1913
2019-10-27 16:02:33 +01:00
patrick96
a77923ea96 build: drop python2
Ref: https://github.com/polybar/xpp/pull/17
Fixes #1892
2019-10-26 22:29:04 +02:00