What is the key combination to move an application to a different workspace in Lubuntu?
Setting the shortcut
The command
To move an application (-window) to another workspace from command, you need wmctrl
to be installed. The command you need to move the frontmost application (-'s window) to a specific workspace (on Lubuntu) is:
wmctrl -r :ACTIVE: -t 1
where 1
refers to the targeted workspace. The first workspace is 0
, so the command above will move the active window to the second workspace.
Shortcuts in Lubuntu
In Lubuntu, to set custom shortcuts, (indeed) you have to manually edit the file ~/.config/openbox/lubuntu-rc.xml
.
The easiest way to get the right syntax is to move to the keyboard
section of the file, and simply copy an existing shortcut section, like the example below:
<!-- move window to workspace 2 on Ctrl + Alt + Y-->
<keybind key="C-A-Y">
<action name="Execute">
<command>wmctrl -r :ACTIVE: -t 1</command>
</action>
</keybind>
As a test, I added the section, and it worked fine (after log out/in); it moved the active window to the corresponding workspace on the shortcut Control+Alt+Y.
What you should keep in mind:
-
The command needs
wmctrl
to be installed:sudo apt-get install wmctrl
It takes a log out/in to start working
- The first workspace has index
0
, so the command in the example actually moves the active window to the second workspace.
A more detailed instruction on adding custom shortcut keys and the used syntax, see here, in the section further down; Create New Keyboard shortcuts Also here, you can find a.o. how to "mention" the keys in your shortcut section:
Key combination
KEY-COMBINATION is the key combination which you want to bind to the actions. The format for the KEY-COMBINATION is: Modifier-Modifier-Key. Any number of modifiers (0 or more) can be used together, and they are each separated by a "-". Multiple KEY-COMBINATION can be specified in one keybind by separating them with spaces. This is useful if you use multiple keybinds for a thing that is quite complicated to specify.
Modifiers
Modifier keys
S Shift key
C Control key
A Alt key
W Super key (Usually bound to the Windows key on keyboards which have one)
M Meta key
H Hyper key (If it is bound to something)
You can also use Mod1 through Mod5 as the modifiers to directly select a modifier mask (e.g. Mod1 to select Mod1Mask), but this is for advanced users who have customized their modifier mapping with xmodmap.
More "sophisticated" options
You could create a script to see what is the current workspace, and move the active window to the next/previous one, instead of having to set a key combination for every (targeted) workspace.
That would however be another question :)