/[scripts]/trunk/awesome-client.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/awesome-client.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 68 - (show annotations)
Mon Feb 18 16:22:13 2008 UTC (14 years, 4 months ago) by dpavlin
File MIME type: text/plain
File size: 507 byte(s)
simple awesome-client port to perl

1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4
5 use IO::Socket;
6
7 my $d = $ENV{DISPLAY};
8 $d =~ s/^://;
9 $d =~ s/^(\d+)\..*/$1/;
10 my $path = "$ENV{HOME}/.awesome_ctl.$d";
11
12 die "$path doesn't exist!\n" unless -e $path;
13
14 warn "# using sock $path\n";
15
16 my $msg = '0 widget_tell dwm-status foobar';
17
18 my $sock = IO::Socket::UNIX->new(
19 Type => SOCK_DGRAM,
20 Peer => $path,
21 ) or die "Socket: $!";
22
23 my $peer = sockaddr_un($path);
24
25 $msg .= "\n" . 0x00;
26
27 send($sock, $msg,0,$peer) or die "Couldn't send(): $!";
28
29 close($sock);

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26