aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-06-06 11:50:31 +0200
committerRasmus Steinke <rasi@xssn.at>2015-06-06 11:50:31 +0200
commit19689bd4b3c06f079f30c8c37ce339acdac507a4 (patch)
tree6f5d29df5208081f96915cbe253867c7f209c199
parent9e23626764810993bb369aedc68c97038175d84d (diff)
downloadrofi-pass-19689bd4b3c06f079f30c8c37ce339acdac507a4.tar.gz
set title detection in config file
-rw-r--r--config.example23
-rwxr-xr-xrofi-pass13
2 files changed, 21 insertions, 15 deletions
diff --git a/config.example b/config.example
index 7061692..373abb8 100644
--- a/config.example
+++ b/config.example
@@ -16,8 +16,21 @@ BROWSER='chromium'
help_color="#0C73C2"
-## rofi expects a root directory in your basedir
-## underneath this directory all your password groups
-## are stored inside directories.
-## if you don't want to separate roots, enable this setting
-#root=.
+# 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/rofi-pass b/rofi-pass
index 03c003c..47d3090 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -215,16 +215,9 @@ insertPass2 () {
elif [[ $menu == "2 URL"* ]]; then
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 Chromium Tab\nGet URL from active Firefox Tab" | rofi -dmenu -mesg "${HELP}" -p "URL > ")
- if [[ $domain == "Get URL from active Chromium Tab" ]]; then
- # use url in title chrome extension with format: "{protocol}://{hostname}{port}/{path}/{args}"
- # https://chrome.google.com/webstore/detail/url-in-title/ignpacbgnbnkaiooknalneoeladjnfgb?utm_source=chrome-app-launcher-info-dialog
- domain=$(wmctrl -l | grep Chromium | awk '{print $(NF-2)}')
- insertPass2
- elif [[ $domain == "Get URL from active Firefox Tab" ]]; then
- # https://addons.mozilla.org/en-uS/firefox/addon/add-url-to-window-title/
- # set "Show full URL" in preferences and separator to "::"
- domain=$(wmctrl -l | grep Firefox | grep "::" | awk '{print $(NF-3)}')
+ 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)
insertPass2
elif [[ $domain == "< Return" ]]; then
insertPass2