Created
March 3, 2014 00:29
-
-
Save raidzero/9316314 to your computer and use it in GitHub Desktop.
Openbox pipe menu: launch Virtualbox VM's
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
"""Pipe Menu to launch VirtualBox Machines""" | |
# build the list of VM's | |
VM_LIST = os.listdir("/home/raidzero/.VirtualBox/Machines") | |
print """<openbox_pipe_menu> | |
<separator label="Virtual Machines"> | |
</separator>""" | |
for VM in VM_LIST: | |
print "<item label=\"%s\">" % VM | |
print "\t<action name=\"Execute\">" | |
print "\t\t<execute>" | |
print "\t\t\tVBoxManage startvm \"%s\"" % VM | |
print "\t\t</execute>" | |
print "\t</action>" | |
print "</item>" | |
print "<separator>" | |
print "</separator>" | |
print "\t<item label=\"Launch VirtualBox\">" | |
print "\t\t<action name=\"Execute\">" | |
print "\t\t\t<execute>" | |
print "\t\t\t\tVirtualBox" | |
print "\t\t\t</execute>" | |
print "\t\t</action>" | |
print "\t</item>" | |
print "</openbox_pipe_menu>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment