Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can a script behind a block retrieve the dimensions of a blocklet? #445

Open
ghistes opened this issue Dec 11, 2020 · 1 comment
Open

Can a script behind a block retrieve the dimensions of a blocklet? #445

ghistes opened this issue Dec 11, 2020 · 1 comment

Comments

@ghistes
Copy link

ghistes commented Dec 11, 2020

Hi,

I would like to take advantage of the mouse-clicks that are available now and would like to make a clickable block that behaves differently if clicked on the right side, the middle or the left side.

When reading the mouse-event you can get both the absolute coordinates as well as the relative coordinates of the click but in order to determine which part of a block has been clicked I would also need the dimensions of the block.

Is there any way to get these?

Many thanks!

@zsugabubus
Copy link

According to i3blocks#click and i3bar-protocol you can get all the needed values. On the bottom of the i3wm site you can see some variables that i3blocks passes as environment variables for scripts. For example echo w=$width x=$relative_x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants