Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Video-display-modes/Perl/video-display-modes.pl
Normal file
19
Task/Video-display-modes/Perl/video-display-modes.pl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
$| = 1;
|
||||
|
||||
my @info = `xrandr -q`;
|
||||
$info[0] =~ /current (\d+) x (\d+)/;
|
||||
my $current = "$1x$2";
|
||||
|
||||
my @resolutions;
|
||||
for (@info) {
|
||||
push @resolutions, $1 if /^\s+(\d+x\d+)/
|
||||
}
|
||||
|
||||
system("xrandr -s $resolutions[-1]");
|
||||
print "Current resolution $resolutions[-1].\n";
|
||||
for (reverse 1 .. 9) {
|
||||
print "\rChanging back in $_ seconds...";
|
||||
sleep 1;
|
||||
}
|
||||
system("xrandr -s $current");
|
||||
print "\rResolution returned to $current.\n";
|
||||
Loading…
Add table
Add a link
Reference in a new issue