Skip to content
Snippets Groups Projects
Commit deddc8bd authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

allow passing of parameter to start_tb(), e.g. the path of the notes directory

parent 48599497
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl
=head1 NAME =head1 NAME
...@@ -25,6 +26,8 @@ use strict; ...@@ -25,6 +26,8 @@ use strict;
use UUID; use UUID;
use POSIX; use POSIX;
my %options_passed= map { $_ => 1 } qw(--note-path); # used by start_tb() function
sub link sub link
{ {
my $s= shift; my $s= shift;
...@@ -62,18 +65,29 @@ sub get_uuid ...@@ -62,18 +65,29 @@ sub get_uuid
sub start_tb sub start_tb
{ {
my $what= shift; my %par= @_;
my $par= shift;
my @cmd= ('tomboy');
foreach my $what (keys %par)
{
my $par= $par{$what};
if ($what eq 'uuid') if ($what eq 'uuid')
{ {
my @cmd= ('tomboy', '--open-note', 'note://tomboy/'. $par); push (@cmd, '--open-note', 'note://tomboy/'. $par);
print ">>> ", join (' ', @cmd), "\n"; }
elsif (exists ($options_passed{$what}))
{
push (@cmd, $what, $par);
}
}
print ">>> ", join (' ', @cmd), "\n";
my $pid= fork(); my $pid= fork();
if ($pid == 0) { exec @cmd; } if ($pid == 0) { exec @cmd; }
print "started pid=[$pid]\n"; print "started pid=[$pid]\n";
}
$pid;
} }
1; 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment