Commit Graph

1048 Commits

Author SHA1 Message Date
patrick96
aebdb5328a fix(backlight): Poll if necessary
The `backlight` file seems to not receive modification events for
inotify (it does receive other events though).
These other events still trigger an update, but the value read is still
the old value because the events arrive just slightly before the file is
updated.

The new `poll-interval` setting will inject an event every X seconds to
force an update.
If the actual_brightness file is used, the interval is set to 0 and thus
turned off.

This does not add any more wakeups to the module, the inotify modules
wake up every second anyway and during that time, the interval is
checked.

Fixes #2835
2023-10-21 20:32:11 +02:00
patrick96
c9752598a5 fix(bspwm): Restack against topmost root window.
The ewmh strategy has to be dropped because the
`_NET_SUPPORTING_WM_CHECK` window may (at least in bspwm) appear
anywhere in the window stack.

To fix the overlapping monitors issue in #2873, we simply restack
against the topmost of these root windows.

Fixes #2972
Fixes #2873 (again)
2023-10-08 21:04:29 +02:00
patrick96
16102c258a alsa: include asoundlib.h instead of all alsa headers
In alsa 1.2.10, the `alsa/control.h` header cannot be included on its
own because it does not include all symbols it uses.

We are basically duplicating asoundlib.h anyway and there is even a
macro variable to switch to it.

Ref: #3009
Ref: https://github.com/alsa-project/alsa-lib/issues/348
2023-09-28 19:30:49 +02:00
dvermd
b754790642
Cleanup base::tags (#2991) 2023-07-06 09:46:33 +02:00
dvermd
06a3de0b89
Refactor config::dereference* (#2963)
* Refactor config::dereference*

* move config::deprecated* implementation to cpp file

* config: move more functions implementation to cpp file
2023-05-18 09:47:45 +02:00
patrick96
2c23f7a87f restack: Make bspwm first try ewmh strategy 2023-05-15 14:44:50 +02:00
patrick96
4f9f07eefd restack: Add ewmh restacking strategy
Positions the bar window above the _NET_SUPPORTING_WM_CHECK window

The generic restacking strategy now first tries the ewmh strategy, the
the bottom strategy.
2023-05-15 14:44:50 +02:00
patrick96
b11a2ff653 restack: Add bottom restacking strategy
For now this is the same as the generic one
2023-05-15 14:44:50 +02:00
patrick96
59acb4150b Clean up restacking code
Restacking algorithms now only need to provide the sibling window and
stacking mode.
2023-05-15 14:44:50 +02:00
patrick96
76c7ee3bf6 Introduce restacking utilities
Aim is to clean up restacking logic and remove some duplicated code
2023-05-15 14:44:50 +02:00
patrick96
425d4dc338 Cleanup 2023-05-10 17:06:00 +02:00
patrick96
32c78aa63a Cleanup ucs4_to_utf8 2023-05-10 17:06:00 +02:00
patrick96
5b1fae4fc1 Make utf8_to_ucs4 take a string reference 2023-05-10 17:06:00 +02:00
patrick96
5e5a0a7c4d Make unicode_charlist a vector 2023-05-10 17:06:00 +02:00
patrick96
3a27e891d2 fix(renderer): Drop strings with invalid UTF8 2023-05-10 17:06:00 +02:00
patrick96
63443f82d5 Refactor utf8_to_ucs4 2023-05-10 17:06:00 +02:00
patrick96
71c65447f8 Move utf8 conversion code to string utils 2023-05-10 17:06:00 +02:00
patrick96
6e716296ff Formatting 2023-05-10 17:06:00 +02:00
dvermd
f5169abde2
Remove unsupported.hpp (#2956)
* Remove unsupported.hpp

* Rename names.hpp to types.hpp

* Replace macro by function

* Add missing cassert include in controller.cpp
2023-05-08 19:36:12 +02:00
dvermd
0caa30683c
Remove config singleton (#2951)
* Remove unused function

* Refactor deprecation warning

* Modules take config as parameter instead of using the singleton

* Bar take config as parameter instead of using the singleton

* Renderer take config as parameter instead of using the singleton

* Legacy Tray Manager take config as parameter instead of using the singleton

* Screen take config as parameter instead of using the singleton

* Controller take config as parameter instead of using the singleton

* Remove the config singleton

* Apply review suggestion

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

* Apply style suggestion

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

* Apply style suggestion

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

* Apply style suggestion

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

* Apply style suggestion

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

* Apply style suggestion

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

* Apply style suggestion

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

* Apply style suggestion

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

* Apply style suggestion

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

* Apply style suggestion

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

---------

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2023-05-01 14:58:52 +02:00
patrick96
df32703a22 tray: Rework tray spacing
tray-padding determines space added before and after each icon
tray-spacing determines space added between icons (but not at the edge)

Both are an extent value and accept both pixel and point values.
2023-04-01 21:04:58 +02:00
patrick96
7fbd2d175c tray: Cleanup position calculation 2023-04-01 21:04:58 +02:00
patrick96
b5f8466117 tray: Replace tray-maxsize module setting with tray-size
The size accepts a percentage with offset relative to the bar height and
determines the width and height of tray icons.

Defaults to 66%

Does not affect spacing
2023-04-01 21:04:58 +02:00
patrick96
11746455ee
tray: Cleanup & documentation 2023-03-25 20:17:02 +01:00
patrick96
f3ce047c52
tray: Remove delayed notifications
Unclear why it is needed, neither i3bar, nor stalonetray do delayed
notifications
2023-03-25 19:28:43 +01:00
patrick96
47f6d9c25d
renderer: documentation 2023-03-23 23:12:50 +01:00
patrick96
58e0911ac6
tray: Disable pseudo-transparency for opaque bgs 2023-03-23 23:03:45 +01:00
patrick96
89f29fa12e
tray: documentation 2023-03-23 22:41:40 +01:00
patrick96
f6172e1459
Remove tray client gc
Not actually used anywhere
2023-03-23 22:27:43 +01:00
patrick96
1aeac226a6
Delete tray client pixmap and gc in destructor 2023-03-23 22:27:11 +01:00
patrick96
65279883c3
Replace wait_for_response with handle callback
The poll-loop could in theory swallow events which would not be seen by
the main eventloop
2022-11-30 15:06:17 +01:00
patrick96
aadd4ce1c8
Remove screen realloc argument
Replaced with explicit reset function
2022-11-30 13:41:25 +01:00
patrick96
d296d67953
Merge remote-tracking branch 'upstream/master' into tray-child-window 2022-10-31 23:30:07 +01:00
patrick96
f5d16891dd
tray: Cleanup 2022-10-31 23:21:00 +01:00
patrick96
ca25b5685c
tray: Add back legacy tray implementation
Is used for trays defined through tray-position and nothing else.
2022-10-31 23:05:23 +01:00
tnixeu
ed6a0e90fb fix code in order to support cmake unity builds 2022-10-29 15:09:03 +02:00
patrick96
291a4844bc fix(ipc): Crash when sending to multiple instances
In polybar-msg, the connection handle was captured as a reference to a
shared_ptr, but the shared_ptr went out of scope right after.

This probably always caused UB, but was only noticeable for two or more
instances.
2022-10-23 14:19:26 +02:00
Madhav Prabhu C M
30e1cc2595
feat(ipc): <label> support (#2841)
* Label = %output% working

* build fix

* Output as deprecated, Label as default

* Corrections

 * Corrections Simplified

* Changelog updated
2022-10-23 10:47:22 +02:00
Ashwin
cbfb417dce option to turn off struts 2022-10-22 13:06:06 +02:00
patrick96
6d74ae51e7
Merge remote-tracking branch 'upstream/master' into tray-child-window 2022-10-16 21:31:07 +02:00
patrick96
31bdacb3d7 Remove never used systray module
Not the same as the new tray module
2022-10-16 21:25:48 +02:00
patrick96
3561fd3ad1 Templatify module factory
Saves us a lot of code duplication by generating module type-indexed map
and factory functions from the module class names.
2022-10-16 21:25:48 +02:00
Patrick Ziegler
56779a5902
Make the event loop return shared_ptrs (#2842)
* Return shared_ptr from eventloop

* Add -Wdeprecated-copy-dtor warning

Produces a warning if classes don't have explicit copy operations if
they have a user-defined constructor.
This helps us stick to the rule of 5 (kinda, no warnings for missing
move operators).

* Clean up eventloop

* Fix compiler warnings

* Fix fs_event_handle_t name
2022-10-15 23:21:40 +02:00
patrick96
d6997659fa
cleanup 2022-10-12 23:34:38 +02:00
Madhav Prabhu C M
54b75f23ab
feat(ipc). Per hook format (#2810)
* Added format-x support for ipc_module, tested with demo config

* Certain cases not working

* Certain cases not working, build

* Changed label to output tag, Mixing of default formats wont work

* created changelog
2022-10-09 18:42:36 +02:00
Ron0Studios
303015244e
feat: longest match ws-icon fuzzy matching (#2831)
* better fuzzy matching

Improved fuzzy matching so that it finds the longest matching icon instead of the first possible match

* Update CHANGELOG.md

* removed debug output

* added tests and improved fuzzy finder

- added return statements to the fuzzy finder
- added tests to check whether the fuzzy finder works.

* minor style changes

* minor change to iconset.cpp

* Delete tasks.json
2022-10-05 23:05:44 +02:00
patrick96
0096fea839
Merge remote-tracking branch 'upstream/master' into tray-child-window 2022-10-05 23:02:18 +02:00
patrick96
5719d130fd feat(xwindow): %instance%, %class% from WM_CLASS 2022-10-02 20:57:29 +02:00
patrick96
463ef963a1
Add pseudo transparency back to tray icons 2022-10-01 22:24:23 +02:00
patrick96
def2682b8c
tray: Set _NET_SYSTEM_TRAY_VISUAL 2022-09-26 21:39:10 +02:00