summaryrefslogtreecommitdiff
path: root/.uzbl/scripts/goup.pl
blob: f7ae275734ec34079c1fa31f51e9c15e567febfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl

my ($config,$pid,$xid,$fifo,$socket,$url,$title,$cmd) = @ARGV;
if($fifo eq "") { die "No fifo"; };

# Delete last slash
chop($url);

my $index = index(reverse($url), '/');

# if youre already on top of the directory structure
if ($index == -1)
{
	print $url;	
	exit;
}

# Workaround for missing reverse index
$url = (substr(reverse($url), $index, length($url) ));
$url = reverse($url);
print $url."\n";

# This could look prettier with native fifo access
qx(echo "act uri $url" >> $fifo);