Shortcut Keys for Switching Desktops


#1

Hi, I’m working with a fresh install of LXQt on a fresh install of Arch, using Kwin WM. Except for those not much is installed yet, which might make troubleshooting easier. One thing I am missing that I am used to from other LXQt installs is being able to use Ctrl Alt + right or left arrow key to change to the next desktop, for example from desktop one to two, two to three, etc., or vice-versa. This shortcut is not working for me here. Looking at ~/.config/lxqt/globalshortcutkeys.conf I see code for switching to specific desktops, 1 to 10, and I wonder if there is anything I could do to get the shortcut to change to the next desktop that is ingrained in my fingers. Thanks


(Pedram Pourang) #2

I use KWin and Ctrl+Alt+Right/Left worked out of the box, as they worked under KDE.

However, if you want to assign shortcuts for changing KWin desktop and more, you could choose your commands from this list:

qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Switch to Next Desktop"
qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Switch to Previous Desktop"

qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Window to Next Desktop"
qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Window to Previous Desktop"

qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "view_zoom_in"
qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "view_actual_size"

qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Expose"
qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "ShowDesktopGrid"

qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Cube"
qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Cylinder"
qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Sphere"

(Stefano) #3

Here with kwin no way, only the default cltr+f[number] is working.

So thanks for the comands tsujan, creating shortcuts is working (I used ctrl+space for switching under openbox)


(Pedram Pourang) #4

I had KDE before discovering and using LXQt; so, maybe, I’d assigned Ctrl+Alt+Right/Left from start and then, they worked under LXQt automatically — I don’t remember. However, the dbus commands should work everywhere.


#5

Thanks for replies. I need a little more help understanding how to enter these commands. Is there a script where I can copy them to? Or do I use a gui interface like in LXQt Settings --> Shortcut Keys? Help much appreciated!


(Stefano) #6

Yes, this is the way.


#7

Okay. I’m not a Qt developer and am unfamiliar with qdbus, so I need more guidance implementing these commands. For example, let’s take

qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Switch to Next Desktop"

and then go to Shortcut Keys in LXQt settings. I enter Ctrl+Alt+Right as the shortcut, Switch to Next Desktop as description, choose “dbus message” as type, I’m asked to enter service, path, interface, and method.
So, just guessing “org.kde.kglobalaccel” is the service, “/component/kwin” is the path, “invokeShortcut” as the interface (??) then what would be the method? I’m not sure I see a command here. Please help me out.


(Stefano) #8

Use command, it’s a command for the shell. This worked here, maybe there is some way using dbus message but no idea.


#9

@stefonarch, do you have the program qdbus installed, perhaps as /usr/bin/qdbus? I don’t, so I can’t run any commands with it.
$ qdbus bash: qdbus: command not found Also, I see no way of installing just qdbus. Though I see it as part of qt5-tools, that’s lots of other stuff there too and I’m trying to keep my system lean and mean.
So that’s why I was looking at a dbus option. Perhaps this keyboard combo isn’t going to work for me, but I’ll keep trying as my fingers are used to it…and much nicer than reaching way up for F2 all the time.


(Alf Gaida) #10

@kendew - just search with pacman for bin/qdbus


#11

Been there, done that. I don’t really want to install a whole package like qt5-tools just to get qdbus, even though the method tsujan suggested seemed promising. In the end, I just edited kglobalshortcutsrc directly and got what I wanted. See if it sticks.


(palinek) #12

Then just search for man qdbus -> e.g. https://manpages.ubuntu.com/manpages/disco/en/man1/qdbus.1.html and with the knowledge of arguments meaning do try-error with the shortcutkeys configuration… I’m sure, you’ll get it working.


#13

I like Arch, but I’m far from an Arch expert, so I have no idea why Arch doesn’t offer it as a standalone program like Debian does even though it’s included in the Arch qt5-tools package. Perhaps I’ll have the chance to play with qdbus commands on a Debian system at some point. I’ll look forward to it.

Anyway, for the time being, editing kglobalshortcutsrc has done the trick, giving me the ability to switch to the desktop on the right or left using Ctrl+Alt+Right(or Left), making my fingers happy.
I want to thank everyone who has contributed here. I’ve learned a lot!


(Pedram Pourang) #14

Because it isn’t so. The source of qdbus is qttools. Unlike Debian, Arch doesn’t split packages.


#15

Thank you. That was the key I needed. Things are much clearer now.