diff options
| author | Dylan <boss@tehbox.org> | 2026-10-17 21:53:43 +1300 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-10-17 21:53:43 +1300 |
| commit | 280e1bbe5e733128a451260685cc8ecd10a042a3 (patch) | |
| tree | 78bab82353bbfa00f9a781015e246c274a5c983b /home-manager/i3/rofi-passmenu.nix | |
| parent | bcfc69e424802276cc52fb6e00fb4a42e9c37816 (diff) | |
| download | nixos-configuration-280e1bbe5e733128a451260685cc8ecd10a042a3.tar.gz nixos-configuration-280e1bbe5e733128a451260685cc8ecd10a042a3.zip | |
feat: Dendritic pattern
This re-write was done with the help of claude, and still needs a
decent amount of changes before it properly follows the dendritic
pattern
Diffstat (limited to 'home-manager/i3/rofi-passmenu.nix')
| -rw-r--r-- | home-manager/i3/rofi-passmenu.nix | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/home-manager/i3/rofi-passmenu.nix b/home-manager/i3/rofi-passmenu.nix deleted file mode 100644 index 153ffc3..0000000 --- a/home-manager/i3/rofi-passmenu.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ - pkgs -}: - -pkgs.writeShellApplication { - name = "rofi-passmenu"; - - runtimeInputs = with pkgs; [ - pass - rofi - xclip - xdotool - gnugrep - gawk - coreutils - libnotify - ]; - - text = '' - #!/usr/bin/env bash - - store_dir="''${PASSWORD_STORE_DIR:-$HOME/.password-store}" - - get_passwords() { - echo "[+] Add New Password" - if [ -d "$store_dir" ]; then - find "$store_dir" -name "*.gpg" | sort | while IFS= read -r file; do - pass="''${file#"$store_dir"/}" - echo "''${pass%.gpg}" - done - fi - } - - selected=$(get_passwords | rofi -dmenu -i -p "pass") - [[ -z "$selected" ]] && exit 0 - - if [[ "$selected" == "[+] Add New Password" ]]; then - new_path=$(rofi -dmenu -p "Enter path/name for new password:") - [[ -z "$new_path" ]] && exit 0 - - choice=$(echo -e "Generate\nManual" | rofi -dmenu -p "Password method:") - if [[ "$choice" == "Generate" ]]; then - pass generate "$new_path" 20 - notify-send "Pass" "Generated password for $new_path" - elif [[ "$choice" == "Manual" ]]; then - new_pass=$(rofi -dmenu -p "Enter password:" -password) - [[ -n "$new_pass" ]] && echo "$new_pass" | pass insert -m "$new_path" - fi - exit 0 - fi - - action=$(echo -e "1. Type Password\n2. Type Username\n3. Copy Password\n4. Copy Username\n5. Show Password" | rofi -dmenu -i -p "$selected") - - case "$action" in - "1. Type Password") - pass show "$selected" | head -n 1 | tr -d '\n' | xdotool type --clearmodifiers -fi - - ;; - "2. Type Username") - pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | tr -d '\n' | xdotool type --clearmodifiers -fi - - ;; - "3. Copy Password") - pass show -c "$selected" - ;; - "4. Copy Username") - pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | xclip -selection clipboard - ;; - "5. Show Password") - pass show "$selected" | head -n 1 | rofi -dmenu -p "Password for $selected" - ;; - esac - ''; -} |
