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