From fe2b47450d0ec7c05a205180fd855f6509122151 Mon Sep 17 00:00:00 2001 From: Quentin Boyer Date: Mon, 21 Jun 2021 09:23:12 +0200 Subject: [PATCH] scripts --- home.nix | 14 ++++++++++---- scripts/hbw | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100755 scripts/hbw diff --git a/home.nix b/home.nix index 3486669..5b802d9 100644 --- a/home.nix +++ b/home.nix @@ -1,11 +1,11 @@ { config, pkgs, lib, ... }: -let - localinfo = import ./localinfo.nix; +let + localinfo = import ./localinfo.nix; in { imports = [ - ./graphical.nix + ./graphical.nix ]; # Home Manager needs a bit of information about you and the # paths it should manage. @@ -29,7 +29,7 @@ in (import (builtins.fetchTarball { url = https://github.com/nix-community/rnix-lsp/archive/master.tar.gz; })) - exa + exa ]; programs = { @@ -71,6 +71,7 @@ in ]; initExtra = '' + export PATH="$PATH:${localinfo.homeDir}/bin" source ~/.p10k.zsh source ~/.powerlevel10k/powerlevel10k.zsh-theme if [ -f "$HOME/.zvars" ]; then @@ -102,6 +103,10 @@ in }; ".zprofile".source = ./zprofile; ".p10k.zsh".source = ./p10k.zsh; + "bin" = { + source = ./scripts; + recursive = true; + }; }; # This value determines the Home Manager release that your @@ -114,3 +119,4 @@ in # changes in each release. home.stateVersion = "21.11"; } + diff --git a/scripts/hbw b/scripts/hbw new file mode 100755 index 0000000..e18fe08 --- /dev/null +++ b/scripts/hbw @@ -0,0 +1,14 @@ +#!/bin/sh + +NAME=$1 +if [ -z $1 ]; then + exit 0 +fi + +bw list items --search $NAME |\ + jq 'reduce .[] as $item ( + ""; + . + "=====" + $item.name + "====\n " + + $item.login.username + "\n " + + $item.login.password + "\n\n")' -r |\ + head -n -2