|
48 | 48 | # THUMB PARAMETERS |
49 | 49 | ############################## |
50 | 50 | # 'DEFAULT' 6-key, 'MINI' 5-key, 'CARBONFET' 6-key, 'MINIDOX' 3-key, 'TRACKBALL_ORBYL', 'TRACKBALL_CJ' |
51 | | - 'thumb_style': 'TRACKBALL_CJ', |
| 51 | + 'thumb_style': 'TRACKBALL_ORBYL', |
52 | 52 | 'default_1U_cluster': True, # only used with default, makes top right thumb cluster key 1U |
53 | 53 | # Thumb key size. May need slight oversizing, check w/ caps. Additional spacing will be automatically added for larger keys. |
54 | 54 | 'minidox_Usize': 1.6, |
|
388 | 388 | def save_config(): |
389 | 389 | # Check to see if the user has specified an alternate config |
390 | 390 | opts, args = getopt.getopt(sys.argv[1:], "", ["config=", "update="]) |
| 391 | + got_opts = False |
391 | 392 | for opt, arg in opts: |
392 | 393 | if opt in ('--update'): |
393 | 394 | with open(os.path.join(r"..", "configs", arg + '.json'), mode='r') as fid: |
394 | 395 | data = json.load(fid) |
395 | 396 | shape_config.update(data) |
| 397 | + got_opts = True |
396 | 398 |
|
397 | 399 | for opt, arg in opts: |
398 | 400 | if opt in ('--config'): |
399 | 401 | # If a config file was specified, set the config_name and save_dir |
400 | 402 | shape_config['save_dir'] = arg |
401 | 403 | shape_config['config_name'] = arg |
| 404 | + got_opts = True |
402 | 405 |
|
403 | 406 | # Write the config to ./configs/<config_name>.json |
404 | | - with open(os.path.join(r"..", "configs", shape_config['config_name'] + '.json'), mode='w') as fid: |
405 | | - json.dump(shape_config, fid, indent=4) |
| 407 | + if got_opts: |
| 408 | + with open(os.path.join(r"..", "configs", shape_config['config_name'] + '.json'), mode='w') as fid: |
| 409 | + json.dump(shape_config, fid, indent=4) |
| 410 | + |
| 411 | + else: |
| 412 | + with open(os.path.join(r".", 'run_config.json'), mode='w') as fid: |
| 413 | + json.dump(shape_config, fid, indent=4) |
406 | 414 |
|
407 | 415 |
|
408 | 416 | if __name__ == '__main__': |
|
0 commit comments