Skip to content

Instantly share code, notes, and snippets.

@zzggbb
Created February 13, 2015 00:41
Show Gist options
  • Select an option

  • Save zzggbb/9226bac00fe023c24ac2 to your computer and use it in GitHub Desktop.

Select an option

Save zzggbb/9226bac00fe023c24ac2 to your computer and use it in GitHub Desktop.
#!/bin/env python
from sys import argv, exit, stdin
argv[1:] or exit('no mode specified')
mode = argv[1]
apps = {
'minecraft':'/bin/minecraft',
'mumble': '/bin/mumble',
'steam': '/bin/steam',
'tf2': '/bin/steam -applaunch 440 -w 1920 -h 1080 -novid -sw -noborder -noforceparms -console -nocrashdialog'
}
print({
'write': lambda: '\n'.join(apps.keys()),
'read': lambda: apps.get(stdin.readlines()[0].strip()) or exit('app not found')
}.get(mode, lambda: exit('invalid mode'))())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment