Skip to content

Commit

Permalink
Icon updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Mar 22, 2014
1 parent df01967 commit cf907ae
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,3 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject
src/icon.png
src/parallels.png
src/virtualbox.png
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,4 @@ VMControl for Alfred
Copyright (c) 2014 Fabio Niephaus - Released under the [MIT license](https://raw.github.com/fniephaus/alfred-vmcontrol/master/LICENSE).

#### VirtualBox icon
Oracle Corporation has released this image under GPLv2 license. A copy of license agreement can be found [here](https://www.virtualbox.org/browser/vbox/trunk/COPYING).


#### Parallels icon
The Parallels Desktop logo is a trademark of [Parallels Holdings, Ltd](http://www.parallels.com/) and is used in this project under a claim of fair use.
Oracle Corporation has released this image under GPLv2 license. A copy of license agreement can be found [here](https://www.virtualbox.org/browser/vbox/trunk/COPYING).
Binary file modified VM-Control-for-Alfred.alfredworkflow
Binary file not shown.
Binary file added src/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 13 additions & 12 deletions src/vm_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,59 +36,59 @@ def complete(wf):
if vm_details.state == "stopped":
wf.add_item(
'Start', arg='start ' + vm_name,
uid=vm_name, valid=True)
uid=vm_name, valid=True, icon=vm_details.type, icontype='fileicon')

elif vm_details.state == "paused":
for action in ['Resume', 'Stop', 'Pause', 'Reset', 'Suspend']:
wf.add_item(
action, arg=action.lower() + ' ' + vm_name,
uid=vm_name, valid=True)
uid=vm_name, valid=True, icon=vm_details.type, icontype='fileicon')

elif vm_details.state == "suspended":
for action in ['Resume']:
wf.add_item(
action, arg=action.lower() + ' ' + vm_name,
uid=vm_name, valid=True)
uid=vm_name, valid=True, icon=vm_details.type, icontype='fileicon')

elif vm_details.state == "running":
for action in ['Stop', 'Pause', 'Reset', 'Suspend', 'Restart']:
wf.add_item(
action, arg=action.lower() + ' ' + vm_name,
uid=vm_name, valid=True)
uid=vm_name, valid=True, icon=vm_details.type, icontype='fileicon')

filename = "Screenshot\ " + \
strftime("%Y-%m-%d\ %H.%M.%S\ %p", gmtime()) + ".png"
wf.add_item(
"Capture screenshot", "Saves a screenshot to Desktop", arg='capture ' + vm_name + ' --file ~/Desktop/' + filename,
uid=vm_name, valid=True)
uid=vm_name, valid=True, icon=vm_details.type, icontype='fileicon')

# Virtual Box
elif vm_details.state in ["PoweredOff", "Saved"]:
wf.add_item(
'Start', arg=vm_name + ' start',
uid=vm_name, valid=True, icon=vm_details.type)
uid=vm_name, valid=True, icon=vm_details.type, icontype='fileicon')

elif vm_details.state == "Paused":
for action in ['Resume', 'PowerOff', 'SaveState']:
wf.add_item(
action, arg=vm_name + ' ' + action.lower(),
uid=vm_name, valid=True, icon=vm_details.type)
uid=vm_name, valid=True, icon=vm_details.type, icontype='fileicon')

elif vm_details.state == "Running":
for action in ['PowerOff', 'Pause', 'Reset', 'SaveState', 'ACPIPowerButton', 'ACPISleepButton']:
wf.add_item(
action, arg=vm_name + ' ' + action.lower(),
uid=vm_name, valid=True, icon=vm_details.type)
uid=vm_name, valid=True, icon=vm_details.type, icontype='fileicon')

filename = "Screenshot\ " + \
strftime("%Y-%m-%d\ %H.%M.%S\ %p", gmtime()) + ".png"
wf.add_item(
"Capture screenshot", "Saves a screenshot to Desktop", arg=vm_name + ' screenshotpng ~/Desktop/' + filename,
uid=vm_name, valid=True, icon=vm_details.type)
uid=vm_name, valid=True, icon=vm_details.type, icontype='fileicon')
else:
for vm in vm_list:
wf.add_item(vm.name, vm.state, uid=vm.id,
autocomplete=vm.name, valid=False, icon=vm.type)
autocomplete=vm.name, valid=False, icon=vm.type, icontype='fileicon')

wf.send_feedback()

Expand All @@ -102,12 +102,13 @@ def get_vm_list():
status = vm_details[1]
vm_id = vm_details[0]
name = ' '.join(vm_details[3:])
output.append(VMDetails(name, vm_id, status, 'parallels.png'))
output.append(
VMDetails(name, vm_id, status, '/Applications/Parallels Desktop.app'))

if vbox_available:
for m in mgr.getArray(vbox, 'machines'):
output.append(VMDetails(
m.name, m.id, get_vm_state(m.state), 'virtualbox.png'))
m.name, m.id, get_vm_state(m.state), '/Applications/VirtualBox.app'))

return output

Expand Down

0 comments on commit cf907ae

Please sign in to comment.