config-default (18954B)
1 # Example uzbl config. All settings are optional. You can use uzbl without 2 # any config at all (but it won't do much). 3 4 # === Core settings ========================================================== 5 6 # common directory locations 7 set prefix = @(echo $PREFIX)@ 8 set data_home = @(echo $XDG_DATA_HOME)@ 9 set cache_home = @(echo $XDG_CACHE_HOME)@ 10 set config_home = @(echo $XDG_CONFIG_HOME)@ 11 12 # Interface paths. 13 set fifo_dir = /tmp 14 set socket_dir = /tmp 15 16 set shell_cmd = sh -c 17 18 # === General config aliases ================================================= 19 20 # Config related events (use the request function): 21 # request MODE_CONFIG <mode> <key> = <value> 22 set mode_config = request MODE_CONFIG 23 # request ON_EVENT <EVENT_NAME> <command> 24 set on_event = request ON_EVENT 25 # request ON_SET <key/glob> <command> 26 set on_set = request ON_SET 27 # request MODMAP <From> <To> 28 set modmap = request MODMAP 29 # request IGNORE_KEY <glob> 30 set ignore_key = request IGNORE_KEY 31 # request TOGGLE_MODES <mode1> <mode2> ... <moden> 32 set toggle_modes = request TOGGLE_MODES 33 34 set set_mode = set mode = 35 set set_status = set status_message = 36 37 # Spawn path shortcuts. In spawn the first dir+path match is used in "dir1:dir2:dir3:executable" 38 set scripts_dir = @data_home/uzbl:@prefix/share/uzbl/examples/data:scripts 39 40 # === Hardcoded handlers ===================================================== 41 42 # These handlers can't be moved to the new event system yet as we don't 43 # support events that can wait for a response from a script. 44 set scheme_handler = sync_spawn @scripts_dir/scheme.py 45 #set request_handler = sync_spawn @scripts_dir/request.py 46 set authentication_handler = sync_spawn @scripts_dir/auth.py 47 set download_handler = sync_spawn @scripts_dir/download.sh 48 49 # === Dynamic event handlers ================================================= 50 51 # What to do when a website wants to open a new window: 52 # Open link in new window 53 @on_event NEW_WINDOW sh 'uzbl-browser ${1:+-u "$1"}' %r 54 # Open in current window (also see the REQ_NEW_WINDOW event handler below) 55 #@on_event NEW_WINDOW uri %s 56 # Open in new tab. Other options are NEW_TAB_NEXT, NEW_BG_TAB and NEW_BG_TAB_NEXT. 57 #@on_event NEW_WINDOW event NEW_TAB %s 58 59 # What to do when the user requests a new window: 60 # If your the NEW_WINDOW handler opens the uri in the current window, you'll 61 # probably want to change this handler to open a new window or tab. 62 @on_event REQ_NEW_WINDOW event NEW_WINDOW %s 63 64 # Load start handler 65 @on_event LOAD_START @set_status <span foreground="khaki">wait</span> 66 # Reset the keycmd on navigation 67 @on_event LOAD_START @set_mode 68 69 # Load commit handlers 70 @on_event LOAD_COMMIT @set_status <span foreground="green">recv</span> 71 72 # add some javascript to the page for other 'js' and 'script' commands to access later. 73 @on_event LOAD_COMMIT js uzbl = {}; 74 @on_event LOAD_COMMIT script @scripts_dir/formfiller.js 75 @on_event LOAD_COMMIT script @scripts_dir/follow.js 76 77 # Userscripts/per-site-settings. See the script and the example configuration for details 78 #@on_event LOAD_COMMIT spawn @scripts_dir/per-site-settings.py @data_home/uzbl/per-site-settings 79 80 # Load finish handlers 81 @on_event LOAD_FINISH @set_status <span foreground="gold">done</span> 82 @on_event LOAD_FINISH spawn @scripts_dir/history.sh 83 84 # Switch to insert mode if a (editable) html form is clicked 85 @on_event FOCUS_ELEMENT sh 'if [ "$1" = INPUT -o "$1" = TEXTAREA -o "$1" = SELECT ]; then echo "@set_mode insert" > $UZBL_FIFO; fi' %s 86 # Switch to command mode if anything else is clicked 87 @on_event ROOT_ACTIVE @set_mode command 88 89 # Example CONFIG_CHANGED event handler 90 #@on_event CONFIG_CHANGED print Config changed: %1 = %2 91 92 # Scroll percentage calculation 93 @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)>\@% 94 95 # === Behaviour and appearance =============================================== 96 97 # Custom CSS can be defined here, including link follower hint styles 98 set stylesheet_uri = file://@config_home/uzbl/style.css 99 100 set show_status = 1 101 set status_top = 0 102 set status_background = #303030 103 104 set modcmd_style = weight="bold" foreground="red" 105 set keycmd_style = weight="light" foreground="red" 106 set prompt_style = foreground="grey" 107 set cursor_style = underline="single" 108 set completion_style = foreground="green" 109 set hint_style = weight="bold" 110 111 set mode_section = <span background="khaki" foreground="black">[\@[\@mode_indicator]\@]</span> 112 set keycmd_section = [<span \@prompt_style>\@[\@keycmd_prompt]\@</span><span \@modcmd_style>\@modcmd</span><span \@keycmd_style>\@keycmd</span><span \@completion_style>\@completion_list</span>] 113 set progress_section = <span foreground="#606060">\@[\@progress.output]\@</span> 114 set scroll_section = <span foreground="#606060">\@[\@scroll_message]\@</span> 115 set uri_section = <span foreground="#99FF66">\@[\@uri]\@</span> 116 set name_section = <span foreground="khaki">\@[\@NAME]\@</span> 117 set status_section = <span foreground="orange">\@status_message</span> 118 set selected_section = <span foreground="#606060">\@[\@SELECTED_URI]\@</span> 119 120 set download_section = <span foreground="white">\@downloads</span> 121 122 set status_format = <span font_family="monospace">@mode_section @keycmd_section @progress_section @name_section @status_section @scroll_section @selected_section @download_section</span> 123 set status_format_right = <span font_family="monospace"><span foreground="#666">uri:</span> @uri_section</span> 124 125 set title_format_long = \@keycmd_prompt \@raw_modcmd \@raw_keycmd \@TITLE - Uzbl browser <\@NAME> \@SELECTED_URI 126 127 # Progress bar config 128 # %d = done, %p = pending %c = percent done, %i = int done, %s = spinner, 129 # %t = percent pending, %o = int pending, %r = sprite scroll 130 set progress.width = 8 131 set progress.format = [%d>%p]%c 132 set progress.done = = 133 set progress.pending = 134 135 # === Useragent setup ======================================================== 136 137 set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}) (@(+uname -sm)@ [@ARCH_UZBL]) 138 139 # === Configure cookie blacklist ======================================================== 140 141 # Accept 'session cookies' from uzbl.org (when you have a whitelist all other cookies are dropped) 142 #request WHITELIST_COOKIE domain 'uzbl.org$' expires '^$' 143 144 # Drop google analytics tracking cookies (applied after whitelists if any) 145 #request BLACKLIST_COOKIE name '^__utm.$' 146 147 # === SSL related configuration ============================================== 148 149 # Set it to certificates store of your distribution, or your own CAfile. 150 set ssl_ca_file = /etc/ssl/certs/ca-certificates.crt 151 set ssl_verify = 1 152 # Command to toggle ssl_verify value: 153 @cbind !ssl = chain 'toggle ssl_verify' 'reload' 154 # Example SSL error handler: 155 @on_event LOAD_ERROR js var patt=new RegExp('SSL handshake failed'); if (patt.test('%3')) {alert ('%3');} 156 157 # === Key binding configuration ============================================== 158 # --- Internal modmapping and ignoring --------------------------------------- 159 160 #modmap <From> <To> 161 @modmap <Control> <Ctrl> 162 @modmap <ISO_Left_Tab> <Shift-Tab> 163 @modmap <space> <Space> 164 @modmap <KP_Enter> <Enter> 165 166 #ignore_key <glob> 167 @ignore_key <ISO_*> 168 @ignore_key <Shift> 169 @ignore_key <Multi_key> 170 @ignore_key <Mod2> 171 172 # --- Bind aliases ----------------------------------------------------------- 173 174 # request BIND <bind cmd> = <command> 175 set bind = request MODE_BIND global 176 177 # request MODE_BIND <mode> <bind cmd> = <command> 178 set mode_bind = request MODE_BIND 179 180 # Insert mode binding alias 181 set ibind = @mode_bind insert 182 183 # Command mode binding alias 184 set cbind = @mode_bind command 185 186 # Non-insert mode bindings alias (ebind for edit-bind). 187 set ebind = @mode_bind global,-insert 188 189 # --- Global & keycmd editing binds ------------------------------------------ 190 191 # Resets keycmd and returns to default mode. 192 @on_event ESCAPE @set_mode 193 @on_event ESCAPE event KEYCMD_CLEAR 194 @on_event ESCAPE js uzbl.follow.clearHints() 195 @on_event ESCAPE search_clear 196 @on_event ESCAPE js window.getSelection().removeAllRanges() 197 @bind <Escape> = event ESCAPE 198 @bind <Ctrl>[ = event ESCAPE 199 200 # Commands for editing and traversing the keycmd. 201 @ebind <Return> = event KEYCMD_EXEC_CURRENT 202 @ebind <Home> = event SET_CURSOR_POS 0 203 @ebind <End> = event SET_CURSOR_POS -1 204 @ebind <Left> = event SET_CURSOR_POS - 205 @ebind <Right> = event SET_CURSOR_POS + 206 @ebind <BackSpace> = event KEYCMD_BACKSPACE 207 @ebind <Delete> = event KEYCMD_DELETE 208 @ebind <Tab> = event START_COMPLETION 209 # Readline-ish bindings. 210 @ebind <Ctrl>w = event KEYCMD_STRIP_WORD \ -./&?= 211 @ebind <Ctrl>u = event SET_KEYCMD 212 @ebind <Ctrl>a = event SET_CURSOR_POS 0 213 @ebind <Ctrl>e = event SET_CURSOR_POS -1 214 215 @ebind <Up> = event HISTORY_PREV 216 @ebind <Down> = event HISTORY_NEXT 217 @ebind <Ctrl>r<search:>_ = event HISTORY_SEARCH %s 218 # Keycmd injection/append examples. 219 #@ebind <Ctrl>su = event INJECT_KEYCMD \@uri 220 #@ebind <Ctrl>st = event INJECT_KEYCMD \@title 221 #@ebind <Ctrl>du = event APPEND_KEYCMD \@uri 222 #@ebind <Ctrl>dt = event APPEND_KEYCMD \@title 223 224 # --- Mouse bindings --------------------------------------------------------- 225 226 # Middle click open in new window 227 @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' 228 229 # --- Keyboard bindings ------------------------------------------------------ 230 231 # With this command you can enter in any command at runtime when prefixed with 232 # a colon. 233 @cbind :_ = %s 234 235 # open a new window or a new tab (see the on_event NEW_WINDOW settings above) 236 @cbind w = event REQ_NEW_WINDOW 237 238 # Page movement binds 239 @cbind j = scroll vertical 20 240 @cbind k = scroll vertical -20 241 @cbind h = scroll horizontal -20 242 @cbind l = scroll horizontal 20 243 @cbind <Page_Down> = scroll vertical 100% 244 @cbind <Ctrl>d = scroll vertical 50% 245 @cbind <Page_Up> = scroll vertical -100% 246 @cbind <Ctrl>u = scroll vertical -50% 247 @cbind << = scroll vertical begin 248 @cbind >> = scroll vertical end 249 @cbind <Home> = scroll vertical begin 250 @cbind <End> = scroll vertical end 251 @cbind ^ = scroll horizontal begin 252 @cbind $ = scroll horizontal end 253 @cbind <Space> = scroll vertical end 254 @cbind G<Go To:>_ = scroll vertical %r! 255 @cbind _G<Go To:>_ = scroll horizontal %r! 256 257 # Navigation binds 258 @cbind b = back 259 @cbind m = forward 260 @cbind S = stop 261 @cbind r = reload 262 @cbind R = reload_ign_cache 263 264 # Zoom binds 265 @cbind + = zoom_in 266 @cbind - = zoom_out 267 @cbind T = toggle zoom_type 268 @cbind 1 = set zoom_level = 1.0 269 @cbind 2 = set zoom_level = 2.0 270 271 # Appearance binds 272 @cbind t = toggle show_status 273 274 # Page searching binds 275 @cbind /* = search %s 276 @cbind ?* = search_reverse %s 277 # Jump to next and previous items 278 @cbind n = search 279 @cbind N = search_reverse 280 281 # Print pages to a printer 282 @cbind <Ctrl>p = hardcopy 283 284 # Web searching binds 285 @cbind gg<Google:>_ = uri http://www.google.com/search?q=\@<encodeURIComponent(%r)>\@ 286 @cbind ddg<DuckDuckGo:>_ = uri http://duckduckgo.com/?q=%s 287 @cbind \\awiki<Archwiki:>_ = uri http://wiki.archlinux.org/index.php/Special:Search?search=\@<encodeURIComponent(%r)>\@&go=Go 288 @cbind \\wiki<Wikipedia:>_ = uri http://en.wikipedia.org/w/index.php?title=Special:Search&search=\@<encodeURIComponent(%r)>\@&go=Go 289 290 # Handy binds 291 # Set function shortcut 292 @cbind s<var:>_<value:>_ = set %1 = %2 293 # Exit binding 294 @cbind ZZ = exit 295 # Dump config to stdout 296 @cbind !dump = sh 'echo dump_config > "$UZBL_FIFO"' 297 # Reload all variables in the config 298 @cbind !reload = sh "sed '/^# === Post-load misc commands/,$d' \"$UZBL_CONFIG\" | grep '^set ' > \"$UZBL_FIFO\"" 299 300 # Use socat to directly inject commands into uzbl-core and view events 301 # raised by uzbl-core: 302 @cbind <Ctrl><Mod1>t = sh 'xterm -e "socat unix-connect:\"$UZBL_SOCKET\" -"' 303 #@cbind <Ctrl><Mod1>t = sh 'urxvt -e socat unix-connect:"$UZBL_SOCKET" -' 304 305 # Uri opening prompts 306 @cbind o<uri:>_ = uri %s 307 # Or have it load the current uri into the keycmd for editing 308 @cbind O<uri:\@uri>_ = uri %s 309 310 # Mode setting binds 311 @cbind i = @set_mode insert 312 @bind <Ctrl>i = @set_mode insert 313 314 # Hard-bound bookmarks 315 @cbind gh = uri http://www.uzbl.org 316 317 # New window binds 318 @cbind gw = event REQ_NEW_WINDOW 319 320 # SSL-ify bindings 321 @cbind zs = uri \@(echo "$UZBL_URI" | sed -e 's/^http:/https:/')\@ 322 @cbind zS = event REQ_NEW_WINDOW \@(echo "$UZBL_URI" | sed -e 's/^http:/https:/')\@ 323 324 # Yanking & pasting binds 325 @cbind yu = sh 'echo -n "$UZBL_URI" | xclip' 326 @cbind yU = sh 'echo -n "$1" | xclip' '\@SELECTED_URI' 327 @cbind yy = sh 'echo -n "$UZBL_TITLE" | xclip' 328 @cbind ys = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ clipboard 329 330 # Clone current window 331 @cbind c = event REQ_NEW_WINDOW \@uri 332 # Go the page from primary selection 333 @cbind p = sh 'echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' 334 # Go to the page in clipboard 335 @cbind P = sh 'echo "uri $(xclip -selection clipboard -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' 336 # Start a new uzbl instance from the page in primary selection 337 @cbind 'p = sh 'echo "event REQ_NEW_WINDOW $(xclip -o)" > "$UZBL_FIFO"' 338 # paste primary selection into keycmd at the cursor position 339 @bind <Shift><Insert> = sh 'echo "event INJECT_KEYCMD $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' 340 341 # Bookmark inserting binds 342 @cbind <Ctrl>m<tags:>_ = sh 'echo "$UZBL_URI $1" >> "$XDG_DATA_HOME"/uzbl/bookmarks' '%s' 343 # Or use a script to insert a bookmark. 344 @cbind M = spawn @scripts_dir/insert_bookmark.sh 345 346 # Bookmark/history loading 347 @cbind U = spawn @scripts_dir/load_url_from_history.sh 348 @cbind u = spawn @scripts_dir/load_url_from_bookmarks.sh 349 350 # Temporary bookmarks 351 @cbind <Ctrl>d = spawn @scripts_dir/insert_temp.sh 352 @cbind D = spawn @scripts_dir/load_url_from_temps.sh 353 354 # Link following (similar to vimperator and konqueror) 355 # Set custom keys you wish to use for navigation. Some common examples: 356 set follow_hint_keys = 0123456789 357 #set follow_hint_keys = qwerty 358 #set follow_hint_keys = asdfghjkl; 359 #set follow_hint_keys = thsnd-rcgmvwb/;789aefijkopquxyz234 360 @cbind fl* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'click') >\@ 361 @cbind Fl* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'newwindow') >\@ 362 @cbind fL* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'returnuri') >\@ set 363 @cbind FL* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'returnuri') >\@ clipboard 364 @cbind fi = spawn @scripts_dir/go_input.sh 365 366 @cbind fs = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ set 367 @cbind fS = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('click') >\@ 368 @cbind Fs = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('newwindow') >\@ 369 @cbind FS = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ clipboard 370 371 @cbind ft* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'returnuri') >\@ set 372 @cbind fT* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'click') >\@ 373 @cbind Ft* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'newwindow') >\@ 374 @cbind FT* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'returnuri') >\@ clipboard 375 376 @cbind '* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'click') >\@ 377 378 # Form filler binds 379 # This script allows you to configure (per domain) values to fill in form 380 # fields (eg login information) and to fill in these values automatically. 381 # This implementation allows you to save multiple profiles for each form 382 # (think about multiple accounts on some website). 383 set formfiller = spawn @scripts_dir/formfiller.sh 384 @cbind ze = @formfiller edit 385 @cbind zn = @formfiller new 386 @cbind zl = @formfiller load 387 @cbind zo = @formfiller once 388 389 # --- Uzbl tabbed binds ------------------------------------------------------ 390 391 # Tab opening 392 @cbind gn = event NEW_TAB 393 @cbind gN = event NEW_TAB_NEXT 394 @cbind go<uri:>_ = event NEW_TAB %s 395 @cbind gO<uri:>_ = event NEW_TAB_NEXT %s 396 397 # Closing / resting 398 @cbind gC = exit 399 @cbind gQ = event CLEAN_TABS 400 401 # Tab navigating 402 @cbind g< = event FIRST_TAB 403 @cbind g> = event LAST_TAB 404 @cbind gt = event NEXT_TAB 405 @cbind gT = event PREV_TAB 406 @cbind gi<index:>_ = event GOTO_TAB %s 407 408 # Preset loading 409 set preset = event PRESET_TABS 410 @cbind gs<preset save:>_ = @preset save %s 411 @cbind glo<preset load:>_ = @preset load %s 412 @cbind gd<preset del:>_ = @preset del %s 413 # This doesn't work right now. 414 #@cbind gli = @preset list 415 416 # === Context menu items ===================================================== 417 418 # Default context menu 419 menu_add Google = set uri = http://google.com 420 menu_add Go Home = set uri = http://uzbl.org 421 menu_separator separator_1 422 menu_add Quit uzbl = exit 423 424 # Link context menu 425 menu_link_add Print Link = print \@SELECTED_URI 426 427 # === Mode configuration ===================================================== 428 429 # Define some mode specific uzbl configurations. 430 set command = @mode_config command 431 set insert = @mode_config insert 432 set stack = @mode_config stack 433 434 # Command mode config. 435 @command keycmd_style = foreground="red" 436 @command status_background = #202020 437 @command mode_indicator = Cmd 438 @command keycmd_events = 1 439 @command forward_keys = 0 440 @command modcmd_updates = 1 441 442 # Insert mode config. 443 @insert status_background = #303030 444 @insert mode_indicator = Ins 445 @insert forward_keys = 1 446 @insert keycmd_events = 0 447 @insert modcmd_updates = 0 448 449 # Multi-stage-binding mode config. 450 @stack keycmd_style = foreground="red" 451 @stack status_background = #202020 452 @stack mode_indicator = Bnd 453 @stack prompt_style = foreground="#888" weight="light" 454 @stack keycmd_events = 1 455 @stack modcmd_updates = 1 456 @stack forward_keys = 0 457 458 set default_mode = command 459 460 # === Post-load misc commands ================================================ 461 sync_spawn_exec @scripts_dir/load_cookies.sh 462 sync_spawn_exec @scripts_dir/load_cookies.sh @data_home/uzbl/session-cookies.txt 463 464 # Set the "home" page. 465 set uri = uzbl.org/doesitwork/@COMMIT 466 467 # vim: set fdm=syntax: