I would suggest you write your own quick script using two things - while I assume you will know about local user's PATH and such, I'll be detailed:
- Replace the current Gnome shell; see caveats
- Switch workspace to the desired number
- Make script executable via GUI.
New file best goes to e.g. /home/user/.local/bin
and you make sure your local path is loaded in ~/.profile
(note that ~/.bashrc
will not suffice as not necessarily loaded for GUI environments).
Script file - named e.g. gnomerestart.sh
:
#!/bin/bash
killall -3 gnome-shell & wait
xdotool set_desktop 1
Note that xdotool
will start counting desktops at 0. Check xdotool get_num_desktops
and xdotool get_desktop
for total number of workspaces and the ID of the current one, respectively.
Make executable:
chmod +x ~/.local/bin/gnomerestart.sh
Now check if your local bin is enabled in ~/.profile
- add line if not already present.
PATH="$HOME/.local/bin:$PATH"
To load the new profile you must make a new login once. If you want to override the "alt-F2+r" you might also just call it r
and make sure to put the local path first in ~/.profile
- which you should always do if you want to override system-wide commands.
EDIT:
If you want to dynamically define the current workspace to be loaded, the script must be adapted using:
old_number=$(xdotool get_desktop)
killall -3 gnome-shell & wait
xdotool set_desktop ${old_number}