From 8df9472e0cdbab0d12211c2bc77918e8f515c409 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Sat, 8 Aug 2015 20:08:42 +0200 Subject: Improve installation and organization --- .uzbl/scripts/goup.pl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 .uzbl/scripts/goup.pl (limited to '.uzbl/scripts/goup.pl') diff --git a/.uzbl/scripts/goup.pl b/.uzbl/scripts/goup.pl new file mode 100755 index 0000000..f7ae275 --- /dev/null +++ b/.uzbl/scripts/goup.pl @@ -0,0 +1,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); -- cgit v1.2.3