Skip to content

Commit

Permalink
Add otp-pass-show
Browse files Browse the repository at this point in the history
  • Loading branch information
asciimoth committed Aug 15, 2023
1 parent 47e6994 commit b1e9fdf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion machines/pcLexell/awesome/awesome/rc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ globalkeys = gears.table.join(
{description = "Lower bright", group = "launcher"}),
-- Print screen
awful.key({}, "Print", function() awful.util.spawn("flameshot gui") end,
{description = "Print screen", group = "launcher"})
{description = "Print screen", group = "launcher"}),
awful.key({ "Control" }, "Print", function() awful.util.spawn("clipqr") end,
{description = "Scan QR from screen", group = "launcher"})
)

clientkeys = gears.table.join(
Expand Down
18 changes: 18 additions & 0 deletions machines/pcLexell/qr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@
fi
done
'';
otppassshow = pkgs.writeShellScriptBin "otppassshow" ''
STORE="/home/$USER/.password-store/"
NAME=$((cd $STORE && find . -type f) | sed '/^.\/secret_service/d' | sed 's/^.\{2\}//' | sed 's/.\{4\}$//' | ${pkgs.fzf}/bin/fzf)
CONTENT=$(pass otp $NAME)
echo "$CONTENT"
echo ""
echo -n "$CONTENT" | uclip
echo -n "$CONTENT" | qrencode -t UTF8 -o -
read
'';
clipqr = pkgs.writeShellScriptBin "clipqr" ''
DATA=$(scanqr)
echo -n "$DATA" | uclip
Expand All @@ -59,6 +69,12 @@
exec = "passshow";
terminal = true;
};
otppassshow-desktop = pkgs.makeDesktopItem {
name = "otppassshow";
desktopName = "otppassshow";
exec = "otppassshow";
terminal = true;
};
in {
environment.systemPackages = with pkgs; [
zbar
Expand All @@ -68,9 +84,11 @@ in {
scanqr
passshow
clipqr
otppassshow
#
clipqr-desktop
passshow-desktop
otppassshow-desktop
];
environment.shellAliases = {
qr = "qrencode -t UTF8 -o -";
Expand Down

0 comments on commit b1e9fdf

Please sign in to comment.