Don't reset keycmd in load_start_cb.
[uzbl-mobile] / examples / config / uzbl / config
1 # example uzbl config.
2 # all settings are optional.  you can use uzbl without any config at all (but it won't do much)
3
4 # keyboard behavior in this sample config is sort of vimstyle
5
6 # Handlers
7 set download_handler = spawn $XDG_DATA_HOME/uzbl/scripts/download.sh
8 set cookie_handler   = spawn $XDG_DATA_HOME/uzbl/scripts/cookies.py
9 #set new_window      = sh 'echo uri "$8" > $4' # open in same window
10 set new_window       = sh 'uzbl -u $8' # equivalent to the default behaviour
11 set load_start_handler = chain 'set keycmd = ' 'set status_message = <span foreground="khaki">wait</span>'
12 set load_commit_handler = set status_message = <span foreground="green">recv</span>
13 set load_finish_handler = chain 'set status_message = <span foreground="gold">done</span>' 'spawn $XDG_DATA_HOME/uzbl/scripts/history.sh'
14
15
16
17 # Behaviour and appearance
18 set show_status       = 1
19 set status_background = #303030
20 set status_format     = <span font_family="monospace"><span background="khaki" foreground="black">[\@[\@MODE]\@]</span> [<span weight="bold" foreground="red">\@[\@keycmd]\@</span>] <span foreground="#606060"> \@[\@LOAD_PROGRESSBAR]\@ </span><span foreground="#99FF66">\@[\@uri]\@</span> <span foreground="khaki">\@[\@NAME]\@</span>   <span foreground="orange">\@status_message</span><span foreground="#606060"> \@[\@SELECTED_URI]\@</span></span>
21 set status_top        = 0
22 set insert_indicator = I
23 set command_indicator = C
24 set useragent       = Uzbl (Webkit @WEBKIT_MAJOR.@WEBKIT_MINOR.@WEBKIT_MICRO) (@(uname -s)@ @(uname -n)@ @(uname -r)@ @(uname -v)@ @(uname -m)@ [@ARCH_UZBL]) (Commit @COMMIT)
25
26 set fifo_dir = /tmp
27 set socket_dir = /tmp
28 set shell_cmd         = sh -c
29
30 # Keyboard interface
31 set modkey = Mod1
32 # like this you can enter any command at runtime, interactively. prefixed by ':'
33 bind    :_        = chain '%s'
34
35 bind    j         = scroll_vert 20
36 bind    k         = scroll_vert -20
37 bind    h         = scroll_horz -20
38 bind    l         = scroll_horz 20
39 bind    <<        = scroll_begin
40 bind    >>        = scroll_end
41 bind    b         = back
42 bind    m         = forward
43 bind    S         = stop
44 bind    r         = reload
45 bind    R         = reload_ign_cache
46 bind    +         = zoom_in
47 bind    -         = zoom_out
48 bind    T         = toggle_zoom_type
49 bind    1         = sh "echo set zoom_level = 1.0 > $4"
50 bind    2         = sh "echo set zoom_level = 2.0 > $4"
51 bind    t         = toggle_status
52 bind    /*        = search %s
53 bind    ?*        = search_reverse %s
54 #jump to next
55 bind    n         = search
56 bind    N         = search_reverse
57 bind    gh        = uri http://www.uzbl.org
58 # shortcut to set the uri. TODO: i think we can abandon the uri command in favor of 'set uri = ..'
59 bind    o _       = uri %s
60 # shortcut to set variables
61 bind    s _       = set %s
62 bind    \wiki _   = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go
63 bind    gg _      = uri http://www.google.com/search?q=%s
64 bind    i         = toggle_insert_mode
65 # disable insert mode (1 to enable).  note that Esc works to disable, regardless of this setting
66 bind    I         = toggle_insert_mode 0
67 # Enclose the executable in quotes if it has spaces.  Any additional parameters you use will
68 # appear AFTER the default parameters
69 bind    B         = spawn $XDG_DATA_HOME/uzbl/scripts/insert_bookmark.sh
70 bind    U         = spawn $XDG_DATA_HOME/uzbl/scripts/load_url_from_history.sh
71 bind    u         = spawn $XDG_DATA_HOME/uzbl/scripts/load_url_from_bookmarks.sh
72 # with the sample yank script, you can yank one of the arguments into clipboard/selection
73 bind    yurl      = spawn $XDG_DATA_HOME/uzbl/scripts/yank.sh 6 primary
74 bind    ytitle    = spawn $XDG_DATA_HOME/uzbl/scripts/yank.sh 7 clipboard
75 # does the same as yurl but without needing a script
76 bind    y2url     = sh 'echo -n $6 | xclip'
77 # go the page from primary selection
78 bind    p         = sh 'echo "uri `xclip -selection primary -o`" > $4'
79 # go to the page in clipboard
80 bind    P         = sh 'echo "uri `xclip -selection clipboard -o`" > $4'
81 # start a new uzbl instance from the page in primary selection
82 bind    'p        = sh 'exec uzbl --uri $(xclip -o)'
83 bind    ZZ        = exit
84 bind    Xs         = js alert("hi");
85 # example showing how to use sh
86 # it sends a command to the fifo, whose path is told via a positional param
87 # if fifo_dir is not set, it'll echo to a file named (null) somewhere >:) remember to delete it
88 # The body of the shell command should be one parameter, so if it has spaces like here,
89 # you must enclose it in quotes.  Remember to escape (and double-escape) quotes and backslashes
90 # in the body.  Any additional parameters you use will appear AFTER the default parameters (cfg file
91 # path, fifo & socket dirs, etc.)
92 bind    XS        = sh 'echo "js alert (\\"This is sent by the shell via a fifo\\")" > "$4"'
93
94 bind    !dump     = sh "echo dump_config > $4"
95 bind    !reload   = sh 'cat $1 > $4'
96
97 # this script allows you to configure (per domain) values to fill in form fields (eg login information) and to fill in these values automatically
98 bind za = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh
99 bind ze = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh edit
100 bind zn = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh new
101 bind zl = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh load
102
103 # other - more advanced - implementation using perl: (could not get this to run - Dieter )
104 bind LL = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.pl load
105 bind LN = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.pl new
106 bind LE = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.pl edit
107
108 # we ship some javascripts to do keyboard based link hinting/following.  (webkit does not have C DOM bindings yet)
109 # this is similar to how it works in vimperator (and konqueror)
110 # TODO: did we resolve: "no click() event for hyperlinks so no referrer set" ?
111 #hit F to toggle the Hints (now in form of link numbering)
112 bind    F = script $XDG_DATA_HOME/uzbl/scripts/hint.js
113 # the most stable version:
114 bind    fl* = script $XDG_DATA_HOME/uzbl/scripts/follow_Numbers.js %s
115 # using strings, not polished yet:
116 bind    fL* = script $XDG_DATA_HOME/uzbl/scripts/follow_Numbers_Strings.js %s
117
118
119 # "home" page if you will
120 set uri = uzbl.org