Skip to content

Instantly share code, notes, and snippets.

@grafuls
Last active August 29, 2015 14:12
Show Gist options
  • Save grafuls/efb3611cdeae4e4aa087 to your computer and use it in GitHub Desktop.
Save grafuls/efb3611cdeae4e4aa087 to your computer and use it in GitHub Desktop.
script for running terminator custom commands
#!/usr/bin/python
# /usr/lib/python2.7/site-packages/terminatorlib/plugins/rcc.py
import sys
import os
from terminatorlib.config import Config
def runCustomCommands():
config = Config()
sections = config.plugin_get_config("CustomCommandsMenu")
try:
if not isinstance(sections, dict):
print "Terminator custom commands settings not fonud"
return
for k,v in sections.iteritems():
if v["name"] == sys.argv[1]:
os.system(v["command"])
return
print 'Terminator custom command not found'
except IndexError:
print 'You must input a command name as a parameter'
if __name__ == '__main__':
runCustomCommands()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment