NoPaste

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:
  1. #!/bin/bash
  2. #
  3. # This script moves the mouse curser in order to inhibit screen lock and$
  4. #
  5. #
  6. # endless loop
  7. while [ 1 ];
  8. do
  9.         # wait 5 minutes
  10.         sleep 300;
  11.         # state of VM
  12.         state=$(virsh --connect qemu:///system dominfo Windows_10_Pro_Ga$
  13.         # if state contains "running" -> it is running
  14.         if [[ $state = *"running"* ]];
  15.         then
  16.                 # Test if idle for more than 5 minutes (xprintidle provi$
  17.                 if [ $(xprintidle) -gt 300000 ];
  18.                 then
  19.                         # move mouse
  20.                         xdotool mousemove 50 50;
  21.                 fi;
  22.         fi;
  23. done;

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN