I am running KVM on Ubuntu 24.04 and inside KVM, two virtual machines (Windows and Whoonix). Of course I would like to start them by clicking an icon in the left menu (sidebar).
So I did a desktop entry - one for Windows, another for Whoonix:
[Desktop Entry]
Type=Application
Name=Windows
Exec=/home/matej/.local/bin/startwindows.sh
Icon=/home/matej/.local/share/applications/windows.png
Terminal=false
Comment=Start Windows
startwindows.sh
is using remote-viewer
:
/usr/bin/virsh start windows
/usr/bin/remote-viewer spice://localhost:5901
I added the icon to sidebar, so when I click it, Windows VM (or Whoonix VM for the other icon) is started.
Now, the problem is, that then in the sidebar menu Remote Viewer’s icon appears (below, as running app).
I would like, that the “windows” icon in sidebar would be indicated as running. So I added StartupWMClass
to .desktop file:
StartupWMClass=remote-viewer
I tried to use xprop
to get the StartupWMClass
name, but it did not detect Remote Viewer
’s window, so I just guessed.
While this works kinda fine, the problem is when I close the Windows VM and start Whoonix. Then the small dot indicating which app is active (running) appears at “windows” icon, not “whoonix’”.
So, how to solve this?
P. S. I hope I explained the problem well enough. If not understandable, I can add a picture.