summaryrefslogtreecommitdiff
path: root/orb_utils.py
blob: f1d0ee0d9c781cc418231d39b49e8b9320a2ed7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3

# © Copyright 2021-2022, Scott Gasch

"""Utilities related to changing the orb's color."""

import os

import config

parser = config.add_commandline_args(
    f"Orb Utils ({__file__})",
    "Args having to do with controlling Scott's Orb.",
)
parser.add_argument(
    "--orb_utils_file_location",
    default="/Users/scott/orb_color",
    metavar="FILENAME",
    type=str,
    help="The location of the orb file on whatever machine is hosting it.",
)
parser.add_argument(
    "--orb_utils_user_machine",
    default="[email protected]",
    metavar="USER@HOSTNAME",
    type=str,
    help="The username/machine combo that is hosting the orb.",
)


def make_orb(color: str) -> None:
    user_machine = config.config['orb_utils_user_machine']
    orbfile_path = config.config['orb_utils_file_location']
    os.system(f"ssh {user_machine} 'echo \"{color}\" > {orbfile_path}'")