]> git.sev.monster Git - dotfiles.git/blame - bin/i3-printinfo
remove syncthing shim
[dotfiles.git] / bin / i3-printinfo
CommitLineData
ff1a2414 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 {
dcac60d9 21 # XXX: there has to be a way to make this one line
ff1a2414 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.042969 seconds and 4 git commands to generate.