Commit Graph

2254 Commits

Author SHA1 Message Date
TheDoctor314
a7b978412c Add env parameter to exec_sh()
Before passing the cmd to exec() we set the required environment
variables.

Also add the test for it.
2021-09-28 22:16:07 +02:00
TheDoctor314
1e0e50266b Add get_with_prefix()
Returns a list of key-value pairs starting with a prefix.
If you have in config:
```
env-FOO = bar
env-CAT = dog
```

then `get_with_prefix("env-")` will return
`[{"FOO", "bar"}, {"CAT", "dog"}]`
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
98d9a882ea Fix polybar-msg compilation 2021-09-21 21:43:27 +02:00
patrick96
fa1240f4b6 Remove unused file_ptr 2021-09-21 21:43:27 +02:00
patrick96
3b6a950380 Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
patrick96
fabce6a493 Add tests for env_util 2021-09-21 21:43:27 +02:00
patrick96
0d1db206c6 Remove factory_util unique and shared
Equivalent to std::make_unique and std::make_shared
2021-09-21 21:43:27 +02:00
patrick96
560065540b Fix wrong assertion on network interface 2021-09-21 21:43:27 +02:00
patrick96
98919cbb77 Remove unused moodycamel concurrentqueue 2021-09-21 21:43:27 +02:00
patrick96
c922a94b67 Remove unused spin_lock 2021-09-21 21:43:27 +02:00
patrick96
0f72a2e0ea Remove unused throttle_util 2021-09-21 21:43:27 +02:00
patrick96
069036fa5a Add libuv to polybar-git PKGBUILD 2021-09-21 20:36:23 +02:00
patrick96
c29e4837df clang-format 2021-09-21 20:36:23 +02:00
patrick96
21f6f7818a Update CHANGELOG.md 2021-09-21 20:36:23 +02:00
patrick96
85d308cec8 Use libuv >= 1.3.0 2021-09-21 20:36:23 +02:00
patrick96
386eb57ba7 Reopen pipe path on EOF 2021-09-21 20:36:23 +02:00
patrick96
77b9cffaf8 Cleanup 2021-09-21 20:36:23 +02:00
patrick96
a158f0d7ec Add error callback for ipc handle 2021-09-21 20:36:23 +02:00
patrick96
52a3961602 Poll for X events in while loop
Otherwise we would only read a single event, even if multiple were
available causing delays.
2021-09-21 20:36:23 +02:00
patrick96
895c1a6b51 Handle fs_event and poll errors in handle wrapper 2021-09-21 20:36:23 +02:00
patrick96
db52106934 Support receiving IPC messages in multiple parts 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
511e73b3b5 Close handles in destructor 2021-09-21 20:36:23 +02:00
patrick96
91759a4c96 Store all handles inside eventloop
This is needed because the handle's lifetime has to be at least the
lifetime of the eventloop since the eventloop requires the handle's
memory during shutdown (for closing the handles).
2021-09-21 20:36:23 +02:00
patrick96
2551ea0205 Add wrapper for uv_async_t 2021-09-21 20:36:23 +02:00
patrick96
7b5285b51e Add wrapper for uv_timer_t 2021-09-21 20:36:23 +02:00
patrick96
309fd8221a Create wrapper for uv_pipe_t 2021-09-21 20:36:23 +02:00
patrick96
86f02a3ebe controller: Fix missing import 2021-09-21 20:36:23 +02:00
patrick96
6d3bb2211e Only trigger async once eventloop has been setup 2021-09-21 20:36:23 +02:00
patrick96
2c7af2a60c Store reload flag in controller 2021-09-21 20:36:23 +02:00
patrick96
ce63305c1d Better way to notify controller 2021-09-21 20:36:23 +02:00
patrick96
e3cb94ef88 Use uv timer for delayed screenshot 2021-09-21 20:36:23 +02:00
patrick96
6ac5b7ebdd Remove config inotify_watch
We use libuv now for watching the file
2021-09-21 20:36:23 +02:00
patrick96
ba50bf0bc6 controller: Remove m_process_events field 2021-09-21 20:36:23 +02:00
patrick96
75ff5c3b14 Remove exit_terminate signal 2021-09-21 20:36:23 +02:00
patrick96
07da1a2967 Stop using sigabbrev_np
GNU extension
2021-09-21 20:36:23 +02:00
patrick96
b9642e4cf3 Move update events to eventloop
We can now completely remove the eventqueue thread
2021-09-21 20:36:23 +02:00
patrick96
f36224eaab Move quit event to eventloop 2021-09-21 20:36:23 +02:00
patrick96
ba341f584e Remove CHECK event
Not used
2021-09-21 20:36:23 +02:00
patrick96
c89fc7f73b Handle click commands in eventloop 2021-09-21 20:36:23 +02:00
patrick96
88cd525dc8 Add wrapper for uv_pipe_t 2021-09-21 20:36:23 +02:00
patrick96
9d9fe8bffb Better error handling 2021-09-21 20:36:23 +02:00
patrick96
53ce1ae414 Move config watcher into eventloop 2021-09-21 20:36:23 +02:00
patrick96
f9d434052a Make UV handle wrappers more generic 2021-09-21 20:36:23 +02:00
patrick96
60ee63c0db eventloop: Throw exception for libuv errors 2021-09-21 20:36:23 +02:00
patrick96
3cc17a0e57 Move signal handling to eventloop class 2021-09-21 20:36:23 +02:00
patrick96
a2f50f3b90 Use uv_pipe_t for ipc 2021-09-21 20:36:23 +02:00
patrick96
74d8cf281c cmake: Fix FindLibUV 2021-09-21 20:36:23 +02:00