Last active
August 29, 2015 14:12
-
-
Save grafuls/efb3611cdeae4e4aa087 to your computer and use it in GitHub Desktop.
script for running terminator custom commands
This file contains hidden or 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 | |
# /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