Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 31 lines (24 sloc) 0.728 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#!/usr/bin/env perl
use strict;
use warnings;
use autodie;
use XML::Simple;

my $file_manager = "dolphin";
my $file = "$ENV{HOME}/.local/share/user-places.xbel";
my $places = XMLin("$file", forcearray => [ qw(href title) ]);

my %menu_items;
foreach my $key (@{$places->{bookmark}}) {
  $menu_items{$key->{'title'}[0]} = $key->{'href'};
}

print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
    . "<openbox_pipe_menu>\n";

foreach my $key (sort keys %menu_items) {
  print "<item label=\"".$key."\">\n"
      . " <action name=\"Execute\">\n"
      . " <execute>\n"
      . " ".$file_manager." ".$menu_items{$key}."\n"
      . " </execute>\n"
      . " </action>\n"
      . "</item>\n";
}

print "</openbox_pipe_menu>\n";

Something went wrong with that request. Please try again.