You are not logged in.
I want the command to be run as the regular user of the session, not as root.
Offline
See.
Try changing the ownership of the script afterwards.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
I don't see what changing ownership of the script would help. Besides, if there are many users, I need to run the action as the user that I resume to. I do not know that when a script in /usr/lib/systemd/system-sleep/ is running.
Offline
See systemd-suspend.service(8).
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
Does Xfce session know that it resumed from suspend?
Offline
I managed to reset the default sink in a script in /usr/lib/systemd/system-sleep/.
I used commands prefixes like
sudo -u USERNAME XDG_RUNTIME_DIR=/run/user/$(id -u USERNAME)
to get/set the desired sink name. I guess I would have to do it for every user that is logged on, to make it work as expected.
Offline
[ Generated in 0.015 seconds, 8 queries executed - Memory usage: 534.77 KiB (Peak: 535.61 KiB) ]