Persist keyboard backlight color on Linux laptop
Namespaces...
... are not for creating taxonomies. They are there to avoid name collisions. Also the chosen module alias for argparse seems strange. It's name is derived from argument parser so, if any, the obvious abbreviation should be ap. However, it might be better to just import the needed names, instead of creating taxonomies, since there are no name collisions in your code base.
from argparse import ArgumentTypeError, ArgumentParser
from os.path import exists, join
from re import fullmatch

Don't run business logic on module load
Currently, your script parses the command line arguments and writes to files, as soon as the module is laoded. This can be avoided by using an if __name__ == '__main__': guard and / or a main() function.
def main():
    &quot;&quot;&quot;Runs the script.&quot;&quot;&quot;

    arg_parse = ag.ArgumentParser(description=&quot;Set the color and brightness of the system76 keyboard backlight.&quot;)
    arg_parse.add_argument('-r', help=&quot;The red RGB value (00 to FF).&quot;, default=&quot;00&quot;, type=color_fragment)
    arg_parse.add_argument('-g', help=&quot;The green RGB value (00 to FF).&quot;, default=&quot;00&quot;, type=color_fragment)
    arg_parse.add_argument('-b', help=&quot;The blue RGB value (00 to FF).&quot;, default=&quot;00&quot;, type=color_fragment)
    arg_parse.add_argument('-B', help=&quot;The brightness (0 to 255).&quot;, default=&quot;48&quot;, type=brightness_fragment)

    args = arg_parse.parse_args()
    …

if __name__ == '__main__':
    main()

It might be even better to outsource the argument parsing into an own function.
def get_args():
    &quot;&quot;&quot;Parses the command line arguments.&quot;&quot;&quot;

    arg_parse = ag.ArgumentParser(description=&quot;Set the color and brightness of the system76 keyboard backlight.&quot;)
    arg_parse.add_argument('-r', help=&quot;The red RGB value (00 to FF).&quot;, default=&quot;00&quot;, type=color_fragment)
    arg_parse.add_argument('-g', help=&quot;The green RGB value (00 to FF).&quot;, default=&quot;00&quot;, type=color_fragment)
    arg_parse.add_argument('-b', help=&quot;The blue RGB value (00 to FF).&quot;, default=&quot;00&quot;, type=color_fragment)
    arg_parse.add_argument('-B', help=&quot;The brightness (0 to 255).&quot;, default=&quot;48&quot;, type=brightness_fragment)
    return arg_parse.parse_args()


def main():
    &quot;&quot;&quot;Runs the script.&quot;&quot;&quot;

    args = get_args()
    …

Input validation
Your input validation seems complicated. In both cases, for the RGB values and the brightness, an integer within a certain range is expected.
def parse_rgb(text):
    &quot;&quot;&quot;Parses an RGB value from a string.&quot;&quot;&quot;
    
    rgb = int(text)
    
    if not 0 &lt;= rgb &lt;= 0xff:
        raise ValueError('RGB value out of bounds.')

    return rgb


def parse_brightness(text):
    &quot;&quot;&quot;Parses a value for the brightness from a string.&quot;&quot;&quot;
    
    brightness = int(text)
    
    if not 0 &lt;= brightness &lt;= 255:
        raise ValueError('Brightness out of bounds.')

    return brightness

Note that argparse will automatically display an error message if a parser specified at type= raises a ValueError. So you can also get rid of one import and work with a built-in exception instead.
The downside of the integer parsing is, that you'll have to convert the ints back to strings then:
red = hex(args.r)[2:].upper().zfill(2)
green = hex(args.g)[2:].upper().zfill(2)
blue = hex(args.b)[2:].upper().zfill(2)
brightness = str(args.B)
…

You may also subclass an int for this use case:
class RGB(int):
    def __init__(self, value):
        if not 0 &lt;= value &lt;= 0xff:
            raise ValueError('RGB value out of bounds.')

    def __str__(self):
        return hex(self)[2:].upper().zfill(2)

    …

arg_parse.add_argument('-r', help=&quot;The red RGB value (0x00 to 0xff).&quot;, default=RGB(0), type=RGB)
…
red = str(args.r)