3 # Shell.FM UNIX Socket Control
4 # Copyright (C) by Jonas Kramer. All rights reserved.
5 # Published under the terms of the GNU General Public License (GPL).
9 # See the shell-fm(1) manual for a list of commands.
19 die "Usage: $0 <command>\n" unless @ARGV;
22 my $rc = new IO
::File
("$ENV{HOME}/.shell-fm/shell-fm.rc");
24 die "Can't open configuration. $!.\n" unless $rc;
30 $path = $1 if /^\s*unix\s*=\s*([^#\s]+)/;
35 die "No socket path found.\n" unless $path;
38 my $socket = new IO
::Socket
::UNIX
($path);
40 die "Failed to create socket. $!.\n" unless $socket;
42 $socket->print("@ARGV\n") or die("Failed to send command. $!.\n");
43 $socket->print("detach\n");
45 my $reply = $socket->getline;
47 print $reply if $reply;