aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-06-06 13:23:53 +0200
committerRasmus Steinke <rasi@xssn.at>2015-06-06 13:23:53 +0200
commit2c00582d29f73f6f481aef7736c3d7726a419d4f (patch)
treeb96f5c47de49b0b6761e973612e77e52096a80d2
parent19689bd4b3c06f079f30c8c37ce339acdac507a4 (diff)
downloadrofi-pass-2c00582d29f73f6f481aef7736c3d7726a419d4f.tar.gz
add parsers
-rw-r--r--config.example19
-rwxr-xr-xparsers/chromium11
-rwxr-xr-xparsers/firefox8
-rwxr-xr-xrofi-pass7
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)}'
+}
+
diff --git a/rofi-pass b/rofi-pass
index 47d3090..e583ce5 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -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