6a12b6f7b1970e92d0697b3633ac35db72895555
[python_utils.git] / orb_utils.py
1 #!/usr/bin/env python3
2
3 """Utilities related to changing the orb's color."""
4
5 import os
6
7 import config
8
9 parser = config.add_commandline_args(
10     f"Orb Utils ({__file__})",
11     "Args having to do with controlling Scott's Orb.",
12 )
13 parser.add_argument(
14     "--orb_utils_file_location",
15     default="/Users/scott/orb_color",
16     metavar="FILENAME",
17     type=str,
18     help="The location of the orb file on whatever machine is hosting it.",
19 )
20 parser.add_argument(
21     "--orb_utils_user_machine",
22     default="[email protected]",
23     metavar="USER@HOSTNAME",
24     type=str,
25     help="The username/machine combo that is hosting the orb.",
26 )
27
28
29 def make_orb(color: str) -> None:
30     user_machine = config.config['orb_utils_user_machine']
31     orbfile_path = config.config['orb_utils_file_location']
32     os.system(f"ssh {user_machine} 'echo \"{color}\" > {orbfile_path}'")