The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Desktop::Detect - Detect desktop environment currently running

VERSION

This document describes version 0.06 of Desktop::Detect (from Perl distribution Desktop-Detect), released on 2016-10-07.

SYNOPSIS

 use Desktop::Detect qw(detect_desktop);
 my $res = detect_desktop();
 say "We are running under XFCE" if $res->{desktop} eq 'xfce';

DESCRIPTION

This module uses several heuristics to find out what desktop environment is currently running, along with extra information.

FUNCTIONS

detect_desktop() => HASHREF

Return a hashref containing information about running desktop environment and extra information.

Detection is done from the cheapest methods, e.g. looking at environment variables. Several environment variables are checked, e.g. DESKTOP_SESSION, XDG_DESKTOP_SESSION, etc.

Result:

  • desktop => STR

    Possible values: xfce, kde-plasma, gnome, gnome-classic, cinnamon, lxde, openbox, or empty string (if can't detect any desktop environment running).

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Desktop-Detect.

SOURCE

Source repository is at https://github.com/perlancar/perl-Desktop-Detect.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Desktop-Detect

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.