/rofi-bookmarks.nix Secret
Created
February 28, 2018 10:18
Revisions
-
There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ { 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 hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ { 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" ''