Screensaver-Any

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


  screensaver_is_enabled
    Usage:

     screensaver_is_enabled(%args) -> [$status_code, $reason, $payload, \%result_meta]

    Check whether screensaver is enabled.

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   screensaver => *str*

        Explicitly set screensaver program to use.

        The default, when left undef, is to detect what screensaver is
        running,

    Returns an enveloped result (an array).

    First element ($status_code) is an integer containing HTTP-like status
    code (200 means OK, 4xx caller error, 5xx function error). Second
    element ($reason) is a string containing error message, or something
    like "OK" if status is 200. Third element ($payload) is the actual
    result, but usually not present when enveloped result is an error
    response ($status_code is not 2xx). Fourth element (%result_meta) is
    called result metadata and is optional, a hash that contains extra
    information, much like how HTTP response headers provide additional
    metadata.

    Return value: (any)

  set_screensaver_timeout
    Usage:

     set_screensaver_timeout(%args) -> [$status_code, $reason, $payload, \%result_meta]

    Set screensaver idle timeout.

    Examples:

    *   Set timeout to 5 minutes:

         set_screensaver_timeout(timeout => 300);

    *   xscreensaver

        To set timeout for xscreensaver, the program finds this line in
        "~/.xscreensaver":

          timeout:    0:05:00

        modifies the line, save the file, and HUP the xscreensaver process.

    *   gnome

        To set timeout for gnome screensaver, the program executes this
        command:

          gsettings set org.gnome.desktop.session idle-delay 300

    *   cinnamon

        Not yet supported.

    *   KDE

        To set timeout for the KDE screen locker, the program looks for this
        line in "~/.kde/share/config/kscreensaverrc":

          Timeout=300

        modifies the line, save the file.

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   screensaver => *str*

        Explicitly set screensaver program to use.

        The default, when left undef, is to detect what screensaver is
        running,

    *   timeout => *duration*

        Value.

    Returns an enveloped result (an array).

    First element ($status_code) is an integer containing HTTP-like status
    code (200 means OK, 4xx caller error, 5xx function error). Second
    element ($reason) is a string containing error message, or something
    like "OK" if status is 200. Third element ($payload) is the actual
    result, but usually not present when enveloped result is an error
    response ($status_code is not 2xx). Fourth element (%result_meta) is
    called result metadata and is optional, a hash that contains extra
    information, much like how HTTP response headers provide additional
    metadata.

    Return value: Timeout value, in seconds (float)

HOMEPAGE
    Please visit the project's homepage at
    <https://metacpan.org/release/Screensaver-Any>.

SOURCE
    Source repository is at
    <https://github.com/perlancar/perl-Screensaver-Any>.

AUTHOR
    perlancar <perlancar@cpan.org>

CONTRIBUTING
    To contribute, you can send patches by email/via RT, or send pull
    requests on GitHub.

    Most of the time, you don't need to build the distribution yourself. You
    can simply modify the code, then test via:



( run in 1.112 second using v1.01-cache-2.11-cpan-b16cb0d3907 )