# example uzbl config. # all settings are optional. you can use uzbl without any config at all (but it won't do much) # === Shortcuts ============================================================== # request BIND = set bind = request BIND # request MODE_CONFIG = ... set toggle_modes = request TOGGLE_MODES # request ON_EVENT set on_event = request ON_EVENT # request PROGRESS_CONFIG = set progress = request PROGRESS_CONFIG # request MODMAP From To set modmap = request MODMAP set set_mode = set mode = set set_status = set status_message = set shell_cmd = sh -c # Spawn path shortcuts. In spawn the first dir+path match is used in "dir1:dir2:dir3:executable" set scripts_dir = $XDG_DATA_HOME/uzbl:/usr/local/share/uzbl/examples/data/uzbl:scripts # === Handlers =============================================================== set download_handler = spawn @scripts_dir/download.sh set cookie_handler = talk_to_socket $XDG_CACHE_HOME/uzbl/cookie_daemon_socket set scheme_handler = sync_spawn @scripts_dir/scheme.py # New window handler options #set new_window = sh 'echo uri "$8" > $4' # open in same window set new_window = sh 'uzbl-browser -u $8' # equivalent to the default behaviour # Load start handlers @on_event LOAD_START @set_status wait # Load commit handler @on_event LOAD_COMMIT @set_status recv # Load finish handlers @on_event LOAD_FINISH @set_status done @on_event LOAD_FINISH spawn @scripts_dir/history.sh # Generate a FORM_ACTIVE event if an editable # element on the loaded site has initial focus @on_event LOAD_FINISH js if(document.activeElement.type == 'text') {Uzbl.run("event FORM_ACTIVE");} # Switch to insert mode if a (editable) html form is clicked @on_event FORM_ACTIVE @set_mode insert # Switch to command mode if anything else is clicked @on_event ROOT_ACTIVE @set_mode command # Misc on_event handlers #@on_event CONFIG_CHANGED print Config changed: %1 = %2 # === Behaviour and appearance =============================================== set show_status = 1 set status_top = 0 set status_background = #303030 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 mode_section = [\@[\@mode_indicator]\@] set keycmd_section = [\@[\@keycmd_prompt]\@\@modcmd\@keycmd] set progress_section = \@[\@progress_format]\@ 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 @uri_section @name_section @status_section @selected_section # Progress bar config @progress width = 8 # %d = done, %p = pending %c = percent done, %i = int done, %s = spinner, # %t = percent pending, %o = int pending, %r = sprite scroll @progress format = [%d>%p]%c @progress done = = @progress pending = # Or ride those spinnas' #@progress format = [%d%s%p] #@progress spinner = -\\|/ #@progress done = - #@progress pending = # === Core settings ========================================================== set useragent = Uzbl (Webkit @WEBKIT_MAJOR.@WEBKIT_MINOR.@WEBKIT_MICRO) (@(uname -o)@ @(uname -m)@ [@ARCH_UZBL]) (Commit @COMMIT) set fifo_dir = /tmp set socket_dir = /tmp # === Binding modmaps ======================================================== #modmap from to @modmap Control Ctrl @modmap ISO_Left_Tab Shift-Tab @modmap space Space # === Keyboard bindings ====================================================== # With this command you can enter in any command at runtime when prefixed with # a colon. @bind :_ = chain '%s' @bind j = scroll vertical 20 @bind = scroll vertical 100% @bind k = scroll vertical -20 @bind = scroll vertical -100% @bind h = scroll horizontal -20 @bind l = scroll horizontal 20 @bind << = scroll vertical begin @bind >> = scroll vertical end @bind ^ = scroll horizontal begin @bind $ = scroll horizontal end @bind b = back @bind m = forward @bind S = stop @bind r = reload @bind R = reload_ign_cache @bind + = zoom_in @bind - = zoom_out @bind T = toggle_zoom_type @bind 1 = sh "echo set zoom_level = 1.0 > $4" @bind 2 = sh "echo set zoom_level = 2.0 > $4" @bind t = toggle_status @bind /* = search %s @bind ?* = search_reverse %s #jump to next @bind n = search @bind N = search_reverse @bind gh = uri http://www.uzbl.org # shortcut to set variables @bind s _ = set %s @bind \wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go @bind gg _ = uri http://www.google.com/search?q=%s # Enclose the executable in quotes if it has spaces. Any additional parameters you use will # appear AFTER the default parameters # use a script to insert bookmarks. or use the EM/keycmd technique a bit further down @bind B = spawn @scripts_dir/insert_bookmark.sh @bind U = spawn @scripts_dir/load_url_from_history.sh @bind u = spawn @scripts_dir/load_url_from_bookmarks.sh # with the sample yank script, you can yank one of the arguments into clipboard/selection @bind yurl = spawn @scripts_dir/yank.sh 6 primary @bind ytitle = spawn @scripts_dir/yank.sh 7 clipboard # does the same as yurl but without needing a script @bind y2url = sh 'echo -n $6 | xclip' # go the page from primary selection @bind p = sh 'echo "uri `xclip -selection primary -o`" > $4' # go to the page in clipboard @bind P = sh 'echo "uri `xclip -selection clipboard -o`" > $4' # start a new uzbl instance from the page in primary selection @bind 'p = sh 'exec uzbl --uri $(xclip -o)' @bind ZZ = exit @bind Xs = js alert("hi"); # example showing how to use sh # it sends a command to the fifo, whose path is told via a positional param # if fifo_dir is not set, it'll echo to a file named (null) somewhere >:) remember to delete it # The body of the shell command should be one parameter, so if it has spaces like here, # you must enclose it in quotes. Remember to escape (and double-escape) quotes and backslashes # in the body. Any additional parameters you use will appear AFTER the default parameters (cfg file # path, fifo & socket dirs, etc.) @bind XS = sh 'echo "js alert (\\"This is sent by the shell via a fifo\\")" > "$4"' @bind !dump = sh "echo dump_config > $4" @bind !reload = sh "sed '/^# === Post-load misc commands/,$d' $1 > $4" # this script allows you to configure (per domain) values to fill in form fields (eg login information) and to fill in these values automatically set formfiller = spawn @scripts_dir/formfiller @bind za = @{formfiller}.sh @bind ze = @{formfiller}.sh edit @bind zn = @{formfiller}.sh new @bind zl = @{formfiller}.sh load # Or the more advanced implementation using perl: (could not get this to run - Dieter) @bind LL = @{formfiller}.pl load @bind LN = @{formfiller}.pl new @bind LE = @{formfiller}.pl edit # we ship some javascripts to do keyboard based link hinting/following. (webkit does not have C DOM bindings yet) # this is similar to how it works in vimperator (and konqueror) # TODO: did we resolve: "no click() event for hyperlinks so no referrer set" ? #hit F to toggle the Hints (now in form of link numbering) @bind F = script @scripts_dir/hint.js # the most stable version: @bind fl* = script @scripts_dir/follow_Numbers.js %s # using strings, not polished yet: @bind fL* = script @scripts_dir/follow_Numbers_Strings.js %s # Examples using multi-stage-bindings with text prompts. @bind o_ = uri %s @bind O_ = uri %s # multi-stage binding way to write bookmarks to file from inside uzbl. @bind b_ = sh 'echo -e "$6 %s" >> $XDG_DATA_HOME/uzbl/bookmarks' # Multi-stage bindings with blank prompts (similar behaviour to emacs M-c M-s bindings?) @bind a<:>q = exit @bind a<:>h = uri http://uzbl.org/ # Inject handy values into the keycmd. @bind su = event INJECT_KEYCMD \@uri @bind st = event INJECT_KEYCMD \@TITLE # Or append. @bind du = event APPEND_KEYCMD \@uri @bind dt = event APPEND_KEYCMD \@TITLE # === command editing configuration ========================================== # you'll want this at the very least @bind = event KEYCMD_EXEC_CURRENT @bind = @set_mode # basic searching @bind = event SET_CURSOR_POS 0 @bind = event SET_CURSOR_POS -1 @bind = event SET_CURSOR_POS - @bind = event SET_CURSOR_POS + @bind = event KEYCMD_BACKSPACE @bind = event KEYCMD_DELETE # readline-ish bindings @bind w = event KEYCMD_STRIP_WORD @bind u = event SET_KEYCMD @bind a = event SET_CURSOR_POS 0 @bind e = event SET_CURSOR_POS -1 # === 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 # Link context menu menu_link_add 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 # Command mode config. @command keycmd_style = foreground="red" @command status_background = #202020 @command mode_indicator = Cmd # Insert mode config. @insert status_background = #303030 @insert mode_indicator = Ins # Multi-stage-binding mode config. @stack keycmd_events = 1 @stack modcmd_updates = 1 @stack keycmd_style = foreground="red" @stack prompt_style = foreground="#888" weight="light" @stack status_background = #202020 @stack mode_indicator = Bnd set default_mode = command # Mode bindings: # Changing mode method via set. @bind I = @set_mode insert # Or toggle between modes by rasing request events. set toggle_cmd_ins = @toggle_modes command insert @bind i = @toggle_cmd_ins @bind = @toggle_cmd_ins # === Post-load misc commands =============================================== # Set the "home" page. set uri = uzbl.org