diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/config/config | 36 | ||||
-rwxr-xr-x | examples/data/scripts/uzbl-tabbed | 4 |
2 files changed, 21 insertions, 19 deletions
diff --git a/examples/config/config b/examples/config/config index ddeca7b..4934469 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 <span foreground="khaki">wait</span> # Reset the keycmd on navigation @@ -105,7 +111,8 @@ set selected_section = <span foreground="#606060">\@[\@SELECTED_URI]\@</span> set download_section = <span foreground="white">\@downloads</span> -set status_format = <span font_family="monospace">@mode_section @keycmd_section @progress_section @uri_section @name_section @status_section @scroll_section @selected_section @download_section</span> +set status_format = <span font_family="monospace">@mode_section @keycmd_section @progress_section @name_section @status_section @scroll_section @selected_section @download_section</span> +set status_format_right = <span font_family="monospace"><span foreground="#666">uri:</span> @uri_section</span> set title_format_long = \@keycmd_prompt \@raw_modcmd \@raw_keycmd \@TITLE - Uzbl browser <\@NAME> \@SELECTED_URI @@ -119,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 @@ -196,7 +203,7 @@ set ebind = @mode_bind global,-insert # === Mouse bindings ========================================================= # Middle click open in new window -@bind <Button2> = sh 'if [ "$1" ]; then uzbl-browser -u "$1"; else echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"; fi' '\@SELECTED_URI' +@bind <Button2> = 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 ------------------------------------------------------ @@ -205,7 +212,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 @@ -285,18 +292,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 <Shift-Insert> = sh 'echo "event INJECT_KEYCMD `xclip -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"' +@bind <Shift-Insert> = sh 'echo "event INJECT_KEYCMD $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' # Bookmark inserting binds @cbind <Ctrl>b<tags:>_ = sh 'echo `printf "$UZBL_URI %s"` >> "$XDG_DATA_HOME"/uzbl/bookmarks' @@ -334,12 +340,6 @@ set formfiller = spawn @scripts_dir/formfiller.sh @cbind gN = event NEW_TAB_NEXT @cbind go<uri:>_ = event NEW_TAB %s @cbind gO<uri:>_ = 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 diff --git a/examples/data/scripts/uzbl-tabbed b/examples/data/scripts/uzbl-tabbed index 0086c04..1d64436 100755 --- a/examples/data/scripts/uzbl-tabbed +++ b/examples/data/scripts/uzbl-tabbed @@ -452,7 +452,7 @@ class UzblInstance: type, args = args.split(" ", 1) if type == "TITLE_CHANGED": self.title = args.strip() - self.title_changed() + self.title_changed(False) elif type == "VARIABLE_SET": var, _, val = args.split(" ", 2) @@ -485,6 +485,8 @@ class UzblInstance: if var == "uri": self.uri = val.strip() self.parent.update_tablist() + elif type == "LOAD_COMMIT": + self.uri = args elif type == "NEW_TAB": self.parent.new_tab(args) elif type == "NEW_BG_TAB": |