various dotfiles I use in my linux setup
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

config 17KB

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