TeamViewer keeps PC from going to sleep
Best Answer
-
The problem is solved! There are 2 ways (my system is Sabayon-Linux):
1. Using a script in /lib64/systemd/system-sleep/ folder. I created a kill_n_start.sh script with the contents
#!/bin/sh
case $1/$2 in
pre/*)
# Execute before going to sleep
pkill TeamViewer
systemctl stop teamviewerd
;;
post/*)
# Execute after wake up
systemctl start teamviewerd
;;
esacIt started working immediately without rebooting - TeamViewer closes before PC puts itself to sleep and starts when PC leaves sleep mode.
2. The same can be achieved with a very similar script in /usr/lib/pm-utils/sleep.d/. Described in detail here: https://askubuntu.com/questions/226278/run-script-on-wakeup
5
Answers
-
The problem is solved! There are 2 ways (my system is Sabayon-Linux):
1. Using a script in /lib64/systemd/system-sleep/ folder. I created a kill_n_start.sh script with the contents
#!/bin/sh
case $1/$2 in
pre/*)
# Execute before going to sleep
pkill TeamViewer
systemctl stop teamviewerd
;;
post/*)
# Execute after wake up
systemctl start teamviewerd
;;
esacIt started working immediately without rebooting - TeamViewer closes before PC puts itself to sleep and starts when PC leaves sleep mode.
2. The same can be achieved with a very similar script in /usr/lib/pm-utils/sleep.d/. Described in detail here: https://askubuntu.com/questions/226278/run-script-on-wakeup
5