Noob Question Thread: Ask Any Questions About Linux!
I thought I'll make this thread for all of you out there who have questions but are afraid to ask them. This is your chance!
I'll try my best to answer any questions here, but I hope others in the community will contribute too!
You are viewing a single comment
How can I run a sudo command automatically on startup? I need to run sudo alsactl restore to mute my microphone from playing In my own headphones on every reboot. Surely I can delegate that to the system somehow?
Running something at start-up can be done multiple ways:
Try paveaucontrol, it has an option to lock settings plus it's a neat app to call when you need to customise settings. You could also add user to the group that has access to mic.
You got some good answers already, here is one more option: Create a *.desktop file to run sudo alsactrl, and copy the *.desktop file ~/.config/autostart (Might need to configure sudo to run alsactrl w/o password.)
IMHO the cleanest option is SystemD.