Commit Graph

2222 Commits

Author SHA1 Message Date
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
patrick96
ba118477e0 ci: Add libuv dependency 2021-09-21 20:36:23 +02:00
patrick96
249c3ec141 Use libuv for the controller's event loop 2021-09-21 20:36:23 +02:00
patrick96
0bf45f3bd6 Update PKGBUILD for 3.5.7 2021-09-21 18:37:22 +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
Samuel Henrique
6816891cf1
Update Debian installation instructions (#2499) 2021-09-12 01:13:51 +02:00
Patrick Ziegler
5011e66346
fix(net): Check if interface is valid first. (#2497)
Fixes #2496
2021-09-09 21:47:23 +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
Patrick Ziegler
a520fead94
doc: Update description of polybar -m/-M (#2487)
It should be clear that `polybar -M` represents all valid monitor names.
2021-09-02 18:18:52 +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
523e4d6313 fix(fs): Only add spacing between shown mountpoints
Fixes #2458
2021-07-11 14:51:15 +02:00
patrick96
c901826317 Use CMAKE_EXE_LINKER_FLAGS
The newere target_link_options is not supported by our minimum cmake
version (3.5)
2021-07-11 14:47:26 +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
patrick96
55509efa1d
doc: Add version to module visibility actions 2021-07-10 21:22:17 +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
Patrick Ziegler
dcd33057fd
Use master branch for googletest (#2451)
gtest recommends using the `master` branch as it follows the "Live at
Head" philosophy.

[1]: https://github.com/google/googletest#live-at-head
2021-06-16 17:46:53 +02:00
Patrick Ziegler
3247a57a63
Change over all IRC mentions to libera (#2450) 2021-06-16 17:02:58 +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
e66a678c12 Update PKGBUILD for 3.5.6
We can now remove the temporary fix for the i3 crash
2021-05-24 01:23:57 +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
cbe4521737 tray: Do not swallow clear_window exceptions 2021-05-24 00:47:22 +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
patrick96
10bbec4451 Fix abort in i3 module with new ArchLinux flags
Fixes #2416
Ref: https://github.com/polybar/i3ipcpp/pull/11
2021-04-25 13:37:00 +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