l otpmenu: make wayland compatible
This commit is contained in:
parent
2ff1c5d8aa
commit
56b93cb7f7
@ -1,10 +1,11 @@
|
||||
{ pkgs }:
|
||||
pkgs.writeDashBin "otpmenu" ''
|
||||
pkgs.writers.writeDashBin "otpmenu" ''
|
||||
set -efux
|
||||
x=$(${pkgs.pass}/bin/pass git ls-files '*/otp.gpg' \
|
||||
| ${pkgs.gnused}/bin/sed 's:/otp\.gpg$::' \
|
||||
| ${pkgs.dmenu}/bin/dmenu
|
||||
)
|
||||
|
||||
otp=$(${(pkgs.pass.withExtensions (ext: [ ext.pass-otp ]))}/bin/pass otp code "$x/otp")
|
||||
printf %s "$otp" | ${pkgs.xdotool}/bin/xdotool type -f -
|
||||
printf %s "$otp" | ${pkgs.wtype}/bin/wtype -s 1 - || printf %s "$otp" | ${pkgs.xdotool}/bin/xdotool type -f -
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user