-
-
Save anonymous/2a6b422ff1994d535d5f4a2a5b22cb1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, writeScriptBin, rofi }: | |
writeScriptBin "rofi-bookmarks" '' | |
BOOKMARKS_FILE="$XDG_DATA_HOME/bookmarks" | |
read_bookmarks() { | |
sort -k1,1 -t '|' < "''${BOOKMARKS_FILE}" | column -t -s '|' | |
} | |
show_bookmarks() { | |
read_bookmarks | rofi -dmenu -i -p "Bookmarks: " | |
} | |
parse_url() { | |
awk '{print $NF}' | |
} | |
open_bookmark() { | |
''${BROWSER:-xdg-open} "$(show_bookmarks | parse_url)" | |
} | |
open_bookmark | |
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, writeScriptBin, rofi, pass, xclip }: | |
writeScriptBin "rofi-pass" '' | |
#!/bin/sh | |
export PATH=${lib.makeBinPath [ rofi pass xclip ]}:$PATH | |
shopt -s nullglob globstar | |
password_files=(~/.data/pass/**/*.gpg) | |
password_files=("''${password_files[@]##*/.data/pass/}") | |
password_files=("''${password_files[@]%.gpg}") | |
password=$(printf '%s\n' "''${password_files[@]}" | rofi -dmenu -p "Search password: " "$@") | |
env > /tmp/1 | |
PASSWORD_STORE_DIR=$XDG_DATA_HOME/pass PASSWORD_STORE_X_SELECTION=clipboard pass -c "$password" | |
'' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment