config 22 KB

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