#!/bin/sh # # Copyright (C) 2009-2013 "isomorph" # All Rights Reserved. # # BSD 3-Clause License # # ---- # # OpenBox "VirtualBox" pipe-menu # Outputs a menu roughly akin to: # # VirtualBox # ---------- # # # # ... # # Usage: # # 1. Copy this file somewhere on your path and make it executable # 2. Add the following line somewhere to your /.config/openbox/menu.xml # # # # 3. Reconfigure openbox # make sure virtualbox itself exists which "virtualbox" > /dev/null if [ "$?" -ne "0" ]; then cat < x-www-browser https://www.virtualbox.org/wiki/Linux_Downloads EOF exit 1 fi # output the initial menu cat < virtualbox -style gtk EOF # Check for the vboxmanage binary which "vboxmanage" > /dev/null if [ "$?" -ne "0" ]; then echo "" exit 0 fi # seperate the main command from the virtuals echo " " # output the list of virtual machines vboxmanage list vms | cut -f 2 -d "\"" | sort -f | while read vm do cat < vboxmanage startvm "$vm" EOF done; # and finally... echo ""