#Scroll workspaces using mousewheel over komorebi-bar
1 messages ยท Page 1 of 1 (latest)
Short answer: no
Longer answer: this sounds cool ๐ cc @shy sentinel
@past plinth
yeah, if you hover the egui bar, there might be events we can hook up to and scrolling could be one of them. it is an interesting idea.
would you want to scroll only when hovered over the workspaces widget or anywhere on the bar?
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.
GG @past plinth, you just advanced to level 1!
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 ๐
@past plinth I am working on this, but the MouseFollowsFocus ruins everything. Do you use it?
I hadn't actually turned it off, but I'm doing that right now. ๐
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
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
I use win + shift + h and win + shift + l, but yes, those are what I'd expect.
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
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.
GG @past plinth, you just advanced to level 2!
Oh, there is one.
we actually do that on some other places. I will try
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?
we can do this
Oh, great.
I will try this, I almost forgot we did this
So I guess it's just the toggle with a conditional for whether it's set or not. ๐
Amazing!
@past plinth I swear I am using my mouse only
@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?
What does it do? ๐
it lets you fine tune the sensitivity of the "tick" at which the message is sent
Is that for trackpads?
mouse scroll wheel
My mouse doesn't do any scrolling unless I do the "click"
yeah, let me check
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
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
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
oh boy, I thought I am done ๐
(Sorry!)
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
I like this feature, so we might as well make it even better so you never leave komorebi ๐
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
)
same here
Wait you don't feel the "clicks" when you're scrolling? ๐ค
yep, best feature
I love doing a big scroll and then feeling the tactile feedback when I stop it haha
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
Oh I realized I actually use the custom gesture button as toggle monocle sometimes
I don't actually use that button ๐ try smooth scrolling, it's speed! ๐
You can try it out if you want, but I will try to include the features we talked about soon
@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
Oh, fantastic! I'll try it as soon as I get a chance.
Thanks so much.
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 ๐
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"
},
@inland vault @past plinth The config and other things have changes, check out the pr for more. I think this feels good now.
I'll build this later this week, I got very sidetracked with video editing this week
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. ๐