当运行
#!/bin/bash
#
# located in /lib/systemd/system-sleep/
# Created 4/2/19
exec 2> /tmp/systemd_suspend_test_err.txt
if [ "${1}" = "pre" ]; then
# Do the thing you want before suspend here
echo "we are suspending $(date +%I:%M:%S_%D)."
elif [ "${1}" = "post" ]; then
# Do the thing you want after resume here
echo "and we are back from being suspended $(date +%I:%M:%S_%D)"
# gxmessage works IF xhost + is run first.
gxmessage -timeout 5 -fg red -display :0 'Back from being suspended.'
cvlc /usr/share/sounds/My_Sounds/Relax_6_Seconds.mp3
fi
我明白了
VLC is not supposed to be run as root. Sorry.
If you need to use real-time priorities and/or privileged TCP ports
you can use /usr/bin/vlc-wrapper (make sure it is Set-UID root and
cannot be run by non-trusted users first).
我不确定 Set-UID root 的正确方法。