diff options
author | Rasmus Steinke <rasi@xssn.at> | 2015-06-06 13:23:53 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2015-06-06 13:23:53 +0200 |
commit | 2c00582d29f73f6f481aef7736c3d7726a419d4f (patch) | |
tree | b96f5c47de49b0b6761e973612e77e52096a80d2 | |
parent | 19689bd4b3c06f079f30c8c37ce339acdac507a4 (diff) | |
download | rofi-pass-2c00582d29f73f6f481aef7736c3d7726a419d4f.tar.gz |
add parsers
-rw-r--r-- | config.example | 19 | ||||
-rwxr-xr-x | parsers/chromium | 11 | ||||
-rwxr-xr-x | parsers/firefox | 8 | ||||
-rwxr-xr-x | rofi-pass | 7 |
4 files changed, 25 insertions, 20 deletions
diff --git a/config.example b/config.example index 373abb8..9afa699 100644 --- a/config.example +++ b/config.example @@ -15,22 +15,3 @@ BROWSER='chromium' ## Misc settings help_color="#0C73C2" - -# get active URL from browser -# Chose the one for your browser or create your own. - -# chromium - needs url in title extension -# https://chrome.google.com/webstore/detail/url-in-title/ignpacbgnbnkaiooknalneoeladjnfgb -# set string to "{protocol}://{hostname}{port}/{path}/{args}" -domain () { - wmctrl -l | grep Chromium | awk '{print $(NF-2)}' -} - -# firefox - needs Add URL to Window Title extension -# https://addons.mozilla.org/en-US/firefox/addon/add-url-to-window-title/ -# set delimiter to "::" - -# domain () { -# wmctrl -l | grep Firefox | grep "::" | awk '{print $(NF-3)}' -# } - diff --git a/parsers/chromium b/parsers/chromium new file mode 100755 index 0000000..a8c51ca --- /dev/null +++ b/parsers/chromium @@ -0,0 +1,11 @@ +# get active URL from browser +# Chose the one for your browser or create your own. + +# chromium - needs url in title extension +# https://chrome.google.com/webstore/detail/url-in-title/ignpacbgnbnkaiooknalneoeladjnfgb +# set string to "{protocol}://{hostname}{port}/{path}/{args}" + +domain () { + wmctrl -l | grep Chromium | awk '{print $(NF-2)}' +} + diff --git a/parsers/firefox b/parsers/firefox new file mode 100755 index 0000000..101f6d9 --- /dev/null +++ b/parsers/firefox @@ -0,0 +1,8 @@ +# firefox - needs Add URL to Window Title extension +# https://addons.mozilla.org/en-US/firefox/addon/add-url-to-window-title/ +# set delimiter to "::" + +domain () { + wmctrl -l | grep Firefox | grep "::" | awk '{print $(NF-3)}' +} + @@ -9,6 +9,11 @@ shopt -s nullglob globstar # read global config file source /etc/rofi-pass.conf +if [[ ! -d $HOME/.config/rofi-pass/parsers ]]; then + mkdir $HOME/.config/rofi-pass/parsers + cp /usr/share/doc/rofi-pass/parsers/* $HOME/.config/rofi-pass/parsers +fi + # check if local config exists and load it if [[ -f $HOME/.config/rofi-pass/config ]]; then source $HOME/.config/rofi-pass/config @@ -217,7 +222,7 @@ insertPass2 () { HELP="<span color='$help_color'>Enter Domain Name or chose one of the Options below</span>" domain=$(echo -e "< Return\n---\nGet URL from active Browser Tab" | rofi -dmenu -mesg "${HELP}" -p "URL > ") if [[ $domain == "Get URL from active Browser Tab" ]]; then - domain=$(domain) + domain=$($HOME/.config/rofi-pass/parsers/$BROWSER) insertPass2 elif [[ $domain == "< Return" ]]; then insertPass2 |