19 lines
514 B
Plaintext
19 lines
514 B
Plaintext
|
#!/usr/bin/env perl
|
||
|
|
||
|
# sleep-ttl: query or set the GNOME suspend timeout.
|
||
|
# usage: sleep-ttl [new value in seconds]
|
||
|
|
||
|
use feature qw(say);
|
||
|
use strict;
|
||
|
use warnings;
|
||
|
|
||
|
if (scalar @ARGV > 0 && $ARGV[0] =~ /^(\d+)$/) {
|
||
|
my $ttl = $1;
|
||
|
say "Set TTL to $ttl";
|
||
|
exec("gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout $ttl");
|
||
|
}
|
||
|
|
||
|
my $current = `gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout`;
|
||
|
chomp $current;
|
||
|
say "Current suspend TTL is: $current";
|