Add ykclip-wofi

This commit is contained in:
Artemis Tosini 2021-08-26 18:36:49 +00:00
parent a8a3368ca9
commit df539b0566
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
3 changed files with 29 additions and 1 deletions

View file

@ -0,0 +1,26 @@
{ stdenv,
lib,
writeScriptBin,
runtimeShell,
yubikey-manager,
wofi,
wl-clipboard,
gawk,
gnugrep,
coreutils }:
writeScriptBin "ykclip-wofi" ''
#! ${runtimeShell}
PATH=${lib.makeBinPath [ yubikey-manager wofi wl-clipboard gawk gnugrep coreutils ]}
set -euo pipefail
ykman list --serials | grep $1 > /dev/null
name=$(ykman -d $1 oath accounts list | wofi -k /dev/null -i -d)
line=$(ykman -d $1 oath accounts code "$name" | head -n 1)
if test -n "$line"
then
echo $line | awk '{print $NF}' | wl-copy
fi
''

View file

@ -1,6 +1,7 @@
{ pkgs, lib, config, ... }:
let
rustybar = pkgs.callPackage ../externals/packages/rustybar { };
sway-scripts = pkgs.callPackage ../externals/packages/sway-scripts { };
cfg = config.wayland.windowManager.sway;
mod = cfg.config.modifier;
extraWorkspaces = {
@ -31,6 +32,7 @@ let
extraWorkspaces;
in
{
home.packages = [ sway-scripts ];
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;

@ -1 +1 @@
Subproject commit 5f1013222aec99bc16bf611a24ae6605f97fb64a
Subproject commit 2d2356dc284d8cbee99f7835a7e52b9e325747ed