VM Inhibit
von fireburner- SNIPPET_DESC:
- Verhindert Energieeinstellungen und Bildschirmsperre
- SNIPPET_CREATION_TIME:
- 18.03.2018 11:50:43
- SNIPPET_PRUNE_TIME:
- Unendlich
- SNIPPET_TEXT:
-
- #!/bin/bash
- #
- # This script moves the mouse curser in order to inhibit screen lock and$
- #
- #
- # endless loop
- while [ 1 ];
- do
- # wait 5 minutes
- sleep 300;
- # state of VM
- state=$(virsh --connect qemu:///system dominfo Windows_10_Pro_Ga$
- # if state contains "running" -> it is running
- if [[ $state = *"running"* ]];
- then
- # Test if idle for more than 5 minutes (xprintidle provi$
- if [ $(xprintidle) -gt 300000 ];
- then
- # move mouse
- xdotool mousemove 50 50;
- fi;
- fi;
- done;
Quellcode
Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN