From e211c19ca4729ad498a58ca6bbdf6b5ce9ef22ea Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Mon, 29 Nov 2010 17:49:01 -0700 Subject: use the new $UZBL_* env vars exclusively --- examples/data/scripts/session.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/data/scripts/session.sh') diff --git a/examples/data/scripts/session.sh b/examples/data/scripts/session.sh index 203cd52..c69b7e3 100755 --- a/examples/data/scripts/session.sh +++ b/examples/data/scripts/session.sh @@ -29,7 +29,8 @@ UZBL="uzbl-browser -c $UZBL_CONFIG_FILE" # add custom flags and whatever here. if [ $# -gt 1 ]; then # this script is being run from uzbl, rather than standalone - . "$UZBL_UTIL_DIR"/uzbl-args.sh + # discard the uzbl arguments + shift 7 fi scriptfile=$0 # this script -- cgit v1.2.3 From 0faed45023a73e446f606871b2480a317e4d8d2d Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Mon, 29 Nov 2010 17:55:07 -0700 Subject: $UZBL_URL -> $UZBL_URI (for consistency with the rest of our interface) --- examples/config/config | 10 +++++----- examples/data/scripts/formfiller.sh | 2 +- examples/data/scripts/history.sh | 2 +- examples/data/scripts/insert_bookmark.sh | 4 ++-- examples/data/scripts/session.sh | 2 +- examples/data/scripts/userscript.sh | 6 +++--- examples/data/scripts/userscripts.sh | 2 +- src/callbacks.c | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) (limited to 'examples/data/scripts/session.sh') diff --git a/examples/config/config b/examples/config/config index 144eb00..22414ad 100644 --- a/examples/config/config +++ b/examples/config/config @@ -267,13 +267,13 @@ set ebind = @mode_bind global,-insert @cbind gh = uri http://www.uzbl.org # Yanking & pasting binds -@cbind yu = sh 'echo -n "$UZBL_URL" | xclip' +@cbind yu = sh 'echo -n "$UZBL_URI" | xclip' @cbind yU = sh 'echo -n $8 | xclip' \@SELECTED_URI @cbind yy = sh 'echo -n "$UZBL_TITLE" | xclip' @cbind yY = sh 'echo -n $8 | xclip' \@SELECTED_URI # Clone current window -@cbind c = sh 'uzbl-browser -u "$UZBL_URL"' +@cbind c = sh 'uzbl-browser -u "$UZBL_URI"' # Go the page from primary selection @cbind p = sh 'echo "uri `xclip -selection primary -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"' # Go to the page in clipboard @@ -284,7 +284,7 @@ set ebind = @mode_bind global,-insert @bind = sh 'echo "event INJECT_KEYCMD `xclip -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"' # Bookmark inserting binds -@cbind b_ = sh 'echo `printf "$UZBL_URL %s"` >> "$XDG_DATA_HOME"/uzbl/bookmarks' +@cbind b_ = sh 'echo `printf "$UZBL_URI %s"` >> "$XDG_DATA_HOME"/uzbl/bookmarks' # Or use a script to insert a bookmark. @cbind B = spawn @scripts_dir/insert_bookmark.sh @@ -323,8 +323,8 @@ set formfiller = spawn @scripts_dir/formfiller.sh @cbind gY = sh 'echo "event NEW_TAB_NEXT `xclip -selection primary -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"' # Clone current tab -@cbind gd = sh 'echo "event NEW_TAB $UZBL_URL" > "$UZBL_FIFO"' -@cbind gD = sh 'echo "event NEW_TAB_NEXT $UZBL_URL" > "$UZBL_FIFO"' +@cbind gd = sh 'echo "event NEW_TAB $UZBL_URI" > "$UZBL_FIFO"' +@cbind gD = sh 'echo "event NEW_TAB_NEXT $UZBL_URI" > "$UZBL_FIFO"' # Closing / resting @cbind gC = exit diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index 0f04f8a..c6822e6 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -55,7 +55,7 @@ MODELINE="> vim:ft=formfiller" action=$1 -domain=$(echo $UZBL_URL | sed 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/') +domain=$(echo $UZBL_URI | sed 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/') if [ "$action" != 'edit' -a "$action" != 'new' -a "$action" != 'load' -a "$action" != 'add' -a "$action" != 'once' ]; then action="new" diff --git a/examples/data/scripts/history.sh b/examples/data/scripts/history.sh index 167aed7..266d65d 100755 --- a/examples/data/scripts/history.sh +++ b/examples/data/scripts/history.sh @@ -4,4 +4,4 @@ [ -w "$UZBL_HISTORY_FILE" ] || [ ! -a "$UZBL_HISTORY_FILE" ] || exit 1 -echo $(date +'%Y-%m-%d %H:%M:%S')" $UZBL_URL $UZBL_TITLE" >> $UZBL_HISTORY_FILE +echo $(date +'%Y-%m-%d %H:%M:%S')" $UZBL_URI $UZBL_TITLE" >> $UZBL_HISTORY_FILE diff --git a/examples/data/scripts/insert_bookmark.sh b/examples/data/scripts/insert_bookmark.sh index 294d314..f67e67a 100755 --- a/examples/data/scripts/insert_bookmark.sh +++ b/examples/data/scripts/insert_bookmark.sh @@ -7,9 +7,9 @@ which zenity >/dev/null 2>&1 || exit 2 -tags=$(zenity --entry --text="Enter space-separated tags for bookmark $UZBL_URL:") +tags=$(zenity --entry --text="Enter space-separated tags for bookmark $UZBL_URI:") exitstatus=$? [ $exitstatus -eq 0 ] || exit $exitstatus # TODO: check if already exists, if so, and tags are different: ask if you want to replace tags -echo "$UZBL_URL $tags" >> "$UZBL_BOOKMARKS_FILE" +echo "$UZBL_URI $tags" >> "$UZBL_BOOKMARKS_FILE" diff --git a/examples/data/scripts/session.sh b/examples/data/scripts/session.sh index c69b7e3..c5c4172 100755 --- a/examples/data/scripts/session.sh +++ b/examples/data/scripts/session.sh @@ -54,7 +54,7 @@ case $act in echo "session manager: endinstance must be called from uzbl" exit 1 fi - [ "$UZBL_URL" != "(null)" ] && echo "$UZBL_URL" >> "$UZBL_SESSION_FILE" + [ "$UZBL_URI" != "(null)" ] && echo "$UZBL_URI" >> "$UZBL_SESSION_FILE" echo exit > "$UZBL_FIFO" ;; diff --git a/examples/data/scripts/userscript.sh b/examples/data/scripts/userscript.sh index 1e76fd2..fd95fdc 100755 --- a/examples/data/scripts/userscript.sh +++ b/examples/data/scripts/userscript.sh @@ -3,7 +3,7 @@ if [ $# = "3" ] then UZBL_FIFO=$1 - UZBL_URL=$2 + UZBL_URI=$2 SCRIPT=$3 else SCRIPT=$8 @@ -16,7 +16,7 @@ SHOULD_RUN=false # Assume this script will not be included for INCLUDE in `echo "$META" | grep "^\s*\/\/\s*@include"`; do # Munge into grep pattern INCLUDE="`echo "$INCLUDE" | sed -e 's/^\s*\/\/\s*@include\s*//' -e 's/\./\\\\./g' -e 's/\*/.*/g' -e 's/[\r\n]//g'`" - if echo "$UZBL_URL" | grep -x "$INCLUDE"; then + if echo "$UZBL_URI" | grep -x "$INCLUDE"; then SHOULD_RUN=true break fi @@ -26,7 +26,7 @@ done for EXCLUDE in `echo "$META" | grep "^\s*\/\/\s*@exclude"`; do # Munge into grep pattern EXCLUDE="`echo "$EXCLUDE" | sed -e 's/^\s*\/\/\s*@exclude\s*//' -e 's/\./\\\\./g' -e 's/\*/.*/g' -e 's/[\r\n]//g'`" - if echo "$UZBL_URL" | grep -x "$EXCLUDE"; then + if echo "$UZBL_URI" | grep -x "$EXCLUDE"; then SHOULD_RUN=false break fi diff --git a/examples/data/scripts/userscripts.sh b/examples/data/scripts/userscripts.sh index 2c66ed8..4f76c90 100755 --- a/examples/data/scripts/userscripts.sh +++ b/examples/data/scripts/userscripts.sh @@ -4,5 +4,5 @@ scripts_dir="$XDG_DATA_HOME/uzbl/userscripts" for SCRIPT in $(grep -rlx "\s*//\s*==UserScript==\s*" "$scripts_dir") do - $XDG_DATA_HOME/uzbl/scripts/userscript.sh "$UZBL_FIFO" "$UZBL_URL" "$SCRIPT" + $XDG_DATA_HOME/uzbl/scripts/userscript.sh "$UZBL_FIFO" "$UZBL_URI" "$SCRIPT" done diff --git a/src/callbacks.c b/src/callbacks.c index 2637810..4f0e4ac 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -437,7 +437,7 @@ load_status_change_cb (WebKitWebView* web_view, GParamSpec param_spec) { g_free (uzbl.state.uri); GString* newuri = g_string_new (webkit_web_frame_get_uri (frame)); uzbl.state.uri = g_string_free (newuri, FALSE); - g_setenv("UZBL_URL", uzbl.state.uri, TRUE); + g_setenv("UZBL_URI", uzbl.state.uri, TRUE); send_event(LOAD_COMMIT, webkit_web_frame_get_uri (frame), NULL); break; -- cgit v1.2.3