Dropbox Folder Locationを変えても、必ず"Dropbox"というディレクトリは作られてしまう。
これはなかなか邪魔臭い。
で、変更するスクリプトをPythonで作った。
使い方。
$ change_dropbox_folder_location.py '/Users/eth0jp/Documents/files'
ソース。
#!/usr/bin/env python import os, sys, sqlite3 from base64 import b64encode, b64decode from pickle import dumps, loads def main(): homedir = os.path.expanduser('~') dbfile = '%s/.dropbox/dropbox.db' % homedir try: newpath = b64encode(dumps(sys.argv[1].decode('utf-8'))) connection = sqlite3.connect(dbfile, isolation_level=None) cursor = connection.cursor() cursor.execute('REPLACE INTO config (key,value) VALUES ("dropbox_path",?)', (newpath,)) cursor.close() connection.close() print 'done' except Exception, e: print 'exception: %s' % e def usage(): print 'usage: %s new_dropbox_folder_location' % sys.argv[0] if __name__ == "__main__": if 2==len(sys.argv): main() else: usage()