From 7a035d29f79ca80ddf0377342a4b1c8a5e746fe5 Mon Sep 17 00:00:00 2001 From: Random936 Date: Sat, 8 Mar 2025 11:22:33 -0800 Subject: [PATCH] Fixed bitwarden functions and removed obsolete ones --- dotfiles/.functions.zsh | 41 ++++++----------------------------------- home/headful-nixos.nix | 4 ++-- home/modules/zsh.nix | 9 --------- 3 files changed, 8 insertions(+), 46 deletions(-) diff --git a/dotfiles/.functions.zsh b/dotfiles/.functions.zsh index e914c82..4be01d5 100644 --- a/dotfiles/.functions.zsh +++ b/dotfiles/.functions.zsh @@ -1,40 +1,11 @@ -bw-load() { - export BW_SESSION=$(cat $HOME/.bw_session) -} - -bw-init() { - if [ ! bw login --check &>/dev/null ]; then - bw login +awkuniq() { + if [[ "$1" == "-c" ]]; then + awk '{ !x[$0]++ } END { for (i in x) print x[i] "\t" i }' + else + awk '!x[$0]++' fi - - bw sync &>/dev/null || return 1 - bw-load - - if [[ "$(bw status | jq -rc .status)" == "unlocked" ]]; then - return 0 - fi - - bw unlock --raw > $HOME/.bw_session - bw-load -} - -bw-copy() { - clipboard_cmd="" - - if [[ "$(uname)" == "Linux" ]]; then - clipboard_cmd="xsel --clipboard -i" - elif [[ "$(uname)" == "Darwin" ]]; then - clipboard_cmd="pbcopy" - fi - - bw-load && NODE_OPTIONS="--no-deprecation" bw get password "$1" | eval $clipboard_cmd -} - -bw-clear() { - echo -n "" | xsel --clipboard } bw-ssh() { - pass=$(bw-load && NODE_OPTIONS="--no-deprecation" bw get password "$1") - sshpass -p "$pass" ssh ${@:2} + sshpass -p "$(rbw get "$1")" ssh ${@:2} } diff --git a/home/headful-nixos.nix b/home/headful-nixos.nix index fcfa888..1ef396e 100644 --- a/home/headful-nixos.nix +++ b/home/headful-nixos.nix @@ -5,8 +5,8 @@ homeDirectory = "/home/${user}"; }; - imports = [ - ./shared.nix + imports = [ + ./shared.nix ./modules/utils.nix ./modules/linux-only-utils.nix ./modules/networking.nix diff --git a/home/modules/zsh.nix b/home/modules/zsh.nix index 63014bc..8a256b4 100644 --- a/home/modules/zsh.nix +++ b/home/modules/zsh.nix @@ -60,15 +60,6 @@ if [[ -n "$SSH_CONNECTION" && "$TERM" == "ghostty" ]]; then export TERM="xterm-256color" fi - - awkuniq() { - if [[ "$1" == "-c" ]]; then - awk '{ !x[$0]++ } END { for (i in x) print x[i] "\t" i }' - else - awk '!x[$0]++' - fi - } - ''; plugins = [