Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-05-16 09:40:33

xface_usr
Member
Registered: 2022-05-16
Posts: 7

Switch workspaces ALT+Scroll

Hi. I've been using openbox + tint2 for many years and was using this combination to switch between workspaces for years. Now i moved to xfce and really missing this feature. Is it possible to implement it somehow?

Offline

#2 2022-05-17 00:54:33

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Switch workspaces ALT+Scroll

Hello and welcome.

By default (assuming Settings Manager > Window Manager Tweaks > Workspaces > Use the mouse wheel on the desktop to switch workspaces is enabled), you don't need the alt key. You can also scroll directly on the pager plugin in the panel to achieve the same. These are probably the simplest methods.

However, if you want to use the specific Alt+scroll wheel action to switch workspaces, you'll need to have xbindkeys and xautomation installed. Also, you will need to change the "key used to grab and move windows" (Window Manager Tweaks > Accessibility) to something other than alt. Then, create the files ~/.xbindkeysrc with the following content:

"xte 'mouseclick 4'"
	Control+Alt + Home
"xte 'mouseclick 5'"
	Control+Alt + End

...save the file and make sure xbindkeys is running (manually or add it to your start up files). Assuming that the default shortcuts for move to next workspace and move to previous workspace are unchanged, then Alt + scroll will change the workspace.

A couple of caveats:
- some applications grab the alt+scroll combo for internal use (e.g. xfce4-terminal, firefox). You'll need to find a way to disable it for them if possible.
- If you change the window grab option away from alt, you won't be able to use alt to grab windows (you can specify another key and use that instead).


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2022-05-17 05:54:41

xface_usr
Member
Registered: 2022-05-16
Posts: 7

Re: Switch workspaces ALT+Scroll

Thank you very much!

Offline

#4 2022-05-17 11:31:27

xface_usr
Member
Registered: 2022-05-16
Posts: 7

Re: Switch workspaces ALT+Scroll

I could not make your script work. But it works like this:
"xdotool key 'Control_L+Alt_L+Home'"
       m:0x8+b:4
"xdotool key 'Control_L+Alt_L+End'"
       m:0x8+b:5 

But to continue scrolling need to relese Alt and press it again.

Offline

#5 2022-05-17 18:48:13

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Switch workspaces ALT+Scroll

xface_usr wrote:

I could not make your script work. But it works like this:
"xdotool key 'Control_L+Alt_L+Home'"
       m:0x8+b:4
"xdotool key 'Control_L+Alt_L+End'"
       m:0x8+b:5 

But to continue scrolling need to relese Alt and press it again.

With the xte/xbindkeys approach, you don't need to release and press Alt like you would with xdotool. Try my approach again, and this time when it doesn't work, post back:

 cat ~/.xbindkeysrc

and

ps -ef | grep xbindkeys

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2022-05-18 05:40:03

xface_usr
Member
Registered: 2022-05-16
Posts: 7

Re: Switch workspaces ALT+Scroll

┌──(kali㉿kali)-[~]
└─$  cat ~/.xbindkeysrc
"xte 'mouseclick 4'"
    Control+Alt + Home
"xte 'mouseclick 5'"
    Control+Alt + End
                                                                                                                 
┌──(kali㉿kali)-[~]
└─$ ps -ef | grep xbindkeys
kali        1153       1  0 01:37 ?        00:00:00 /usr/bin/xbindkeys -f /home/kali/.xbindkeysrc
kali        1457    1265  0 01:38 pts/0    00:00:00 grep --color=auto xbindkeys
                                                                                                                 
┌──(kali㉿kali)-[~]
└─$ 

this does not react to Alt + wheel

Last edited by xface_usr (2022-05-18 05:40:23)

Offline

#7 2022-05-18 10:29:35

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Switch workspaces ALT+Scroll

What about:

xfconf-query -c xfce4-keyboard-shortcuts -lv | grep move_window_[np]

and...

which xte

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#8 2022-05-19 11:27:34

xface_usr
Member
Registered: 2022-05-16
Posts: 7

Re: Switch workspaces ALT+Scroll

┌──(kali㉿kali)-[~]
└─$ xfconf-query -c xfce4-keyboard-shortcuts -lv | grep move_window_[np]
/xfwm4/custom/<Primary><Alt>End            move_window_next_workspace_key
/xfwm4/custom/<Primary><Alt>Home           move_window_prev_workspace_key
/xfwm4/default/<Primary><Alt>End           move_window_next_workspace_key
/xfwm4/default/<Primary><Alt>Home          move_window_prev_workspace_key


┌──(kali㉿kali)-[~]
└─$ which xte
/usr/bin/xte

Offline

#9 2022-05-19 23:38:21

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Switch workspaces ALT+Scroll

With xbindkeysrc not running, does pressing Alt+scroll on the desktop (not in a window), scroll workspaces for you?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2022-05-20 08:21:18

xface_usr
Member
Registered: 2022-05-16
Posts: 7

Re: Switch workspaces ALT+Scroll

no

Offline

#11 2022-05-20 11:19:52

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Switch workspaces ALT+Scroll

I was using a VM for testing and it was confusing the result - something within that VM was allowing Alt+scroll to work. Have a look at this askbuntu post - the suggestion works for me on a full install (not VM). It gets a little confusing when you scroll over an app window because it scrolls both the app and the workspace. Works best if you scroll over the desktop.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2022-05-20 12:02:11

xface_usr
Member
Registered: 2022-05-16
Posts: 7

Re: Switch workspaces ALT+Scroll

Solution from this link works like a magic! Thank you very much again!

Offline

Board footer

Powered by FluxBB