From 0a419379b6555cd502bd59b49982acb3b6fd67df Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Thu, 1 Sep 2022 21:46:05 -0700 Subject: [PATCH] Add gopass-ydotool --- common/components/applications.nix | 1 + common/components/shell.nix | 1 + common/packages.nix | 1 + common/resources/init-extra.zsh | 1 + packages/gopass-ydotool.nix | 13 +++++++++++++ packages/resources/gopass-ydotool | 4 ++++ 6 files changed, 21 insertions(+) create mode 100644 packages/gopass-ydotool.nix create mode 100644 packages/resources/gopass-ydotool diff --git a/common/components/applications.nix b/common/components/applications.nix index d1f2a73..e1b2bc8 100644 --- a/common/components/applications.nix +++ b/common/components/applications.nix @@ -77,6 +77,7 @@ in file gimp-with-plugins gopass + gopass-ydotool htop httpie imagemagickBig diff --git a/common/components/shell.nix b/common/components/shell.nix index 299d311..063801c 100644 --- a/common/components/shell.nix +++ b/common/components/shell.nix @@ -83,6 +83,7 @@ e = "exa --all --group-directories-first --long --header --time-style long-iso"; mv = "mv --no-clobber --verbose"; p = "gopass"; + pt = "gopass-ydotool"; rm = "rm --one-file-system --verbose"; watch = "watch --color"; }; diff --git a/common/packages.nix b/common/packages.nix index 20a3433..f68ad8c 100644 --- a/common/packages.nix +++ b/common/packages.nix @@ -36,6 +36,7 @@ overrideUntilVersion { add-words = { }; gh = { }; gopass-await = { inherit (pkgs.gnome) zenity; }; + gopass-ydotool = { }; iosevka-custom = { }; mozjpeg-simple = { }; off = { }; diff --git a/common/resources/init-extra.zsh b/common/resources/init-extra.zsh index 76a8cce..49c90f7 100644 --- a/common/resources/init-extra.zsh +++ b/common/resources/init-extra.zsh @@ -35,6 +35,7 @@ zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))' zstyle ':completion:*:manuals' separate-sections 'true' zstyle ':completion:*:matches' group 'yes' zstyle ':completion:*:warnings' format '%B%F{8}# No matches%f' +compdef '_values passwords $(gopass ls --flat)' gopass-ydotool # Abbreviations source @zsh-abbr@ diff --git a/packages/gopass-ydotool.nix b/packages/gopass-ydotool.nix new file mode 100644 index 0000000..fa5fe09 --- /dev/null +++ b/packages/gopass-ydotool.nix @@ -0,0 +1,13 @@ +{ resholve + + # Dependencies +, bash +, gopass +, ydotool +}: + +resholve.writeScriptBin "gopass-ydotool" { + interpreter = "${bash}/bin/bash"; + inputs = [ gopass ydotool ]; + execer = [ "cannot:${gopass}/bin/gopass" ]; +} (builtins.readFile ./resources/gopass-ydotool) diff --git a/packages/resources/gopass-ydotool b/packages/resources/gopass-ydotool new file mode 100644 index 0000000..db89999 --- /dev/null +++ b/packages/resources/gopass-ydotool @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +ydotool type --file <( gopass show --password "$1" )