You are not logged in.
Pages: 1
Hi, I am looking to setup a keyboard shortcut to toggle between 2 workspaces. However, I can't find any option in "Window Manager > Keyboard" section to assign this shortcut. This is the only thing missing from my perfect setup, Any help is appreciated
Offline
If by "toggle" you mean automatically switching between only two workspaces, then that does not exist. The keyboard shortcuts allows you to move to different workspaces using different shortcuts.
However, you can create a script that does this and assign your keyboard shortcut to the script. Here is a sample script that uses the wmctrl utility (you may need to install it):
#!/usr/bin/env bash
# set these to the two workspaces you want to toggle.
WS1=1
WS2=2
CURRENT=$(( $(wmctrl -d | grep " \* " | awk '{print $1}') + 1 ))
if [ $CURRENT -eq $WS1 ]; then
wmctrl -s $(( $(echo $WS2) -1 ))
else
wmctrl -s $(( $(echo $WS1) -1 ))
fi
exit 0
Edit the "WS1" and "WS2" variables to indicate the workspace numbers you want to toggle and make the file executable. Then create a keyboard shortcut for it in Settings Manager > Keyboard > Application Shortcuts.
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
Was searching the internet for a solution.
Have 2 workspaces here and if I am in full screen mode in a program on one screen, I can not switch to the other workspace with scrolling the mouse wheel.
Again here I found the solution for that. Now I have your script on those obsolete WIN keys on the keyboard. Works like a charm!
br KH
Offline
FYI:
i have 20 workspaces on each user and around 23 users. everything has shortcuts. 10 shortcuts go to 10 workspaces by pressing a keypad number from 0 to 9. then there are 10 more by holding (pre-pressing with sticky keys on) CTRL. so i can flip between 2 workspaces by just alternately pressing the keys.
i think i will extend this by having the key script record the last two workspaces, and create a new key script that switches to the previous workspace and exchange the last two recordings.
FYI, i switch users with ALT+letter where letter is that user's first or last letter. I use the logo key in place of the alt key for a few users. that overloads a few default shortcuts i never use. you might want to use Ctrl+Alt+letter or something else.
yes, up to 23 logged in users X 20 workspaces (especially with fullscreen terminals on 180 of them) can eat a lot of memory. my 16 GB runs out quickly. i need to up the RAM but that is waiting on a new laptop that will be 32 GB or 64 GB.
Offline
Pages: 1
[ Generated in 0.011 seconds, 8 queries executed - Memory usage: 534.87 KiB (Peak: 535.71 KiB) ]