line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id$ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# xorg::xlsclients Brik |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package Metabrik::Xorg::Xlsclients; |
7
|
1
|
|
|
1
|
|
640
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use base qw(Metabrik::Shell::Command Metabrik::System::Package); |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
502
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub brik_properties { |
13
|
|
|
|
|
|
|
return { |
14
|
0
|
|
|
0
|
1
|
|
revision => '$Revision$', |
15
|
|
|
|
|
|
|
tags => [ qw(unstable) ], |
16
|
|
|
|
|
|
|
author => 'GomoR ', |
17
|
|
|
|
|
|
|
license => 'http://opensource.org/licenses/BSD-3-Clause', |
18
|
|
|
|
|
|
|
commands => { |
19
|
|
|
|
|
|
|
install => [ ], # Inherited |
20
|
|
|
|
|
|
|
list => [ ], |
21
|
|
|
|
|
|
|
show => [ ], |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
require_binaries => { |
24
|
|
|
|
|
|
|
xlsclients => [ ], |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
need_packages => { |
27
|
|
|
|
|
|
|
ubuntu => [ qw(x11-utils) ], |
28
|
|
|
|
|
|
|
debian => [ qw(x11-utils) ], |
29
|
|
|
|
|
|
|
kali => [ qw(x11-utils) ], |
30
|
|
|
|
|
|
|
}, |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub list { |
35
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $cmd = 'xlsclients -la'; |
38
|
0
|
0
|
|
|
|
|
my $lines = $self->capture($cmd) or return; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my @r = (); |
41
|
0
|
|
|
|
|
|
my $c = -1; |
42
|
0
|
|
|
|
|
|
my $id = '0x0'; |
43
|
0
|
|
|
|
|
|
for (@$lines) { |
44
|
0
|
0
|
|
|
|
|
if (/^Window/) { |
45
|
0
|
|
|
|
|
|
($id) = $_ =~ m{Window\s+(0x\S+):}; |
46
|
0
|
|
|
|
|
|
$c++; |
47
|
0
|
|
|
|
|
|
$r[$c]->{id} = $id; |
48
|
0
|
|
|
|
|
|
$r[$c]->{nid} = int(hex($id)); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
else { |
51
|
0
|
|
|
|
|
|
my ($name, $value) = $_ =~ m{^\s+([^:]+):\s+(.*)$}; |
52
|
0
|
|
|
|
|
|
$name =~ s/(?:\s+|\/)/_/g; |
53
|
0
|
|
|
|
|
|
$r[$c]->{lc($name)} = $value; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
return \@r; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub show { |
61
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
my $cmd = 'xlsclients -la'; |
64
|
0
|
|
|
|
|
|
return $self->execute($cmd); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |