Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use Time::HiRes qw(usleep nanosleep);
- my $blanked = 0;
- open (IN, "xscreensaver-command -watch |");
- while (<IN>) {
- if (m/^(BLANK|LOCK)/) {
- if (!$blanked) {
- system "wmctrl -s 1";
- $blanked = 1;
- }
- } elsif (m/^UNBLANK/) {
- usleep(100000);
- system "wmctrl -s 0";
- $blanked = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement