How to automatically execute sudo command after logged in?

Sorry and thanks for the warning.

Let me explain in detail.

I recently purchased the Logitech MX Keys Mini Keyboard and Signature M650L Mouse.
They are connected to my computer via Logitech USB Bolt Receiver.

I have a problem that I partially solved in the previous issue;
When I put my computer to sleep, it wakes up immediately.

I’ve added a file named disable-usb-wake.conf to /etc/tmpfiles.d.
The contents of the file are;
w /proc/acpi/wakeup - - - - PTXH
Detailed steps are here.
“PTXH” is USB Bolt Receiver or entire USB…
Anyways.

When PTXH is off, the computer may go to sleep and not wake up by itself. But I can’t wake it up with keyboard and mouse.
echo PTXH | sudo tee /proc/acpi/wakeup When I enter the command in terminal, PTXH is active again. I can put my computer to sleep and it doesn’t wake up by itself. I can wake it up with keyboard and mouse.
But every time I restart the computer I have to enter the command again.

Thank you for your interest. Let me look into your answer to the other thread.