3

I've been trying to map actions in keyboard shortcuts to be triggered by Alt+Scroll up or Alt+Scroll down. However, it looks as if scrolling isn't considered valid as the second part of a shortcut. Is there a solution that will allow me to accomplish this? Preferably one that doesn't require AutoHotkey?

Edit: I'm using Ubuntu 18.04.3 LTS.

4
  • @PRATAP Sorry, edited to include my os version. And I'm not sure I understand the second part of your question? I'm talking about scrolling with the mouse, not with keys.
    – bug56
    Sep 1, 2019 at 13:54
  • 0h thats a good point.. scrolling with mouse buttons cant be assigned from keyboard shortcuts.. you can use xbindkeys to use as combination of alt+mose button 4 and alt+mouse button 5 which are scroll down and scroll up..
    – PRATAP
    Sep 1, 2019 at 13:56
  • @PRATAP switching workspaces up/down, thanks for your comment I'm looking into xbindkeys now.
    – bug56
    Sep 1, 2019 at 13:59
  • @PRATAP I figured it out, thanks for your help!
    – bug56
    Sep 1, 2019 at 14:39

1 Answer 1

3

I found the solution! The following will do the trick using xbindkeys:

# Workspace up
"xdotool set_desktop $(expr $(expr $(xdotool get_desktop) + 1) % $(xdotool get_num_desktops))"
   Alt+b:5

# Workspace down
"xdotool set_desktop $(expr $(expr $(xdotool get_desktop) + $(expr $(xdotool get_num_desktops) - 1)) % $(xdotool get_num_desktops))"
   Alt+b:4

Got the commands from here

1
  • great job!! and s0 quick..
    – PRATAP
    Sep 1, 2019 at 14:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .