I have a script that requires superuser/root privileges to run:
$ cat /usr/local/sbin/disable_audio_powersave.sh
#!/usr/bin/env sh
echo '0' > /sys/module/snd_hda_intel/parameters/power_save
and a systemd service that executes it:
$ cat /etc/systemd/system/disable_audio_powersave.service
[Unit]
Description=Disable audio powersaving
Require=default.target
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/disable_audio_powersave.sh
[Install]
WantedBy=multi-user.target
Is there any way to have both these files in my home user directory?
That is, to move the script to e.g. ~/bin
and the service to ~/.config/systemd/user/
?
Or will the script not execute with the required privileges?
The reason I want them in my home directory and not the system-wide directory is to easily be able to track the files with a git dotfile manager (yadm) that only has access to the home directory.