Add ykclip-wofi
This commit is contained in:
parent
a8a3368ca9
commit
df539b0566
26
externals/packages/sway-scripts/default.nix
vendored
Normal file
26
externals/packages/sway-scripts/default.nix
vendored
Normal 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
|
||||||
|
''
|
|
@ -1,6 +1,7 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
let
|
let
|
||||||
rustybar = pkgs.callPackage ../externals/packages/rustybar { };
|
rustybar = pkgs.callPackage ../externals/packages/rustybar { };
|
||||||
|
sway-scripts = pkgs.callPackage ../externals/packages/sway-scripts { };
|
||||||
cfg = config.wayland.windowManager.sway;
|
cfg = config.wayland.windowManager.sway;
|
||||||
mod = cfg.config.modifier;
|
mod = cfg.config.modifier;
|
||||||
extraWorkspaces = {
|
extraWorkspaces = {
|
||||||
|
@ -31,6 +32,7 @@ let
|
||||||
extraWorkspaces;
|
extraWorkspaces;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
home.packages = [ sway-scripts ];
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wrapperFeatures.gtk = true;
|
wrapperFeatures.gtk = true;
|
||||||
|
|
2
private
2
private
|
@ -1 +1 @@
|
||||||
Subproject commit 5f1013222aec99bc16bf611a24ae6605f97fb64a
|
Subproject commit 2d2356dc284d8cbee99f7835a7e52b9e325747ed
|
Loading…
Reference in a new issue