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
Pages: 1