I need a terminal to a Linux vm inside my osx installation. Its a dropdown terminal and in the vm I can use F12 as a global hotkey to toggle show/hide.
The name of the dropdown terminal is yakuake, I know there is a dropdown terminal that works with osx to, but for various reasons, I need both a Linux terminal and easy access to it.
There is several things that makes this difficult.
- VMware fusion doesnt have any good applescript support
- I need to be able to run several vm's on the same time.
- Speed
- Hiding the application.
I am using iKey to get a global hotkey on my mac binded to a little oneliner:
- /Library/Application\ Support/VMware\ Fusion/vmrun -T fusion -gu username -gp password runScriptInGuest "/Users/username/Documents/Virtual Machines.localized/Ubuntu.vmwarevm/Ubuntu.vmx" -interactive "/bin/bash" "/home/username/bin/toggle_yakuake"
The /home/username/bin/toggle_yakuake script is just a:
- /usr/bin/xdotool key Control+Shift+Y # Which is what I bound to yakuake
This works, except its taking around 1-2 seconds, and yakuake will show up below every other windows. Therefor I will use logic to just do this if yakuake isnt running, and then I can just hide/show it in osx to toggle it instantly. However, I am able to show yakuake using a simple "tell application "Yakuake - Ubuntu" to activate. I am not able to hide it without hiding every other application belonging to the same vm.
It seems that every application spawned by vmware is tied together a little to tight. Even if I find the pid of yakuake on my osx installastion, and uses it like:
tell application "System Events"
set yakuakeproc to every process whose unix id is 58518
repeat with proc in yakuakeproc
set the frontmost of proc to true
end repeat
end tell
It will hide every application belonging to that vm.
I have tried to figure out a solution for this for days now. Is there anyone that have any tips or anything? How can I get applescript to hide one specific application which is inside my vm?