Running xinput to change touchpad settings
There's no need for a redundant pass after your if; these can be deleted:

else:
    pass




xinput --list and xinput --list-props aren't long-running commands.  It's simpler to subprocess.run() them, with standard output redirected to a variable:

get_device_id = subprocess.run(["xinput", "list",
                                "SynPS/2 Synaptics TouchPad"],
                               capture_output=True)
if get_device_id.returncode != 0
    sys.exit(get_device_id.returncode)
gdi_str = get_device_id.stdout




I don't believe that first command is actually required - xinput --list-props is quite happy to accept a device name instead of a property:

xinput --list-props 'SynPS/2 Synaptics TouchPad'