Skip to content

Instantly share code, notes, and snippets.

@nejdetckenobi
Last active December 30, 2024 13:26
Show Gist options
  • Select an option

  • Save nejdetckenobi/c8624cb16ef892c6c487f241a35b4a66 to your computer and use it in GitHub Desktop.

Select an option

Save nejdetckenobi/c8624cb16ef892c6c487f241a35b4a66 to your computer and use it in GitHub Desktop.
Bu `rofi` kullanan bir script. Çalıştırdığında, kategorize ettiğin şifrelerini seçebileceğin ve seçtiğin şifreyi panoya kopyalayan bir menü oluşacak. Önce `rofi` kurmalısın
#!/usr/bin/env bash
cd ~/.password-store
PASS="$(find -path ./.git -prune -o -type f -printf "%P\n" | grep -v '/\.' | grep -v '^\.' | rofi -dmenu -p 'Choice' | cut -d . -f 1)"
if [[ "$1" == "otp" ]]; then
pass otp show --clip "$PASS"
else
pass show --clip=1 "$PASS"
fi
#!/usr/bin/env bash
cd ~/.password-store
CATEGORY="$(ls -1 ~/.password-store | rofi -dmenu -p 'Choice')"
PASS="$(ls -1 ~/.password-store/$CATEGORY | rofi -dmenu -p 'Choice' | cut -d. -f 1)"
TYPE="$(echo -e 'password\notp' | rofi -dmenu -p 'Choice')"
if [[ "$TYPE" == "otp" ]]; then
pass otp show --clip "$CATEGORY/$PASS"
else
pass show --clip=1 "$CATEGORY/$PASS"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment