How can I execute a shell command?
I'm not familiar with the term proxy code, but I'm assuming that it's a piece of code on your computer that acts as a man in the middle.

You cannot directly use Arduino to run a shell command, so you'll need to create a program on your computer that listens to serial and then executes a command.

For the "proxy code" Python would be a good choice because of the pySerial library that plays nicely with Arduino. It seems fairly easy to execute a shell command with Python.

As per the Arduino code, something like this would work good:

setup() {
  Serial.begin(9600);
}

loop() {
  if(state == true) {
    Serial.print('A');
  }
}