What you are asking is in fact possible with a simple hack. In my case, I wanted to bind
Super+2 to "either switch to emacs if possible, otherwise open it". To get this working in Cinnamon, first
sudo apt install wmctrl (or whatever other method to install packages on your Linux distro), then, with emacs (or whatever application you want to bind) open, do
wmctrl -x -l to get a list of your current open windows: I got
0x0440013f 0 emacs.Emacs username-debian-x1 emacs@username-debian-x1
Now take that
emacs.Emacs and write the following bash script:,
wmctrl -x -a emacs.Emacs || emacs
and put it somewhere like
~/Documents/switch-emacs.sh, then do a
chmod +x on that file to enable execution, then in the Cinnamon keyboard settings, you can create a custom command and select that shell script, then bind
Super+2 (or whatever you want) to it. This should work immediately (tested on Cinnamon on Debian 10 buster stable).
Source: a comment found on Github
Note the reason that we needed to put it in a shell script instead of just typing the
wmctrl command directly into the custom command is because the
|| operator doesn't seem to work correctly when passed directly to the keyboard shortcut.
Update: It seems that as of cinnamon version 4.2.4-1 (and possibly earlier), this Super+number "open or switch to" feature is builtin to Cinnamon, and works out of the box without needing the hack above. However, as of September 2019, only rolling distros like Arch have cinnamon versions this new; with Mint, Ubuntu, and Debian, you still need to use the hack above (as of Sept 2019), until cinnamon version numbers for those roll forward enough.