Add a command to picade hat

Complete noob here.

The story goes…

I am building an arcade table, have got my raspberry pi set up with a picade hat. All that is set up fine and everything works. the problem is the monitor I have attached won’t go to sleep when the pi shuts down. Now, I have found a command that will turn off the monitor, I just can’t for the life of me figure out where it needs to go.

I know I was asking for trouble by doing this but I inserted the code into a couple of places in the picadehatd script in the /etc/rc6.d directory but 1 place I put it had the command run at both startup and shut down and another place it did nothing. Can anyone help?

I’m not sure I follow - power reaching your monitor has nothing to do with the software side, or Picade HAT, unless that is not the whole story.

… how is your display connected and what command are you talking about? Without those details it is impossible to provide any constructive answer, I’m afraid.

The pi is connected to the monitor via hdmi. I have a command that uses cec to shut off a tv/monitor. It’s a samsung monitor with built in tv function so for whatever reason it doesn’t shut itself off.

The command I have is:
echo standby 0 | cec-client -s -d 1

ideally you will want to create a systemd unit that triggers your cec-client command on poweroff.

… it is not overly complicated, but you may be able to get away with a cron entry to achieve the same result.

As I said at the start of the post… total noob here.

How might I go about doing that