I am looking to set up a hotkey to launch in particular Terminal or Files such that the hotkey either launches or raises them in the same way as would happen if you clicked the icon in the Gnome Activities overview, or switched using Alt+Tab. This means:
- If no window is opened, a new window is open
- If one or more windows are already open, the shell brings all windows on the current workspace to the foreground, with the most recently used one in the foreground, or, if none exists on the current window, switches to another workspace where a windows exists.
Currently, assigning a hotkey in Settings > Keyboard will always launch a new instance of Terminal or Files. I am aware of (and have tried) scripts involving wmctrl
or xdotool
but this may only cut this partially: it will raise one window only, and the raised window will always be the first one that was opened, not the most recently used, unless, of course, a more sophisticated script is developed. In addition, these may not work well on Wayland.
Preferably, I am looking for a command that would directly interact with Gnome Shell and have the same effect as clicking the icon in the Application overview or dash.
0 Answers