Commit Graph

79 Commits

Author SHA1 Message Date
patrick96
eb535998da Cleanup Changelog 2022-02-25 04:38:07 +01:00
Maxim Kolesnikov
f5bfbccfc8
feat(script): add formatting for script failure (#2596)
Closes #2588

* feat(script): add formatting for script failure

* refactor: address review comments

* doc: add changelog entry

* refactor: minor cleanup
2022-02-23 15:01:28 +01:00
patrick96
dc46251571 fix: Handling for actions with negative offsets
If any action block contains a negative offset, it can cause text to be
theoretically be rendered outside of the block, making that text not
clickable.
To fix this, we ensure that an action block starts at the lowest
observed position while the block is open and ends at the highest
observed position while it is open.

Fixes #1814
2022-02-22 18:00:58 +01:00
patrick96
74067c52c3 fix: Set WM_SIZE_HINTS to fix position in openbox
When polybar is remapped (either through IPC or something like xdo
show), openbox positions it somewhere on the screen using the same
positioning algorithm as it would for regular windows.

If the position and size is set in the WM_SIZE_HINTS atom, openbox will
respect the position and size declared by the window.

Fixes #2021
2022-02-21 21:40:33 +01:00
Patrick Ziegler
ce93188a4a
Add units support (POINT, PIXEL, SPACE) (#2578)
* add units support (POINT, PIXEL, SPACE) for polybar

- add a size_with_unit struct
- add a geometry_format_values struct
- move dpi initialisation from renderer.cpp to bar.cpp
- add a string to size_with_unit converter
- add point support (with pt)
- add pixel support (with px)

* Fix unit test compilation

* clang-format

* Better names

The old names didn't really capture the purpose of the structs and
function.

space_type -> spacing_type
space_size -> spacing_val

size_type -> extent_type
geometry -> extent_val

geometry_format_values -> percentage_with_offset

* Remove parse_size_with_unit

No longer needed. The convert<spacing_val> function in config.cpp
already does all the work for us and always setting the type to pixel
was wrong.

In addition, line-size should not be of type spacing_val but extent_val.

* Cleanup

I tried to address most of my comments on the old PR

* Fix renderer width calculation

We can't just blindly add the x difference to the width because for
example the width should increase if x < width and the increase keeps
x < width.

Similarly, we can't just add the offset to the width.

* Rename geom_format_to_pixels to percentage_with_offset_to_pixel

* Cleanup

* Apply suggested changes from Patrick on GitHub

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Update src/components/bar.cpp

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Update src/components/config.cpp

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Update src/components/builder.cpp

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Update src/components/builder.cpp

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* config: Use stod for parsing percentage

* Use stof instead of strtof

* units: Fix test edge cases

* Remove unnecessary clang-format toggle

* Use percentage_with_offset for margin-{top,bottom}

* Support negative extent values

* Rename unit to units and create a cpp file

* Move percentage_with_offset_to_pixel unit test to units

* Add unit tests for units_utils

* Clarify when and how negative spacing/extent is allowed

Negative spacing is never allowed and produces a config error.

Extents allow negative values in theory, but only a few use-cases accept
it.
Only the extent value used for the `%{O}` tag and the offset value in
percentage_with_offset can be negative. Everything else is capped below
at 0.

The final pixel value of percentage_with_offset also caps below at 0.

* Fix parsing errors not being caught in config

* Print a proper error message for uncaught exceptions

* Cleanup module::get_output

All changes preserve the existing semantics

* Stop using remove_trailing_space in module::get_output

Instead, we first check if the current tag is built, and only if it is,
the spacing is prepended.

* Remove unused imports

* Restore old behavior

If there are two tags and the second one isn't built (module::build
returns false), the space in between them is removed.
For example in the mpd module:

format-online = <toggle> <label-song> foo

If mpd is not running, the mpd module will return false when trying to
build the `<label-song>` tag. If we don't remove the space between
`<toggle>` and `<label-song>`, we end up with two spaces between
`<toggle>` and `foo`.

This change is to match the old behavior where at least one trailing
space character was removed from the builder.

* Add changelog entry

* Remove unused setting

* Use percentage with offset for tray-offset

Co-authored-by: Jérôme BOULMIER <jerome.boulmier@outlook.fr>
Co-authored-by: Joe Groocock <github@frebib.net>
2022-02-20 21:08:57 +01:00
Prateek Sunal
ab915fb724
feat(net): %netspeed% token to show combined up+download speed (#2590)
Closes #1083 

* Add netspeed parameter (#1083)

* Update net.cpp

* Update net.hpp

* Update network.cpp

* Update CHANGELOG.md
2022-02-06 21:12:38 +01:00
patrick96
f428b7bb2f Install manpage for polybar-msg 2022-01-24 13:47:49 +01:00
Patrick Ziegler
c2f087225c
Eventloop cleanup (#2577)
* eventloop: Use eventloop namespace in cpp files

* changelog: Add missing deprecated hook message

* Make eventloop and ipc classes non-copyable and non-movable

* Remove functional.hpp

* eventloop: Don't close handles in error cases

Client should be responsible for closing handles.

* eventloop: Address invalidation of handle references
2022-01-22 22:00:26 +01:00
Patrick Ziegler
3356188056
Use sockets for IPC (#2539)
Deprecates not using `polybar-msg` for IPC.

Fixes #2532
Closes #2465
Fixes #2504

* Create FIFO specific NamedPipeHandle subclass to PipeHandle

* Prototype SocketHandle

* Move mainloop up to main.cpp

* Pass eventloop to ipc class

* Deprecate sending ipc over the named pipe

Unfortunately, we can only show the warning in the polybar log and not
give the user any feedback because the pipe is one-way

* Move eventloop into its own namespace

* Prototype ipc socket handling

* Remove handles from ipc_client

Should be independent from eventloop logic

* Remove ipc clients when finished

* Add tests for ipc_client decoding

* Add callback for complete ipc messages

* Remove template param from mixins

* Move signal handler to new callback system

* Move poll handle to new callback system

* Move FSEventHandle to new callback system

* Move TimerHandle and AsyncHandle to new callback system

* Move PipeHandle to new callback system

* Implement socket functionality in new callback system

* Correctly reset ipc named pipe handle

* Let client close handles in error callback

* Wrap client pipe and ipc::client in connection class

* Better decoder log messages

* Socket path logic

* Fix CI warnings

* Remove UVHandleGeneric

* Fix error when socket folder already exists

* Proof of concept message writeback

* Restructure ipc files

* polybar-msg: Use sockets

* polybar-msg: Better syntax for actions

* Fix memory leak with fifo

After EOF, the pipe wasn't closed and EOF was called all the time, each
time allocating a new pipe.

* Make polybar-msg compile on its own

* Rudimentary writeback for polybar-msg

* Fix payload reference going out of scope.

* Add IPC documentation

* Cleanup polybar-msg code

* Specify the v0 ipc message format

* Close ipc connection after message

* Fix ipc tests

* Properly close ipc connections

* Fix polybar-msg not working with action string

* Write polybar-msg manpage

* polybar-msg: Stop using exit()

* ipc: Print log message with PID

* Add tests for ipc util

* polybar-msg: Print PID with success message

* ipc: Propagate message errors

* Rename ipc::client to ipc::decoder

* Rename ipc.cpp to polybar-msg.cpp

* ipc: Write encoder function and fix decoder bugs

* ipc: Use message format for responses

* ipc: Handle wrong message types

* ipc: Write back error message if ipc message cannot be processed

This only happens for commands and empty actions.
Non-empty actions are not immediately executed, but deferred until the
next loop iteration.

* Remove TODO about deleting runtime directory

The socket file is not deleted after socket.close() is called, only
after libuv executes the close callback.
So we can't just call rmdir because it will probably always fail.

* CLeanup WriteRequest

* Update manpage authors

* Cleanup
2022-01-22 20:35:37 +01:00
Stefano Volpe
d995a39da8
feat(alsa): add middle and right mouse button events (#2573)
* Add events to alsa module

* Update CHANGELOG

* Update CHANGELOG.md

Closes #2566 

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2022-01-18 19:51:49 +01:00
Qntn
968d9c753f
fix(battery): More accurate battery state (#2556)
Fixes #2563 
Closes #2363

* Get battery status before adapter. (#2363)

* changelog: Move to Fixed section

Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2022-01-17 23:07:07 +01:00
Patrick Ziegler
e549527d3e
Clean up changelog (#2571) 2022-01-16 05:12:45 +01:00
Cameron
195a0d94df
feat(network): Add mac address token (#2569)
* Add mac address option

* Add error handling

* Address changes

* Move outside of for loop

* Update changelog
2022-01-16 02:39:55 +01:00
llenck
6e34265d7b
Replace system_clock with steady_clock (#2559)
This fixes #857 and #1932. Also replaces PR #1725, since we don't need
our own implementation of condition_variable anymore since people who
update their polybar should have GCC 10 by now.

The m_updated_at field of the mpd module was removed instead of having
its clock change because it became unused in commit 645a3142a1.
2022-01-12 23:06:29 +01:00
Jeremy Fleischman
f488a889bc
Add support for a tray-foreground setting. (#2552)
This adds a new `tray-foreground` config option, and uses it instead of
the `tray-background` setting to build up the `_NET_SYSTEM_TRAY_COLORS`
property. I'm pretty sure that the previous behavior was a mistake (this
was introduced in 94298741b6 which is a
pretty large diff).  For me and some other people, this results in a
black icon being drawn on top of a black background, which is pretty
useless! I would say that this diff fixes
https://github.com/polybar/polybar/issues/2235. Note: the old code dealt
with `unsigned int` and maxed values out at 0xff. The new code deals
with `uint16_t` and maxes values out at 0xffff. I haven't found the
relevant documentation to justify this change, but from manually
testing, I'm pretty confident this is the right change.

This all matches pretty closely with this code from i3:
[`i3bar/src/xcb.c::init_tray_colors`
code](43e805a00d/i3bar/src/xcb.c (L1490-L1522)),
which you can see also uses the bar's foreground color and maxes values
out at 0xffff, not 0xff.

If you merge this up, I think we should also update
https://github.com/polybar/polybar/wiki/Configuration#bar-settings to
mention the new settings.

Fixes #2235
2021-11-17 11:41:40 +01:00
Jean-Luc Bastarache
542f70efa3
fix(ipc): don't format empty strings (#2549)
* fix(ipc): don't format empty strings

* Add a description of the change to `CHANGELOG.md`

* Rephrasing
2021-11-04 16:55:16 +01:00
Patrick Ziegler
9e3b537817
feat: Support reading config from non-regular files (#2545)
We had a check that restricted config files to "regular files".
This check was to restrictive as it didn't allow for things like:

```
polybar -c <(gen_config)
gen_config | polybar -c /dev/stdin
```

Now, polybar can easily read config data from stdin.
2021-10-24 11:25:05 +02:00
TheDoctor314
6d1ff41d37
Handle relative includes (#2535)
* Handle relative includes

We change to the directory of the given config file before parsing.
This allows us to handle relative includes.
TODO: Maybe improve the name of the change_dir() function.

* Fix unused result warning

* Add `relative_to` parameter to expand()

If the path is relative, we resolve it by prepending
dirname(config) to the path.

Add dirname() - Returns the parent directory of the file or an empty
string.

* Resolve relative paths

Handle paths relative to the current file being parsed.

* Remove unneeded change_dir()

* Fix expand()

`is_absolute` is calculated after we expand the path.
`relative_to` must be a directory.

Add test for expand() with relative paths

* Recalculate `is_absolute` after expanding `path`

* Add more file_util::expand tests

* Add changelog

Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2021-10-20 12:31:15 +02:00
Patrick Ziegler
4d90ac2f4c
fix(net): Use canonical interface name (#2540)
One can define an 'altname' for an interface. That name is valid of
if_nametoindex but it doesn't appear in `/sys/class/net`:

```
sudo ip link property add dev enp0s31f6 altname eno
```

This creates an altname eno for the existing interface enp0s31f6

Before, using eno, would lead to an error in `realpath`.

Ref: https://www.reddit.com/r/Polybar/comments/q8f0ye/error_disabling_module_network_reason_realpath/hgqpq1m/?context=3
2021-10-15 17:36:32 +02:00
Tim Schumacher
281fdf6382
The xworkspaces module should wait for EWMH to become available (#2429)
* The xworkspaces module should wait for EWMH to become available

Before this change if EWMH wasn't available the xworkspaces module was
permanently disabled. When polybar was started alongside the window
manager e.g. from .xinitrc this caused a race condition between polybar
and the window manager and the xworkspaces module may or may not be
displayed. After this change polybar will wait for EWMH to become
available. This change closes #1915, see that issue for more details.

Curiously this only required the removal of the error condition which
used the be raised when EWMH wasn't available. The xworkspaces module
will show up on the bar as soon as the first EWMH event is processed by
the existing event handling code. I can't argue much about the
correctness of this patch but it seems to work flawlessly in my testing
with xmonad. I didn't test any other window managers. Note that removing
the error condition below which checks that _NET_DESKTOP_VIEWPORT is
available might make this work with pin-workspaces=true. I couldn't test
the effects of that change because I only tested with xmonad and xmonad
doesn't support _NET_DESKTOP_VIEWPORT, so I didn't make that change.

* xworkspaces: Remove check fo _NET_DESKTOP_VIEWPORT

Implementations that don't support it will just return an empty list for
get_desktop_viewports and pin-workspaces won't do anything.

* Update changelog

Fixes #1915

Co-authored-by: Tim Schumacher <tim@timakro.de>
Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2021-10-11 14:40:14 +02:00
dvermd
231af35354
feat(ipc): hook, prev, next, reset module actions (#2528)
* WIP ipc actions

* feat(ipc): Add hook, prev, next and reset actions

Closes: #2464

* ipc: format code

* ipc: fix comparison

* Apply suggestions from code review

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* ipc: make index 0-based

* ipc: add 0-based indexing breaking change to Changelog

* ipc: restore 1-based index for  and  message

* ipc: fix initial=0 throwing an error

Co-authored-by: Martin Terneborg <martinterneborg@protonmail.com>
Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2021-10-10 20:22:24 +02:00
dvermd
47b5910eda
Allow running polybar without BAR argument (#2526)
* Allow running polybar without BAR argument

The configuration file must declare a single bar to be able to not name
it.

* Check barname not in config and improve error message

* Revert README changes

* Add no bar in config file error detection
2021-10-07 14:48:47 +02:00
Patrick Ziegler
282b0f4e73
Create default config (#2511)
* 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>
2021-10-05 13:07:19 +02:00
dvermd
98dffc292a
feat(xkeyboard): Icon matching using variant (#2521)
* feat(string_util): add contains_nocase

* feat(xkeyboard): Enable icon by variant

* Cleanup

* string_util: add some cases to string test

* string_util: rename contains_nocase -> contains_ignore_case

* layouticonset: use contains_ignore_case

* layouticonset: apply renamings and remove dead code

* remove VARIANT_NONE and use empty string instead

* use emplace_back and add assert

* layouticonset: precompute condition

* xkeyboard: restore missing continue

* Cleanup parse_icons

* Always choose the first case-insensitive match

* Cleanup layouticonset.get

* update the changelog

Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2021-10-05 12:12:47 +02:00
Madhav Prabhu C M
e5ab7e1c00
Notification string to a queue of strings (#2517)
Fixes #2469

* made inputdata to queue<string>

* changed back to front

* fixed move semantics issue while popping queue

* Removed ide file

* commented test lines

* review changes

* review changes

* Update CHANGELOG.md

* Cleanup

Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2021-10-03 11:24:24 +02:00
Patrick Ziegler
444120e664
script: Fix concurrency issues (#2518)
Fixes #1978

* Move tail and non-tail handler to method

Defining them in the constructor is ugly.

* script: Iterate over defined actions instead of fixed list

* Separate running logic and lock m_output

* Include POLYBAR_FLAGS in linker flags

* Stop using m_prev in script_runner

* Join module threads in stop function

Joining in the destructor may lead to UB because the subclass is already
deconstructed but the threads may still require it to be around (e.g.
for calling any functions on the instance)

* Cleanup script module

* Update changelog

* Remove AfterReturn class

* Remove m_stopping from script module

* Fix polybar not reading the entire line from child process.

For every `readline` call we created a new fd_streambuf. This means once
`readline` returns, the streambuf is destructed and and pending data in
its temporary buffer discarded and we never actually read it.

* Remove unused includes
2021-10-03 01:27:11 +02:00
TheDoctor314
c7ffa60866 Update CHANGLELOG.md 2021-09-28 22:16:07 +02:00
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
TheDoctor314
55eb19fdc7
feat(ramp): Allow specifying ramp weights (#2505)
* feat(ramp) Implement ramp weights

*Add test for ramp weights

*[drawtypes/ramp] Implement ramp weights

Simply clone `label_t` weight no. of times in the icon list
This helps us not to change any of the calculations.

*Fix silly bug

Forgot to add a hyphen for the `weight` parameter.

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

*doc: add #1750 to CHANGELOG

* Fix compile error in ramp test

Use std::make_shared.
2021-09-22 21:46:20 +02:00
patrick96
21f6f7818a Update CHANGELOG.md 2021-09-21 20:36:23 +02:00
patrick96
dd4088910e Deprecate throttle-output and throttle-output-for
The eventloop no longer uses them. libuv will coalesces multiple
uv_async_send if they happen one after another and this also leads to
coalescing of updates.
2021-09-21 20:36:23 +02:00
patrick96
2512123a6c
Merge remote-tracking branch 'origin/hotfix/3.5.7' 2021-09-21 18:22:57 +02:00
patrick96
92722e05c2
Release 3.5.7 2021-09-21 18:12:57 +02:00
patrick96
a8cba9c43c fix(ipc): Replace all %pid% tokens
Fixes #2500
2021-09-13 14:18:18 +02:00
patrick96
6136c08d42 tray: Properly handle missing _XEMBED_INFO
The icon not supporting XEMBED is not fatal, we just treat is as always
mapped.

Fixes #2479
Fixes #2442
2021-09-13 00:12:33 +02:00
Patrick Ziegler
9f828800fb
fix(xworkspaces): Fix scrolling (#2492)
The scroll handler had two issues:

* It did not respect the order the desktops where displayed in
* It would not wrap around on the first desktop because of an integer
  underflow

Fixes #2491
2021-09-04 14:36:01 +02:00
Luca Maltagliati
ddabe3f0f4
feat(memory): Tokens that switch between MiB and GiB (#2488)
* feat:add tokens to display memory in MiB when GiB val <= 1.0 (#2472)

* fix: correct swap_used calculation

* fix: pass variable by reference rather than by value

* fix: add precision arguments to filesize_gib_mib(); better condition

* doc: add #2472 to CHANGELOG

* fix: missing default argument values

* Apply suggestions from code review

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2021-09-04 13:14:13 +02:00
Vincent Bernat
151a263654
fix(monitor): do not include outputs when monitors are supported (#2485)
* fix(monitor): do not include outputs when monitors are supported

Previously, when splitting an output into two monitors, `polybar -m`
would report both the splitted monitors and the output. This was not
caught by the the clone detection as the detection works by removing
monitors contained into another monitors (and monitors were excluded
from that logic) and we want the other way around: outputs covered by
monitors should be ignored.

Instead of trying to detect covered outputs, the solution is quite
simple: when monitors are supported, do not consider outputs, unless
we request all outputs. A monitor can be set primary (and RandR
reports primary outputs as primary monitors). The only information we
would miss from monitors are things like refresh rate and EDID. We
don't need that, so we are fine.

As monitors are only created for connected output (and they are in
this case "active") or disconnected output if they are mapped (and
they are in this case "inactive"), I am a bit unsure if we have
exactly the same behaviour as previously when `connected_only` is set
to `false`.

As some modules require an output, we keep the output in the
`monitor_t` structure and we ensure it is correctly set when using
monitors. A monitor can have 0 or several outputs. We only handle the
0 and 1 cases. When a monitor has more outputs, only the first one is
used. AFAIK, only the xbacklight module needs that and I think we are
fine waiting for a user needing this module and merging monitors.

The C++ binding fail to expose the `outputs()` method to iterate over
the outputs of a monitor. This seems to be a bug in XPP. The field is
correctly defined in the RandR XML file and it works with the Python
binding.

```xml
	<struct name="MonitorInfo">
		<field type="ATOM" name="name" />
		<field type="BOOL" name="primary" />
		<field type="BOOL" name="automatic" />
		<field type="CARD16" name="nOutput" />
		<field type="INT16" name="x" />
		<field type="INT16" name="y" />
		<field type="CARD16" name="width" /> <!-- pixels -->
		<field type="CARD16" name="height" /> <!-- pixels -->
		<field type="CARD32" name="width_in_millimeters" />
		<field type="CARD32" name="height_in_millimeters" />
		<list type="OUTPUT" name="outputs">
		    <fieldref>nOutput</fieldref>
		</list>
	</struct>
```

Falling back to C only to access the list of outputs is not enough
because the list is appended to the structure and not visible through
the public API. When copied, the structure loses the list of monitors.

Also, change the mention "XRandR monitor" to "no output" when there is
no output attached. People using monitors know what it means and it is
useful to catch a future regression where we don't have an output at
all (which would break the brightness plugin).

Fix #2481

* Update CHANGELOG.md

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2021-09-02 18:07:21 +02:00
Vincent Bernat
5f3462240c
feat(ipc): allow receiving arbitrary text on IPC socket (#2463)
This adds the 'send' action to the ipc module that can be used to send arbitrary text to the module:

    polybar-msg action "#ipc.send.%{F#4444ff}hello%{F-}"

* feat(ipc): allow receiving arbitrary text on IPC socket

Instead of just allowing hook numbers to be executed, the user can
send arbitrary text and the IPC module will put it in the bar. The IPC
payload format is extended to accept an arbitrary string if the first
character after the module name is ':'.

    polybar-msg hook test :'%{F#4444ff}hello%{F-}'

Fix #2455

* Use actions for sending data to ipc module

* ipc: Don't use exceptions when no hooks are defined

* Update src/modules/ipc.cpp

Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2021-07-11 20:42:28 +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
Nolan Prochnau
06932007a0
Universal Visibility Action (#2320 cont'd) (#2426)
* Add toggle_visible action

* Add set_visible and set_invisible actions

* Rename toggle_visible method to match

`action_toggle_visible` -> `action_toggle_visibility`

Matches with `EVENT_TOGGLE_VISIBILITY`

* Update CHANGELOG

* Revert #2320 IPC commands

IPC commands are no longer necessary now that the actions are
implemented. Changed some method permissions as well to reflect this.

* Add logging and change action names

- `module_toggle`
- `module_show`
- `module_hide`

Delineate common actions to all modules with a `module_` prefix (for
future actions too)

* Update documentation
2021-07-07 21:43:49 +02:00
Carlos Gonzalez
bfa9b5d53e
Adding case to ignore T@ in bspwm (#2439)
* Adding case to ignore T@ in bspwm

* Adding entry to changelog for issue #2371
2021-05-27 20:05:37 +02:00
patrick96
c65f6857e1
Merge branch 'hotfix/3.5.6' 2021-05-24 01:07:24 +02:00
patrick96
eb9c192d04
Release 3.5.6 2021-05-24 01:00:50 +02:00
patrick96
d8f4d56a95 Fix i3 module assertion failure
This brings #2417 into the hotfix release

Ref #2417
2021-05-24 00:57:57 +02:00
patrick96
ad987098ff fix(tray): Support clients with different depths
XCB_BACK_PIXMAP_PARENT_RELATIVE requires that the client has the same
depth as the tray window.

There was an issue with dropbox having a depth of 32 and the tray window
having a depth of 24 that caused the configuration of the icon to fail.
It would then be displayed outside of the bar because the catch block
was not hit (different exception).

We now just don't configure XCB_CW_BACK_PIXMAP. This seems to work and
is also what stalonetray does.

This does not fix the issue with dropbox having an arbitrary background.

Fixes #1679
Fixes #2430
2021-05-24 00:47:22 +02:00
Flexlolo
735a08ba7c
feat(bspwm): Option to scroll through occupied desktops only (#2428)
* Implement option occupied-scroll to bspwm module

* update changelog

* change default value of the setting
2021-05-13 12:59:13 +02:00
patrick96
1ddd8bd1e1 fix(build): Disable sphinx manpage section dirs
Before sphinx 4.0, this was the default but was changed in 4.0.
Now by default the folder structure looks like this:

man
├── 1
│   └── polybar.1
└── 5
    └── polybar.5

This restores the old behavior where there weren't individual folders
for the different sections.

Fixes #2424
Ref: https://www.sphinx-doc.org/en/master/changes.html#id14
2021-05-09 21:28:22 +02:00
Tim Schumacher
2901e1e476
Add wm-restack=generic option that lowers polybar to the bottom of the stack (#2404)
* Add wm-restack=generic to lower polybar to the bottom of the stack

Previously wm-restack only supported bspwm and i3. Both have a special
top-level window that polybar detects and places itself directly above.
This patch adds wm-restack=generic which simply lowers polybar to the
very bottom of the stack. This option was tested and confirmed to work
with xmonad which doesn't have a special top-level window and therefore
doesn't require special handling like bspwm and i3.

Fixes #2205

* Update src/components/bar.cpp

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2021-04-02 00:48:48 +02:00
patrick96
93ab639c8a fix: unbounded_percentage always rounded down
For example if lower / upper = 0.019 (1.9%), it would return 1% instead
of 2%

Fixes #2399
2021-03-03 22:48:17 +01:00