From 7862c989c4faa65e5dc0e43ac37eca7811eb8264 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Tue, 24 Feb 2015 23:25:19 +0100 Subject: move to uzbl-next --- config/uzbl/config | 457 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 256 insertions(+), 201 deletions(-) (limited to 'config') diff --git a/config/uzbl/config b/config/uzbl/config index c39c50c..e7735de 100644 --- a/config/uzbl/config +++ b/config/uzbl/config @@ -1,78 +1,74 @@ # Example uzbl config. All settings are optional. You can use uzbl without # any config at all (but it won't do much). + # === Core settings ========================================================== # Polipo proxy for caching set proxy_url = http://127.0.0.1:8123 # common directory locations -set prefix = @(echo $PREFIX)@ -set data_home = @(echo $XDG_DATA_HOME)@ -set cache_home = @(echo $XDG_CACHE_HOME)@ -set config_home = @(echo $XDG_CONFIG_HOME)@ +set prefix @(echo $UZBL_PREFIX)@ +set data_home @(echo $XDG_DATA_HOME/uzbl)@ +set cache_home @(echo $XDG_CACHE_HOME/uzbl)@ +set config_home @(echo $XDG_CONFIG_HOME/uzbl)@ +set local_storage_path @data_home/databases/ # colors -set color1 = @(source ~/.colors; echo $COLOR1)@ -set color2 = @(source ~/.colors; echo $COLOR2)@ -set color3 = @(source ~/.colors; echo $COLOR3)@ -set color4 = @(source ~/.colors; echo $COLOR4)@ -set color5 = @(source ~/.colors; echo $COLOR5)@ -set color6 = @(source ~/.colors; echo $COLOR6)@ -set color7 = @(source ~/.colors; echo $COLOR7)@ -set color8 = @(source ~/.colors; echo $COLOR8)@ -set color9 = @(source ~/.colors; echo $COLOR9)@ -set color10 = @(source ~/.colors; echo $COLOR10)@ -set color11 = @(source ~/.colors; echo $COLOR11)@ -set color12 = @(source ~/.colors; echo $COLOR12)@ -set color13 = @(source ~/.colors; echo $COLOR13)@ -set color14 = @(source ~/.colors; echo $COLOR14)@ -set color15 = @(source ~/.colors; echo $COLOR15)@ +set color1 @(source ~/.colors; echo $COLOR1)@ +set color2 @(source ~/.colors; echo $COLOR2)@ +set color3 @(source ~/.colors; echo $COLOR3)@ +set color4 @(source ~/.colors; echo $COLOR4)@ +set color5 @(source ~/.colors; echo $COLOR5)@ +set color6 @(source ~/.colors; echo $COLOR6)@ +set color7 @(source ~/.colors; echo $COLOR7)@ +set color8 @(source ~/.colors; echo $COLOR8)@ +set color9 @(source ~/.colors; echo $COLOR9)@ +set color10 @(source ~/.colors; echo $COLOR10)@ +set color11 @(source ~/.colors; echo $COLOR11)@ +set color12 @(source ~/.colors; echo $COLOR12)@ +set color13 @(source ~/.colors; echo $COLOR13)@ +set color14 @(source ~/.colors; echo $COLOR14)@ +set color15 @(source ~/.colors; echo $COLOR15)@ # Interface paths. -set fifo_dir = /tmp -set socket_dir = /tmp - -set shell_cmd = sh -c +set comm_dir @([ -n "$XDG_RUNTIME_DIR" ] && echo "$XDG_RUNTIME_DIR/uzbl" || echo "/tmp/uzbl-$USER")@ +set fifo_dir @comm_dir +set socket_dir @comm_dir # === General config aliases ================================================= -# Config related events (use the request function): -# request MODE_CONFIG = -set mode_config = request MODE_CONFIG -# request ON_EVENT -set on_event = request ON_EVENT -# request ON_SET -set on_set = request ON_SET -# request MODMAP -set modmap = request MODMAP -# request IGNORE_KEY -set ignore_key = request IGNORE_KEY -# request TOGGLE_MODES ... -set toggle_modes = request TOGGLE_MODES - -set set_mode = set mode = -set set_status = set status_message = +# Config related events (use the event function): +# event MODE_CONFIG = +set mode_config event MODE_CONFIG +# event ON_EVENT +set on_event event ON_EVENT +# event ON_SET +set on_set event ON_SET +# event MODMAP +set modmap event MODMAP +# event IGNORE_KEY +set ignore_key event IGNORE_KEY + +set set_mode set mode +set set_status set status_message # Spawn path shortcuts. In spawn the first dir+path match is used in "dir1:dir2:dir3:executable" -set scripts_dir = @data_home/uzbl/scripts:@prefix/share/uzbl/examples/data:scripts +set scripts_dir @data_home:@prefix/share/uzbl/examples/data:scripts # === Hardcoded handlers ===================================================== -# These handlers can't be moved to the new event system yet as we don't -# support events that can wait for a response from a script. -set scheme_handler = sync_spawn @scripts_dir/scheme.py -#set request_handler = sync_spawn @scripts_dir/request.py -set authentication_handler = sync_spawn @scripts_dir/auth.py -set download_handler = sync_spawn /home/vasko/.config/uzbl/scripts/download.sh -#set download_handler = sync_spawn @scripts_dir/download.sh +set navigation_handler spawn_sync @scripts_dir/scheme.py +#set request_handler spawn_sync @scripts_dir/request.py +set authentication_handler spawn_sync @scripts_dir/auth.py +set download_handler spawn_sync @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 +@on_event NEW_WINDOW spawn_sh 'uzbl-browser ${0:+-u "$0"}' %r # Open in current window (also see the REQ_NEW_WINDOW event handler below) #@on_event NEW_WINDOW uri %s # Open in new tab. Other options are NEW_TAB_NEXT, NEW_BG_TAB and NEW_BG_TAB_NEXT. @@ -81,7 +77,7 @@ set download_handler = sync_spawn /home/vasko/.config/uzbl/scripts/download.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 +@on_event REQ_NEW_WINDOW event @- if (@embedded) "NEW_TAB"; else "NEW_WINDOW" -@ %s # Load start handler @on_event LOAD_START @set_status wait @@ -89,95 +85,108 @@ set download_handler = sync_spawn /home/vasko/.config/uzbl/scripts/download.s @on_event LOAD_START @set_mode # Load commit handlers -@on_event LOAD_COMMIT @set_status recv +@on_event LOAD_COMMIT @set_status recv - # add some javascript to the page for other 'js' and 'script' commands to access later. -@on_event LOAD_COMMIT js uzbl = {}; -@on_event LOAD_COMMIT script @scripts_dir/formfiller.js -@on_event LOAD_COMMIT script @scripts_dir/follow.js -#@on_event LOAD_COMMIT script /home/vasko/.config/uzbl/scripts/privacy.js +# add some javascript to the page for other 'js' commands to access later. +@on_event LOAD_COMMIT js page string 'uzbl = {}' +@on_event LOAD_COMMIT js page file @scripts_dir/formfiller.js +@on_event LOAD_COMMIT js page file @scripts_dir/follow.js +@on_event LOAD_COMMIT js page file @scripts_dir/go_input.js +@on_event LOAD_COMMIT js page file @scripts_dir/navigation.js # Userscripts/per-site-settings. See the script and the example configuration for details -#@on_event LOAD_COMMIT spawn @scripts_dir/per-site-settings.py @data_home/uzbl/per-site-settings +#@on_event LOAD_COMMIT spawn @scripts_dir/per-site-settings.py @data_home/per-site-settings # Load finish handlers @on_event LOAD_FINISH @set_status done @on_event LOAD_FINISH spawn @scripts_dir/history.sh # Switch to insert mode if a (editable) html form is clicked -@on_event FOCUS_ELEMENT sh 'if [ "$1" = INPUT -o "$1" = TEXTAREA -o "$1" = SELECT ]; then echo "@set_mode insert" > $UZBL_FIFO; fi' %s +@on_event FORM_ACTIVE @set_mode insert +# Switch to insert mode if a (editable) html form gains focus +@on_event FOCUS_ELEMENT spawn_sh 'if [ "$0" = INPUT -o "$0" = TEXTAREA -o "$0" = SELECT ]; then echo "@set_mode insert" > $UZBL_FIFO; fi' %s # Switch to command mode if anything else is clicked @on_event ROOT_ACTIVE @set_mode command +# Clear input when the page or an element gains focus. +@on_event ROOT_ACTIVE event KEYCMD_CLEAR +@on_event FOCUS_ELEMENT event KEYCMD_CLEAR + +@on_event AUTHENTICATE spawn @scripts_dir/auth.py "%1" "%2" "%3" # Example CONFIG_CHANGED event handler #@on_event CONFIG_CHANGED print Config changed: %1 = %2 # Scroll percentage calculation -@on_event SCROLL_VERT set scroll_message = \@<(function(curr, min, max, size){if(max == size) return '--'; var p=(curr/(max - size)); return Math.round(10000*p)/100;})(%1,%2,%3,%4)>\@% +@on_event SCROLL_VERT set scroll_message \@<(function(curr, min, max, size){if(max == size) return '--'; var p=(curr/(max - size)); return Math.round(10000*p)/100;})(%1,%2,%3,%4)>\@% # === Behaviour and appearance =============================================== # Custom CSS can be defined here, including link follower hint styles -set stylesheet_uri = file://@config_home/uzbl/style.css +set stylesheet_uri file://@config_home/style.css -set show_status = 0 -set status_top = 0 -set status_background = #1c1c1c +# If WebKits builtin authentication dialog should be used, if enabling remember +# to disable external authentication handlers +set enable_builtin_auth 0 -set modcmd_style = weight="bold" foreground="@color13" -set keycmd_style = weight="light" foreground="@color13" -set prompt_style = foreground="@color2" -set cursor_style = underline="single" -set completion_style = foreground="@color2" -set hint_style = weight="bold" +set show_status 1 +set status_top 0 +set status_background #303030 -set mode_section = [\@[\@mode_indicator]\@] -set keycmd_section = [\@[\@keycmd_prompt]\@\@modcmd\@keycmd\@completion_list] -set progress_section = \@[\@progress.output]\@ -set scroll_section = \@[\@scroll_message]\@ -set uri_section = \@[\@uri]\@ -set name_section = \@[\@NAME]\@ -set status_section = \@status_message -set selected_section = \@[\@SELECTED_URI]\@ +set modcmd_style weight="bold" foreground="red" +set keycmd_style weight="light" foreground="red" +set prompt_style foreground="grey" +set cursor_style underline="single" +set completion_style foreground="green" +set hint_style weight="bold" -set download_section = \@downloads +set mode_section [\@[\@mode_indicator]\@] +set keycmd_section [\@[\@keycmd_prompt]\@\@modcmd\@keycmd\@completion_list] +set progress_section \@[\@progress.output]\@ +set scroll_section \@[\@scroll_message]\@ +set uri_section \@">\@[\@uri]\@ +set name_section \@[\@NAME]\@ +set status_section \@status_message +set selected_section \@[\@SELECTED_URI]\@ -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 download_section \@downloads -set title_format_long = \@keycmd_prompt \@raw_modcmd \@raw_keycmd \@TITLE - Uzbl browser <\@NAME> \@SELECTED_URI +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 # Progress bar config # %d = done, %p = pending %c = percent done, %i = int done, %s = spinner, # %t = percent pending, %o = int pending, %r = sprite scroll -set progress.width = 8 -set progress.format = [%d>%p]%c -set progress.done = = -set progress.pending = +set progress.width 8 +set progress.format [%d>%p]%c +set progress.done = +set progress.pending # === Useragent setup ======================================================== -#set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}) (@(+uname -sm)@ [@ARCH_UZBL]) +#set useragent Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}) (@(+uname -sm)@ [@ARCH_UZBL]) set useragent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5 -#set useragent = Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.0 -# === Configure cookie blacklist ======================================================== +# === Configure cookie blacklist ============================================= + +set cookie_policy always # Accept 'session cookies' from uzbl.org (when you have a whitelist all other cookies are dropped) -#request WHITELIST_COOKIE domain 'uzbl.org$' expires '^$' +#event WHITELIST_COOKIE domain '(^|\.)uzbl\.org$' expires '^$' -# Drop google analytics tracking cookies (applied after whitelists if any) -#request BLACKLIST_COOKIE name '^__utm.$' +# Drop google analytics tracking cookies (applied after whitelists, if any) +#event BLACKLIST_COOKIE name '^__utm.$' -# === SSL related configuration ============================================== +# === Javascript configuration ============================================== -# Set it to certificates store of your distribution, or your own CAfile. -set ssl_ca_file = /etc/ssl/certs/ca-certificates.crt -set ssl_verify = 1 -# Command to toggle ssl_verify value: -@cbind !ssl = chain 'toggle ssl_verify' 'reload' -# Example SSL error handler: -@on_event LOAD_ERROR js var patt=new RegExp('SSL handshake failed'); if (patt.test('%3')) {alert ('%3');} +# Turn off javascript support +# set enable_scripts 0 + +# === Proxy configuration =================================================== + +# Direct uzbl at a proxy service (ex. privoxy) +# set proxy_url http://localhost:8118 # === Key binding configuration ============================================== # --- Internal modmapping and ignoring --------------------------------------- @@ -185,7 +194,7 @@ set ssl_verify = 1 #modmap @modmap @modmap -#@modmap +@modmap @modmap #ignore_key @@ -196,29 +205,29 @@ set ssl_verify = 1 # --- Bind aliases ----------------------------------------------------------- -# request BIND = -set bind = request MODE_BIND global +# event BIND = +set bind event MODE_BIND global -# request MODE_BIND = -set mode_bind = request MODE_BIND +# event MODE_BIND = +set mode_bind event MODE_BIND # Insert mode binding alias -set ibind = @mode_bind insert +set ibind @mode_bind insert # Command mode binding alias -set cbind = @mode_bind command +set cbind @mode_bind command # Non-insert mode bindings alias (ebind for edit-bind). -set ebind = @mode_bind global,-insert +set ebind @mode_bind global,-insert # --- Global & keycmd editing binds ------------------------------------------ # Resets keycmd and returns to default mode. @on_event ESCAPE @set_mode @on_event ESCAPE event KEYCMD_CLEAR -@on_event ESCAPE js uzbl.follow.clearHints() -@on_event ESCAPE search_clear -@on_event ESCAPE js window.getSelection().removeAllRanges() +@on_event ESCAPE js page string uzbl.follow.clearHints() +@on_event ESCAPE search clear +@on_event ESCAPE js page string window.getSelection().removeAllRanges() @bind = event ESCAPE @bind [ = event ESCAPE @@ -249,7 +258,7 @@ set ebind = @mode_bind global,-insert # --- Mouse bindings --------------------------------------------------------- # Middle click open in new window -@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' +@bind = spawn_sh 'if [ "$0" ]; then echo "event REQ_NEW_WINDOW $0" > "$UZBL_FIFO"; else echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"; fi' '\@SELECTED_URI' # --- Keyboard bindings ------------------------------------------------------ @@ -261,85 +270,90 @@ set ebind = @mode_bind global,-insert #@cbind w = event REQ_NEW_WINDOW @cbind w_ = spawn /home/vasko/.config/uzbl/scripts/gowiki.pl %s @cbind W_ = spawn /home/vasko/.config/uzbl/scripts/gowikio.pl %s +@cbind a_ = uri http://wiki.archlinux.org/index.php/Special:Search?search=\@\@&go=Go + + # Page movement binds @cbind j = scroll vertical 20 @cbind k = scroll vertical -20 -@cbind h = scroll horizontal -20 -@cbind l = scroll horizontal 20 +@cbind H = scroll horizontal -20 +@cbind L = scroll horizontal 20 @cbind = scroll vertical -100% @cbind = scroll vertical 100% @cbind f = scroll vertical 100% @cbind b = scroll vertical -100% @cbind e = scroll vertical -50% @cbind s = scroll vertical 50% -@cbind gg = scroll vertical begin -@cbind G = scroll vertical end +@cbind << = scroll vertical begin +@cbind >> = scroll vertical end @cbind = scroll vertical begin @cbind = scroll vertical end @cbind ^ = scroll horizontal begin @cbind $ = scroll horizontal end -#@cbind = scroll vertical end +@cbind = scroll vertical end @cbind G_ = scroll vertical %r! +# The first '_' is literal, so type '_G' to trigger this binding. @cbind _G_ = scroll horizontal %r! +# Frozen binding +@cbind F = toggle frozen + # Navigation binds @cbind b = back @cbind m = forward +@cbind gb = uri \@< encodeURI(uzbl.navigation.prev()) >\@ +@cbind gf = uri \@< encodeURI(uzbl.navigation.next()) >\@ @cbind S = stop -@cbind r = reload -@cbind R = reload_ign_cache +@cbind r = reload cached +@cbind R = reload full # Zoom binds -@cbind = = zoom_in -@cbind - = zoom_out -#3@cbind T = toggle zoom_type -@cbind 1 = set zoom_level = 1.0 -@cbind 2 = set zoom_level = 2.0 +@cbind + = zoom in +@cbind - = zoom out +@cbind T = toggle zoom_type +@cbind 1 = set zoom_level 1.0 +@cbind 2 = set zoom_level 2.0 # Appearance binds #@cbind t = toggle show_status -@cbind t_ = spawn /home/vasko/.config/uzbl/scripts/gonew.pl %s - # Page searching binds -@cbind /* = search %s -@cbind ?* = search_reverse %s +@cbind /* = search find %s +@cbind ?* = search rfind %s # Jump to next and previous items -@cbind n = search -@cbind N = search_reverse +@cbind n = search find +@cbind N = search rfind # Print pages to a printer -@cbind p = hardcopy +@cbind p = hardcopy page # Web searching binds -@cbind d_ = uri https://encrypted.google.com/search?q=\@\@&hl=en -#@cbind dg_ = uri http://duckduckgo.com/?q=%s -@cbind a_ = uri https://wiki.archlinux.org/index.php/Special:Search?search=\@\@&go=Go -@cbind T_ = uri http://torrentshack.me/torrents.php?searchstr=\@\@&go=Go -@cbind \\wiki_ = uri https://en.wikipedia.org/w/index.php?title=Special:Search&search=\@\@&go=Go +@cbind gg_ = uri http://www.google.com/search?q=\@\@ +#@cbind ddg_ = uri http://duckduckgo.com/?q=%s +@cbind \\awiki_ = uri http://wiki.archlinux.org/index.php/Special:Search?search=\@\@&go=Go +@cbind \\wiki_ = uri http://en.wikipedia.org/w/index.php?title=Special:Search&search=\@\@&go=Go # Handy binds # Set function shortcut -#@cbind s__ = set %1 = %2 +#@cbind s__ = set %1 %2 # Exit binding @cbind ZZ = exit -@cbind :wq = exit -@cbind :_ = %s # Dump config to stdout -@cbind !dump = sh 'echo dump_config > "$UZBL_FIFO"' +@cbind !dump = spawn_sh 'echo dump_config > "$UZBL_FIFO"' # Reload all variables in the config -@cbind !reload = sh "sed '/^# === Post-load misc commands/,$d' \"$UZBL_CONFIG\" | grep '^set ' > \"$UZBL_FIFO\"" +@cbind !reload = spawn_sh "sed '/^# === Post-load misc commands/,$d' \"$UZBL_CONFIG\" | grep '^set ' > \"$UZBL_FIFO\"" # Use socat to directly inject commands into uzbl-core and view events # raised by uzbl-core: -@cbind t = sh 'xterm -e "socat unix-connect:\"$UZBL_SOCKET\" -"' -#@cbind t = sh 'urxvt -e socat unix-connect:"$UZBL_SOCKET" -' +@cbind t = spawn_sh 'xterm -e "socat unix-connect:\"$UZBL_SOCKET\" -"' +#@cbind t = spawn_sh 'urxvt -e socat unix-connect:"$UZBL_SOCKET" -' # Uri opening prompts #@cbind o_ = uri %s @cbind o_ = spawn /home/vasko/.config/uzbl/scripts/goto.pl %s -#@cbind o _ = spawn /home/vasko/.config/uzbl/scripts/goto.js '%s' +@cbind t_ = spawn /home/vasko/.config/uzbl/scripts/gonew.pl %s + # Or have it load the current uri into the keycmd for editing @cbind O_ = uri %s @@ -361,24 +375,28 @@ set ebind = @mode_bind global,-insert @cbind zS = event REQ_NEW_WINDOW \@(echo "$UZBL_URI" | sed -e 's/^http:/https:/')\@ # Yanking & pasting binds -@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 yu = spawn_sh 'echo -n "$UZBL_URI" | xclip' +@cbind yU = spawn_sh 'echo -n "$0" | xclip' '\@SELECTED_URI' +@cbind yy = spawn_sh 'echo -n "$UZBL_TITLE" | xclip' @cbind ys = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ clipboard +# Selection bindings +@cbind a = js (function () { var r = document.createRange(), s = window.getSelection(); r.selectNodeContents(document); s.removeAllRanges(); s.addRange(r); })(); +@cbind c = sh 'echo '\@< window.getSelection().toString().replace(/'/g, "\\'"); >\@' | xclip -selection clipboard -i' + # Clone current window @cbind c = event REQ_NEW_WINDOW \@uri # Go the page from primary selection -@cbind p = sh 'echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' +@cbind p = spawn_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 = spawn_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 'echo "event REQ_NEW_WINDOW $(xclip -o)" > "$UZBL_FIFO"' +@cbind 'p = spawn_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 = spawn_sh 'echo "event INJECT_KEYCMD $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' # Bookmark inserting binds -@cbind m_ = sh 'echo "$UZBL_URI $1" >> "$XDG_DATA_HOME"/uzbl/bookmarks' '%s' +@cbind m_ = spawn_sh 'echo "$UZBL_URI $0" >> "@data_home/bookmarks"' '%s' # Or use a script to insert a bookmark. @cbind M = spawn @scripts_dir/insert_bookmark.sh @@ -392,48 +410,66 @@ set ebind = @mode_bind global,-insert # Link following (similar to vimperator and konqueror) # Set custom keys you wish to use for navigation. Some common examples: -set follow_hint_keys = 0123456789 -#set follow_hint_keys = qwerty -#set follow_hint_keys = asdfghjkl; -#set follow_hint_keys = thsnd-rcgmvwb/;789aefijkopquxyz234 - -@cbind * = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'click') >\@ -@cbind f* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'click') >\@ -@cbind F* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'newwindow') >\@ -#@cbind gL* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'returnuri') >\@ set -@cbind gl* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'returnuri') >\@ clipboard +set follow_hint_keys 0123456789 +#set follow_hint_keys qwerty +#set follow_hint_keys asdfghjkl; +#set follow_hint_keys thsnd-rcgmvwb/;789aefijkopquxyz234 + +# follow links +# The structure for these calls is to call a shell script (follow.sh) with the +# output of some JavaScript code (follow.js) which gets a URI from the page to +# act on. The first argument to followLinks() is the list of characters to use +# for labelling links, the second is the currently entered keys, and the third +# is the 'mode' to use. The modes are 'click', 'newwindow', and 'returnuri'. +# The 'click' and 'newwindow' modes are handled in follow.js completely. When +# using 'returnuri' the second argument to follow.sh is the action to use for +# the URI. Currently implemented are 'set' (uses the 'uri' command), +# 'newwindow' (uses the REQ_NEW_WINDOW event), and 'clipboard' (copies the URI +# to the clipboard). + +# follow hint keys: +# fl -> emulate a click on the link +# Fl -> open in a new window +# fL -> take the url and navigate directly to it +# FL -> copy the url to the clipboard +@cbind f* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followLinks("\@follow_hint_keys", "%s", 'click') >\@ +@cbind F* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followLinks("\@follow_hint_keys", "%s", 'newwindow') >\@ +#@cbind fL* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followLinks("\@follow_hint_keys", "%s", 'returnuri') >\@ set +#@cbind FL* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followLinks("\@follow_hint_keys", "%s", 'returnuri') >\@ clipboard @cbind gi = spawn @scripts_dir/go_input.sh -#@cbind fs = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ set -#@cbind fS = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('click') >\@ -#@cbind Fs = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('newwindow') >\@ +# follow selected link: +# fs -> emulate a click on the link +# Fs -> open in a new window +# fS -> take the url and navigate directly to it +# FS -> copy the url to the clipboard +@cbind d = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('click') >\@ +@cbind D = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('newwindow') >\@ +#@cbind Fs = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ set #@cbind FS = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ clipboard # -#@cbind ft* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'returnuri') >\@ set -#@cbind fT* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'click') >\@ -#@cbind Ft* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'newwindow') >\@ +# follow by link text (i.e., foo is selected with "ftfoo" or "'foo") +# ft -> emulate a click on the link +# Ft -> open in a new window +# fT -> take the url and navigate directly to it +# FT -> copy the url to the clipboard +#@cbind ft* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'click') >\@ +#@cbind fT* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'newwindow') >\@ +#@cbind Ft* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'returnuri') >\@ set #@cbind FT* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'returnuri') >\@ clipboard -@cbind '* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'click') >\@ - # Form filler binds # This script allows you to configure (per domain) values to fill in form # fields (eg login information) and to fill in these values automatically. # This implementation allows you to save multiple profiles for each form # (think about multiple accounts on some website). -set formfiller = spawn @scripts_dir/formfiller.sh +set formfiller spawn @scripts_dir/formfiller.sh @cbind ze = @formfiller edit @cbind zn = @formfiller new @cbind zl = @formfiller load @cbind zo = @formfiller once -# --- Uzbl tabbed binds ------------------------------------------------------ - -# Tab opening -@cbind gn = event NEW_TAB -@cbind gN = event NEW_TAB_NEXT -#@cbind go_ = event NEW_TAB %s -#@cbind gO_ = event NEW_TAB_NEXT %s +# === Short Cuts ============================================================= @cbind gop = uri https://sites.google.com/a/skola.malmo.se/ib12-physics-hl/ @cbind gob = uri https://sites.google.com/a/skola.malmo.se/ib12slbio/ @cbind goc = uri https://sites.google.com/a/skola.malmo.se/hl-chemistry-ib12/ @@ -447,21 +483,34 @@ set formfiller = spawn @scripts_dir/formfiller.sh @cbind gof = uri https://www.facebook.com/ @cbind go9 = uri https://www.9gag.com/ -# Closing / resting + + +# --- Uzbl tabbed binds ------------------------------------------------------ + +# Tab opening +@cbind gn = event NEW_TAB +@cbind gN = event NEW_TAB_NEXT +#@cbind go_ = event NEW_TAB %s +#@cbind gO_ = event NEW_TAB_NEXT %s + +# Closing / resetting @cbind x = exit @cbind gQ = event CLEAN_TABS # Tab navigating @cbind g< = event FIRST_TAB @cbind g> = event LAST_TAB -@cbind gt = event NEXT_TAB -@cbind gT = event PREV_TAB +@cbind l = event NEXT_TAB +@cbind h = event PREV_TAB @cbind gi_ = event GOTO_TAB %s +@cbind = event MOVE_CURRENT_TAB_LEFT +@cbind = event MOVE_CURRENT_TAB_RIGHT +@cbind gm_ = event MOVE_CURRENT_TAB %s # Preset loading -set preset = event PRESET_TABS +set preset event PRESET_TABS @cbind gs_ = @preset save %s -#@cbind glo_ = @preset load %s +@cbind glo_ = @preset load %s @cbind gd_ = @preset del %s # This doesn't work right now. #@cbind gli = @preset list @@ -469,31 +518,31 @@ set preset = event PRESET_TABS # === Context menu items ===================================================== # Default context menu -menu_add Google = set uri = http://google.com -menu_add Go Home = set uri = http://uzbl.org -menu_separator separator_1 -menu_add Quit uzbl = exit +menu add link Google "uri http://google.com" +menu add link "Go Home" "uri http://uzbl.org" +menu add_separator separator_1 +menu add link "Quit uzbl" exit # Link context menu -menu_link_add Print Link = print \@SELECTED_URI +menu add link "Print Link" "print \@SELECTED_URI" # === Mode configuration ===================================================== # Define some mode specific uzbl configurations. -set command = @mode_config command -set insert = @mode_config insert -set stack = @mode_config stack +set command @mode_config command +set insert @mode_config insert +set stack @mode_config stack # Command mode config. @command keycmd_style = foreground="@color13" -@command status_background = #1c1c1c +@command status_background = #202020 @command mode_indicator = Cmd @command keycmd_events = 1 @command forward_keys = 0 @command modcmd_updates = 1 # Insert mode config. -@insert status_background = #1c1c1c +@insert status_background = #303030 @insert mode_indicator = Ins @insert forward_keys = 1 @insert keycmd_events = 0 @@ -501,24 +550,30 @@ set stack = @mode_config stack # Multi-stage-binding mode config. @stack keycmd_style = foreground="@color13" -@stack status_background = #1c1c1c +@stack status_background = #202020 @stack mode_indicator = Bnd -@stack prompt_style = foreground="#888" weight="light" +@stack prompt_style = foreground="@color12" weight="light" @stack keycmd_events = 1 @stack modcmd_updates = 1 @stack forward_keys = 0 -set default_mode = command +set default_mode command + +# === SSL related configuration ============================================== + +# Set it to certificates store of your distribution, or your own CAfile. +set ssl_ca_file /etc/ssl/certs/ca-certificates.crt +set ssl_policy fail +# Command to toggle ssl_policy value: +@cbind !ssl = chain 'toggle ssl_policy fail ignore' 'reload' +# Example SSL error handler: +@on_event LOAD_ERROR js page string 'if (/SSL handshake failed/.test("%3")) {alert ("%3");}' # === Post-load misc commands ================================================ -sync_spawn_exec @scripts_dir/load_cookies.sh -sync_spawn_exec @scripts_dir/load_cookies.sh @data_home/uzbl/session-cookies.txt +spawn_sync_exec @scripts_dir/load_cookies.sh +spawn_sync_exec @scripts_dir/load_cookies.sh @data_home/session-cookies.txt # Set the "home" page. -set uri = uzbl.org/doesitwork/@COMMIT +uri uzbl.org/doesitwork/@COMMIT # vim: set fdm=syntax: - -# Autozoom -#@on_event GEOMETRY_CHANGED script ~/.config/uzbl/scripts/dynzoom.py - -- cgit v1.2.3-54-g00ecf