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