greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.88k stars 475 forks source link

disable interpretation of the scroll wheel completely #1627

Closed kevenwyld closed 7 months ago

kevenwyld commented 2 years ago

Thanks for this wonderful project!

Is it possible to disable the scroll wheel completely and mimic the behavior of the standard i3status where scrolling anywhere on the bar will switch workspaces?

Currently you can switch workspaces with the scroll wheel but only in the area not containing i3status-rust text and icons.

MaxVerevkin commented 2 years ago

It is not possible (by i3bar protocol design) to disable interpretation of scroll wheel specifically. The i3bar protocol only provides an option to disable all click events.

the behavior of the standard i3status

As far as I know, i3status doesn't handle clicks at all.

kevenwyld commented 2 years ago

@MaxVerevkin Sorry I think there may be a misunderstanding. My goal was to allow i3bar to interpret the scroll wheel as a workspace change, which is the default behavior. When using i3status-rust those scroll events are sent to i3status-rust when you scroll over the portion of the bar where i3status-rust output is displayed. If you are not over the status line, say to the left of the text, then i3bar interprets scrolling and changes workspaces (up for previous, down for next) on that display output. Sounds like it's still not possible to change that behavior though.

Anyway thanks for your time.

MaxVerevkin commented 2 years ago

My goal was to allow i3bar to interpret the scroll wheel as a workspace change

Well, this is already possible by adding appropriate click handlers for each block. Maybe what you want is a way to add a default click handler that applies to all blocks?

kevenwyld commented 2 years ago

Yes, I think that would work around this problem as I could set next/previous events for scrolling in a global handler to mimic what i3bar already does. Are clicking and scrolling considered the same thing though?

I'm not exactly sure why this isn't an issue with other bars though. the default i3status must just not accept scrolling events so you can scroll anywhere on the bar and change workspaces.

MaxVerevkin commented 2 years ago

this is already possible by adding appropriate click handlers for each block

I must mention that I'm talking about the master branch, not 0.22 release.

kevenwyld commented 2 years ago

this is already possible by adding appropriate click handlers for each block

I must mention that I'm talking about the master branch, not 0.22 release.

Ah, I will give that a try first to see if the behavior is the same before we continue here. Thanks!

MaxVerevkin commented 2 years ago

Are clicking and scrolling considered the same thing though?

Yes. This comes from the way i3 bar protocol works.

the default i3status must just not accept scrolling events

It does not accept any click events. You can learn more about i3 bar protocol here.

MaxVerevkin commented 2 years ago

I will give that a try first to see if the behavior is the same

It is the same... But it lets you assign custom handlers for scrolling "events".