My dotfiles. Period.

config 19KB

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