]> git.sev.monster Git - dotfiles.git/blame_incremental - bin/i3-printinfo
add apkv, explicitly source XDG dirs in zshenv
[dotfiles.git] / bin / i3-printinfo
... / ...
CommitLineData
1#!/usr/bin/env perl
2
3use strict;
4use warnings;
5use Text::Template 'fill_in_string';
6use AnyEvent::I3;
7use v5.10;
8
9my $i3 = i3();
10$i3->connect->recv or die "Error connecting to i3";
11
12my ($ev, $str) = @ARGV;
13if (not defined $str) {
14 die "Error: Too few arguments\n" .
15 "Usage: $0 workspace|output|mode|window|barconfig_update|binding format_string\n" .
16 "Example: $0 window 'The window title is {\$name}'"
17}
18
19$i3->subscribe({
20 $ev => sub {
21 # XXX: there has to be a way to make this one line
22 my ($msg) = @_;
23 # XXX: not escaped
24 say Text::Template::fill_in_string($str, HASH=>$msg->{'container'});
25 }
26})->recv;
27
28AE::cv->recv;
29
30# vim: et:ts=4:sts=4:sw=4
This page took 0.02679 seconds and 4 git commands to generate.