-
-
Save MhdSyrwan/2787693 to your computer and use it in GitHub Desktop.
Sublime Process Launcher
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/env python | |
# The following code is taken from 'Gmate script' of GMATE package | |
# sublime script | |
# Original Author: Alexandre da Silva | |
# This script allows users to use sublime text editor | |
# without interrupting the current terminal session (opens in a new process) | |
import gconf | |
import sys | |
import urllib | |
import os | |
#from optparse import OptionParser | |
# Get the last option as file | |
path = os.path.abspath(sys.argv[-1:][0]) | |
if len(sys.argv) > 1: | |
parameters = ' '.join(sys.argv[1:-1]) | |
if os.path.isdir(path:( | |
url = "file://%s" % urllib.quote(path) | |
config.set_string(os.path.join(base,'virtual_root'), url) | |
else: | |
parameters += ' "%s"' % path | |
os.system('nohup sublime ' + parameters + ' > /dev/null 2>&1 &') | |
else: | |
os.system('nohup sublime > /dev/null 2>&1 &') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment