diff --git a/Database.pm b/Database.pm index 8cea90e..d8651fa 100644 --- a/Database.pm +++ b/Database.pm @@ -49,18 +49,27 @@ sub mdo { my $sth = $dbh->prepare($q); my $rv = $sth->execute(); - - - printf "%-11s %-11s %-11s %-11s\n", "ID", "NAME", "RESOURCE", "USERNAME"; + use Term::ANSIColor; + printf "%-11s %-11s %-11s %-11s\n", + colored( "ID", 'white' ), + colored( "NAME", 'magenta' ), + colored( "RESOURCE", 'blue' ), + colored( "USERNAME", 'green' ); + print "=========================\n"; while ( my ( $id, $name, $resource, $username ) = $sth->fetchrow_array() ) { printf "%-11s %-11s %-11s %-11s\n", - $id, $name, $resource, $username; + colored( $id, 'white' ), + colored( $name, 'magenta' ), + colored( $resource, 'blue' ), + colored( $username, 'green' ); } + # Remove unencrypted file my @rm_cmd = ( "rm", "-f", "$db_file" ); - system(@rm_cmd) == 0 or die "Cannot remove unencrypted database! $!\n"; + system(@rm_cmd) == 0 + or die "Cannot remove unencrypted database! $!\n"; exit 0; } diff --git a/pm.pl b/pm.pl index 1a81c9a..f4dd3ac 100755 --- a/pm.pl +++ b/pm.pl @@ -105,7 +105,13 @@ elsif ( defined($opt_s) and defined($opt_n) and defined($opt_o) ) { my @open_cmd = ( 'xdg-open', $get_h->{resource} ); system(@open_cmd) == 0 or die "Cannot open URI: $!\n"; - print "Password copied to clipboard. Trying to open uri.\n"; + print color 'bold green'; + print "Password copied to clipboard.\n"; + print color 'reset'; + print "Trying to open "; + print color 'bold blue'; + print $get_h->{resource} . "\n"; + print color 'reset'; } # Remove string from db elsif ( defined($opt_r) and defined($opt_i) ) {