Page 1 of 1

howto remotely disable monitor?

Posted: Sat Dec 12, 2009 12:43 am
by Oo.et.oO
i thought i saw a forum post or a section in the wiki for scripting.

i was pretty sure it had a few details of how to use one of the perl scripts to disable/enable a monitor from the commandline.

now i can't find it.

anyone know?
it doesn't look like zmcontrol.pl will do it.

basically i want to run the monitor attached to a computer when it's idle, and not when it's not idle.

i can use xscreensaver to do it:

Code: Select all

#!/usr/bin/perl

my $blanked = 0; 
open (IN, "xscreensaver-command -watch |"); 
while (<IN>) { 
  if (m/^(BLANK|LOCK)/) { 
    if (!$blanked) { 
      zoneminder <monitor> on; 
      $blanked = 1; 
    } 
  } elsif (m/^UNBLANK/) { 
    zoneminder <monitor> off;
    $blanked = 0; 
  } 
} 
i just need to fill in those commands for monitor on/off

thanks!

Posted: Wed Dec 16, 2009 5:15 am
by billn77
http://www.zoneminder.com/wiki/index.php/Zmu

To enable a monitor, this command
sudo zmu -m <monitor_id> -E -U<username> -P<password> ***** Note: monitor ID, not monitor name

To disable a monitor,
sudo zmu -m <monitor_id> -D -U<username> -P<password>

The permissions on the zmu file seem to show executable by all, but if I don't use sudo, the command aborts immediately. That will be another hassle, but I think there's a way around it. <ammendment>.