#Scroll workspaces using mousewheel over komorebi-bar

1 messages ยท Page 1 of 1 (latest)

past plinth
#

I'm just wondering if it's possible to scroll between workspaces using the mousewheel, but only when the mouse is hovering over komorebi-bar.

Basically trying to recreate as much of my i3/sway setup as possible!

inland vault
#

Short answer: no

Longer answer: this sounds cool ๐Ÿ‘€ cc @shy sentinel

shy sentinel
past plinth
#

In my usual Linux setup, I have it just scrolling workspaces when I'm anywhere over the bar. The bar I use there (waybar) does seem to allow some widgets (like volume) to grab the mousewheel for their own purposes, but I'm happy just for it to be bar-wide behaviour.

lone houndBOT
#

GG @past plinth, you just advanced to level 1!

shy sentinel
#

ok, let's see if egui catches anything like that ๐Ÿ™‚ (it does have a scrollbar so it should be fine)

#

after a quick search it seems to be possible, now I just need time to do it ๐Ÿ˜…

shy sentinel
#

@past plinth I am working on this, but the MouseFollowsFocus ruins everything. Do you use it?

past plinth
#

I hadn't actually turned it off, but I'm doing that right now. ๐Ÿ™‚

shy sentinel
#

right now when you hover over the bar and cycle the workspaces, your mouse will snap to the focused container on your workspace. I find it annoying ๐Ÿ˜„

#

not sure what you use but I have this key bind for whkd. I am not sure what to do, as I cannot turn it off when the cycle command is called.

You can test it with these commands

alt + z                           : komorebic cycle-workspace previous
alt + x                           : komorebic cycle-workspace next
#

these are basically the commands that I would call on scroll

inland vault
#

If you use AHK I think you can bind to mwheel up and down ๐Ÿ‘€

#

You could do alt + mwheel to change workspaces anywhere on the screen

past plinth
#

I use win + shift + h and win + shift + l, but yes, those are what I'd expect.

shy sentinel
#

Do you guys have any suggestion? It works just fine, but MouseFollowsFocus needs to be turned off for this to make sense

#

I can add a PR so you can try it out. Let me make it look pretty first

past plinth
#

I mean, I suppose komorebic mouse-follows-focus false ; komorebic cycle-workspace next ; komorebic mouse-follows-focus true would be hideous, and you'd also really more want a toggle command rather than a manual on/off.

lone houndBOT
#

GG @past plinth, you just advanced to level 2!

past plinth
#

Oh, there is one.

shy sentinel
#

we actually do that on some other places. I will try

past plinth
#

komorebic toggle-mouse-follows-focus

#

That causes another problem, though, in that it would break things the other way around.

#

Is there a query function?

shy sentinel
past plinth
#

Oh, great.

shy sentinel
#

I will try this, I almost forgot we did this

past plinth
#

So I guess it's just the toggle with a conditional for whether it's set or not. ๐Ÿ™‚

#

Amazing!

shy sentinel
#

@inland vault one question, there is a setting I want to add to the config called SCROLL_THRESHOLD. can it be on the bar or it should be on the komorebi config?

inland vault
#

What does it do? ๐Ÿ‘€

shy sentinel
#

it lets you fine tune the sensitivity of the "tick" at which the message is sent

inland vault
#

Is that for trackpads?

shy sentinel
#

mouse scroll wheel

inland vault
#

My mouse doesn't do any scrolling unless I do the "click"

shy sentinel
#

yeah, let me check

inland vault
#

Ideally we should just use a sane default and ditch the configurability

#

ie. whatever triggers a scroll of a webpage should trigger a scroll event/ws change

shy sentinel
#

I am not sure about a "click" I have smooth scrolling as well

#

that is why I wanted this in the settings, but the default should be a sensable value

#

egui does not send an event on a "click", but scroll vec on each frame, so I need to collect it and do a callback when the threshold is reached

#

I will make a PR so you can tell me how much should be the default

inland vault
#

I think we should probably wrap this whole mouse scrolling callback stuff in another layer

#

So it can be a top level config on komorebi bar

#

Where the user can select one of N behaviour options for scroll up and scroll down, and the threshold

#

Right now we only have ws changing, but this way we can handle other actions in the future

shy sentinel
#

oh boy, I thought I am done ๐Ÿ˜„

past plinth
#

(Sorry!)

shy sentinel
#

I like the idea, so you can choose the command you want

#

I will draft a PR then so you guys can test it out and we can add more to it

shy sentinel
# past plinth (Sorry!)

I like this feature, so we might as well make it even better so you never leave komorebi ๐Ÿ˜„

past plinth
#

๐Ÿ˜„

#

Not much chance of that, now! Transformed my usage of Windows.

shy sentinel
#

I might as well ask, do you have side scroll on your mouse?

#

we could make it so you do different things on horizontal and vertical scrolling ๐Ÿ˜‰

#

(why am I digging this hole deeper HaHaHidethepain )

inland vault
#

Lol I do

#

Mx Master 3

shy sentinel
#

same here

inland vault
#

Wait you don't feel the "clicks" when you're scrolling? ๐Ÿค”

shy sentinel
#

I use smooth scrolling

#

you have that button above the scroll wheel

inland vault
#

Ooooh

#

That's what that's for

#

๐Ÿคฃ

shy sentinel
#

yep, best feature

inland vault
#

I love doing a big scroll and then feeling the tactile feedback when I stop it haha

shy sentinel
#

well, I can see the benefit in having the option to set what you do on vertical and horizontal scroll, so I guess we will have it

inland vault
#

Oh I realized I actually use the custom gesture button as toggle monocle sometimes

shy sentinel
#

I don't actually use that button ๐Ÿ™‚ try smooth scrolling, it's speed! ๐Ÿš…

shy sentinel
#

@inland vault @past plinth I did a bit of work on mouse events and you can now use left/right/middle/back/forward/horizontal scroll/vertical scroll to make actions like this

  "mouse": {
    "on_secondary_click": "NewWorkspace",
    "on_middle_click": "CloseWorkspace",
    "horizontal_scroll_threshold": 100,
    "on_scroll_right": "CycleFocusWorkspaceNext",
    "on_scroll_left": "CycleFocusWorkspacePrevious"
  },

Please give it a try and if you have ideas for other commands, just let me know

#

you can see your options here

past plinth
#

Thanks so much.

shy sentinel
#

I think all the toggle and cycle commands could be added and even the flip-layout

perhaps I need a more generic way to send commands so that could be used everywhere in the project ๐Ÿค”

#

@past plinth oh, one thing I should mention is that the "scrolling" should also work on a mouse touchpad and touchscreen. so you can swipe on the bar to send commands too ๐Ÿ™‚

shy sentinel
#

just gonna keep you up to date that you can use custom commands now (supporting env vars!). I think that would be useful

  "mouse": {
    // [...]
    "on_primary_click": "komorebic replace-configuration $Env:USERPROFILE/komorebi.json"
  },
shy sentinel
#

@inland vault @past plinth The config and other things have changes, check out the pr for more. I think this feels good now.

inland vault
#

I'll build this later this week, I got very sidetracked with video editing this week

past plinth
#

Yes, sorry I haven't had much chance to play with this. Incredibly busy time at work, and Easter holidays for the children aren't adding to my available time. ๐Ÿ™‚