VM Inhibit Suspend
von fireburner- SNIPPET_DESC:
- Verhindert Energieeinstellungen und Bildschirmsperre
- SNIPPET_CREATION_TIME:
- 18.03.2018 12:34:30
- SNIPPET_PRUNE_TIME:
- Unendlich
- SNIPPET_TEXT:
-
- #!/bin/bash
- #
- # This script moves the mouse curser in order to inhibit screen lock and other power management features
- #
- #
- # endless loop
- while [ 1 ];
- do
- # wait 5 minutes
- # state of VM
- state=$(virsh --connect qemu:///system dominfo Windows_10_Pro_Gaming | grep State)
- # if state contains "running" -> it is running
- if [[ "$state" = *"running"* ]];
- then
- # Test if idle for more than 5 minutes (xprintidle provides ms)
- 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