2 # vim:ts=4:sw=4:expandtab
8 use X11::XCB qw(GET_PROPERTY_TYPE_ANY);
9 use X11::XCB::Connection;
11 use Exporter qw(import);
21 i3test::Util - General utility functions
31 Reads the entire file specified in the arguments and returns the content.
38 open my $fh, "<", $file or die "could not open $file: $!";
45 =head2 get_socket_path([X11::XCB::Connection])
47 Gets the socket path from the C<I3_SOCKET_PATH> atom stored on the X11 root
53 $x //= X11::XCB::Connection->new();
54 my $atom = $x->atom(name => 'I3_SOCKET_PATH');
55 my $cookie = $x->get_property(0, $x->get_root_window(), $atom->id, GET_PROPERTY_TYPE_ANY, 0, 256);
56 my $reply = $x->get_property_reply($cookie->{sequence});
57 my $socketpath = $reply->{value};
58 if ($socketpath eq "/tmp/nested-$ENV{DISPLAY}") {
59 $socketpath .= '-activation';
66 Michael Stapelberg <michael@i3wm.org>