summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-10 17:31:30 -0500
committerJesse Luehrs <doy@tozt.net>2018-11-10 17:31:30 -0500
commit1b5102a1417f4d867a17ebda61c0727602b184af (patch)
tree3a99e7435f6ea72a6e11f37db7605a1d3fc6ba57
parent3499152841e851e26562164de5ec9d71081583c3 (diff)
downloadconf-1b5102a1417f4d867a17ebda61c0727602b184af.tar.gz
conf-1b5102a1417f4d867a17ebda61c0727602b184af.zip
remove the pass menu and my wrappers
i use browserpass for most things now, and pass itself has gained the ability to use the clipboard and search for things since i wrote this
-rwxr-xr-xbin/hush/pass88
-rw-r--r--xbindkeysrc6
2 files changed, 0 insertions, 94 deletions
diff --git a/bin/hush/pass b/bin/hush/pass
deleted file mode 100755
index fd4a9aa..0000000
--- a/bin/hush/pass
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-
-my $PASS = '/usr/bin/pass';
-
-my $cmd = $ARGV[0];
-
-if ($cmd && $cmd eq 'search') {
- shift @ARGV;
-
- chdir "$ENV{HOME}/.password-store"
- or die "password store not initialized";
-
- require Path::Class;
-
- my $pat_str = pop @ARGV;
- my $pattern = qr/$pat_str/;
-
- my $username = grep { $_ eq '-u' } @ARGV;
- @ARGV = grep { $_ ne '-u' } @ARGV;
-
- my $clipboard = grep { $_ eq '-c' || $_ eq '--clip' } @ARGV;
-
- my @found = Path::Class::Dir->new('.')->traverse(sub {
- my ($file, $c) = @_;
- return if $file eq '.git';
- return (
- $c->(),
- ((-f $file && $file =~ s/\.gpg$// && $file =~ $pattern)
- ? ($file)
- : ()),
- );
- });
-
- if (@found < 1) {
- die "No passwords found matching '$pat_str'\n";
- }
- elsif (@found > 1) {
- die "Ambiguous pattern '$pat_str': could match any of @found\n";
- }
- else {
- if (my $pass = `$PASS show '$found[0]'`) {
- if ($username) {
- if ($found[0] =~ m{^[^/]*/[^/]*/([^/]*)$}) {
- my $user = $1;
- if ($clipboard) {
- clip($user);
- }
- else {
- print "$user\n";
- }
- }
- else {
- die "$found[0] has no username";
- }
- }
-
- if ($clipboard) {
- $pass =~ s/\n.*//s;
- clip($pass);
- }
- else {
- print $pass;
- }
- }
- }
-}
-else {
- exec { $PASS } $PASS, @ARGV
-}
-
-sub clip {
- my ($text) = @_;
- my @pids;
- for my $selection (qw(primary clipboard)) {
- my $pid = fork;
- if (!$pid) {
- open my $fh, '|-', "timeout 1m xclip -loops 1 -quiet -selection $selection 2> /dev/null"
- or die "couldn't run xclip";
- $fh->write("$text\n");
- $fh->close;
- exit;
- }
- push @pids, $pid;
- }
- waitpid($_, 0) for @pids;
-}
diff --git a/xbindkeysrc b/xbindkeysrc
index c47bdeb..b9dbffb 100644
--- a/xbindkeysrc
+++ b/xbindkeysrc
@@ -7,12 +7,6 @@
"xclip -o | xargs xdg-open"
Mod4 + p
-"dmenu -fn 'Misc Fixed:pixelsize=14' -p 'pass search' < /dev/null | xargs -I{} pass search -c {}"
- Mod4 + i
-
-"dmenu -fn 'Misc Fixed:pixelsize=14' -p 'pass search -u' < /dev/null | xargs -I{} pass search -u -c {}"
- Shift+Mod4 + i
-
"dmenu_run -fn 'Misc Fixed:pixelsize=14'"
Mod4 + r