From 0e40979506f1c82e6cc9182416962370d787e9b3 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Tue, 4 Jan 2011 10:50:37 -0700 Subject: use NEW_WINDOW event in examples that open new windows --- examples/config/config | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index f2d55b0..7bc0087 100644 --- a/examples/config/config +++ b/examples/config/config @@ -48,13 +48,19 @@ set download_handler = sync_spawn @scripts_dir/download.sh # === Dynamic event handlers ================================================= +# What to do when a website wants to open a new window: # Open link in new window @on_event NEW_WINDOW sh 'uzbl-browser ${1:+-u "$1"}' %r -# Open in current window +# Open in current window (also see the REQ_NEW_WINDOW event handler below) #@on_event NEW_WINDOW uri %s -# Open in new tab +# Open in new tab. Other options are NEW_TAB_NEXT, NEW_BG_TAB and NEW_BG_TAB_NEXT. #@on_event NEW_WINDOW event NEW_TAB %s +# What to do when the user requests a new window: +# If your the NEW_WINDOW handler opens the uri in the current window, you'll +# probably want to change this handler to open a new window or tab. +@on_event REQ_NEW_WINDOW event NEW_WINDOW %s + # Load start handler @on_event LOAD_START @set_status wait # Reset the keycmd on navigation @@ -186,7 +192,7 @@ set ebind = @mode_bind global,-insert # --- Mouse bindings --------------------------------------------------------- # Middle click open in new window -@bind = sh 'if [ "$1" ]; then uzbl-browser -u "$1"; else echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"; fi' '\@SELECTED_URI' +@bind = sh 'if [ "$1" ]; then echo "event REQ_NEW_WINDOW $1" > "$UZBL_FIFO"; else echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"; fi' '\@SELECTED_URI' # --- Keyboard bindings ------------------------------------------------------ @@ -195,7 +201,7 @@ set ebind = @mode_bind global,-insert @cbind :_ = %s # open a new window or a new tab (see the on_event NEW_WINDOW settings above) -@cbind w = event NEW_WINDOW +@cbind w = event REQ_NEW_WINDOW # Page movement binds @cbind j = scroll vertical 20 @@ -275,18 +281,17 @@ set ebind = @mode_bind global,-insert @cbind yu = sh 'echo -n "$UZBL_URI" | xclip' @cbind yU = sh 'echo -n "$1" | xclip' \@SELECTED_URI @cbind yy = sh 'echo -n "$UZBL_TITLE" | xclip' -@cbind yY = sh 'echo -n "$1" | xclip' \@SELECTED_URI # Clone current window -@cbind c = sh 'uzbl-browser -u "$UZBL_URI"' +@cbind c = event REQ_NEW_WINDOW \@uri # Go the page from primary selection -@cbind p = sh 'echo "uri `xclip -selection primary -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"' +@cbind p = sh 'echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' # Go to the page in clipboard -@cbind P = sh 'echo "uri `xclip -selection clipboard -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"' +@cbind P = sh 'echo "uri $(xclip -selection clipboard -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' # Start a new uzbl instance from the page in primary selection -@cbind 'p = sh 'exec uzbl-browser --uri "$(xclip -o)"' +@cbind 'p = sh 'echo "event REQ_NEW_WINDOW $(xclip -o)" > "$UZBL_FIFO"' # paste primary selection into keycmd at the cursor position -@bind = sh 'echo "event INJECT_KEYCMD `xclip -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"' +@bind = sh 'echo "event INJECT_KEYCMD $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' # Bookmark inserting binds @cbind b_ = sh 'echo `printf "$UZBL_URI %s"` >> "$XDG_DATA_HOME"/uzbl/bookmarks' @@ -324,12 +329,6 @@ set formfiller = spawn @scripts_dir/formfiller.sh @cbind gN = event NEW_TAB_NEXT @cbind go_ = event NEW_TAB %s @cbind gO_ = event NEW_TAB_NEXT %s -@cbind gy = sh 'echo "event NEW_TAB `xclip -selection primary -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"' -@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_URI" > "$UZBL_FIFO"' -@cbind gD = sh 'echo "event NEW_TAB_NEXT $UZBL_URI" > "$UZBL_FIFO"' # Closing / resting @cbind gC = exit -- cgit v1.2.3 From c60e5b1c082b2322567e32d31d010a29e79f97b1 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Thu, 6 Jan 2011 16:47:01 -0700 Subject: use new status_format_right in the example config now long URLs won't push everything else off the status bar! --- examples/config/config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 7bc0087..46a3ae4 100644 --- a/examples/config/config +++ b/examples/config/config @@ -111,7 +111,8 @@ set selected_section = \@[\@SELECTED_URI]\@ set download_section = \@downloads -set status_format = @mode_section @keycmd_section @progress_section @uri_section @name_section @status_section @scroll_section @selected_section @download_section +set status_format = @mode_section @keycmd_section @progress_section @name_section @status_section @scroll_section @selected_section @download_section +set status_format_right = uri: @uri_section set title_format_long = \@keycmd_prompt \@raw_modcmd \@raw_keycmd \@TITLE - Uzbl browser <\@NAME> \@SELECTED_URI -- cgit v1.2.3 From 47d0b30b3345a8128d1b064cf9bbdc379a45dfa5 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Thu, 6 Jan 2011 17:44:22 -0700 Subject: we don't need to be that specific in the useragent header. --- examples/config/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 46a3ae4..a2ecdb8 100644 --- a/examples/config/config +++ b/examples/config/config @@ -126,7 +126,7 @@ set progress.pending = # === Useragent setup ======================================================== -set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}.@{WEBKIT_MICRO}) (@(+uname -sm)@ [@ARCH_UZBL]) (Commit @COMMIT) +set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}) (@(+uname -sm)@ [@ARCH_UZBL]) # === Configure cookie blacklist ======================================================== # Drop google analytics tracking cookies -- cgit v1.2.3