Add coordinates relative to the current output in i3bar click events

Currently i3bar click events provide x and y coordinates relative to all monitors.
I've added coordinates relative to the current output.

+-----------+-----------+
|           |   i3bar   |
|           +-----------+
|   HDMI-0  |    DP-0   |
| 1920x1080 | 2560x1080 |
+-----------+-----------+

When you click in the top right corner of the DP-0,
i3bar will provide something like this:

{
  "x": 4480,
  "y": 10,
  "output_x": 2560,
  "output_y": 10,
}

This is useful for creating a rofi menu or something else.
rofi -show run -location 1 -xoffset ${I3_OUTPUT_X} -yoffset ${I3_OUTPUT_Y}
This commit is contained in:
Andrey Burov
2020-10-06 21:38:09 +03:00
parent e6f419b882
commit 60384d446b
5 changed files with 27 additions and 10 deletions

View File

@ -28,6 +28,7 @@ working. Please reach out to us in that case!
• mention rofi in default config file
• i3-input: add different exit codes for when i3-input fails
• allow ppt values in move direction and move position commands
• i3bar: add coordinates relative to the current output in i3bar click events
┌────────────────────────────┐
│ Bugfixes │