diff options
author | Mason Larobina <mason.larobina@gmail.com> | 2009-09-25 20:49:45 +0800 |
---|---|---|
committer | Mason Larobina <mason.larobina@gmail.com> | 2009-09-25 20:49:45 +0800 |
commit | 0aa4a6de044fe26c92f36871236749d6b6f3b4f1 (patch) | |
tree | 6bf7a32b26dd8dd4f38040a1fbb73daef2e1ca84 /examples | |
parent | c33654fbd9799af4e85aeddaa01b93049650621f (diff) |
Updated config with new $PATH-like "dir1:dir2:dir3:script" spawn format
Diffstat (limited to 'examples')
-rw-r--r-- | examples/config/uzbl/config | 80 |
1 files changed, 45 insertions, 35 deletions
diff --git a/examples/config/uzbl/config b/examples/config/uzbl/config index cc2f8cb..ba684a0 100644 --- a/examples/config/uzbl/config +++ b/examples/config/uzbl/config @@ -1,7 +1,7 @@ # example uzbl config. # all settings are optional. you can use uzbl without any config at all (but it won't do much) -# set some shortcuts +# === Shortcuts ============================================================== # request BIND <keycmd> = <command> set bind = request BIND @@ -18,17 +18,20 @@ set set_mode = set mode = set set_status = set status_message = set shell_cmd = sh -c +# Spawn path shortcuts. In spawn the first dir+path match is used in "dir1:dir2:dir3:executable" +set scripts_dir = $XDG_DATA_HOME/uzbl:/usr/local/share/uzbl/examples/data/uzbl:scripts -# Handlers -set download_handler = spawn $XDG_DATA_HOME/uzbl/scripts/download.sh + +# === Handlers =============================================================== + +set download_handler = spawn @scripts_dir/download.sh set cookie_handler = talk_to_socket $XDG_CACHE_HOME/uzbl/cookie_daemon_socket -set scheme_handler = spawn $XDG_DATA_HOME/uzbl/scripts/scheme.py +set scheme_handler = spawn @scripts_dir/scheme.py # New window handler options #set new_window = sh 'echo uri "$8" > $4' # open in same window set new_window = sh 'uzbl-browser -u $8' # equivalent to the default behaviour - # Load start handler @on_event LOAD_START @set_status <span foreground="khaki">wait</span> @@ -37,13 +40,14 @@ set new_window = sh 'uzbl-browser -u $8' # equivalent to the default beh # Load finish handlers @on_event LOAD_FINISH @set_status <span foreground="gold">done</span> -@on_event LOAD_FINISH spawn $XDG_DATA_HOME/uzbl/scripts/history.sh +@on_event LOAD_FINISH spawn @scripts_dir/history.sh # Misc on_event handlers #@on_event CONFIG_CHANGED print Config changed: %1 = %2 -# Behaviour and appearance +# === Behaviour and appearance =============================================== + set show_status = 1 set status_top = 0 set status_background = #303030 @@ -76,15 +80,17 @@ set status_format = <span font_family="monospace">@mode_section @keycmd_sect #@progress pending = -# Core settings +# === Core settings ========================================================== + set useragent = Uzbl (Webkit @WEBKIT_MAJOR.@WEBKIT_MINOR.@WEBKIT_MICRO) (@(uname -o)@ @(uname -m)@ [@ARCH_UZBL]) (Commit @COMMIT) set fifo_dir = /tmp set socket_dir = /tmp -### Keyboard binding section: +# === Keyboard bindings ====================================================== -# like this you can enter any command at runtime, interactively. prefixed by ':' +# With this command you can enter in any command at runtime when prefixed with +# a colon. @bind :_ = chain '%s' @bind j = scroll_vert 20 @@ -110,20 +116,18 @@ set socket_dir = /tmp @bind n = search @bind N = search_reverse @bind gh = uri http://www.uzbl.org -# shortcut to set the uri. TODO: i think we can abandon the uri command in favor of 'set uri = ..' -#@bind o _ = uri %s # shortcut to set variables @bind s _ = set %s @bind \wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go @bind gg _ = uri http://www.google.com/search?q=%s # Enclose the executable in quotes if it has spaces. Any additional parameters you use will # appear AFTER the default parameters -#@bind B = spawn $XDG_DATA_HOME/uzbl/scripts/insert_bookmark.sh -@bind U = spawn $XDG_DATA_HOME/uzbl/scripts/load_url_from_history.sh -@bind u = spawn $XDG_DATA_HOME/uzbl/scripts/load_url_from_bookmarks.sh +#@bind B = spawn @scripts_dir}/insert_bookmark.sh +@bind U = spawn @scripts_dir/load_url_from_history.sh +@bind u = spawn @scripts_dir/load_url_from_bookmarks.sh # with the sample yank script, you can yank one of the arguments into clipboard/selection -@bind yurl = spawn $XDG_DATA_HOME/uzbl/scripts/yank.sh 6 primary -@bind ytitle = spawn $XDG_DATA_HOME/uzbl/scripts/yank.sh 7 clipboard +@bind yurl = spawn @scripts_dir/yank.sh 6 primary +@bind ytitle = spawn @scripts_dir/yank.sh 7 clipboard # does the same as yurl but without needing a script @bind y2url = sh 'echo -n $6 | xclip' # go the page from primary selection @@ -133,7 +137,7 @@ set socket_dir = /tmp # start a new uzbl instance from the page in primary selection @bind 'p = sh 'exec uzbl --uri $(xclip -o)' @bind ZZ = exit -@bind Xs = js alert("hi"); +@bind Xs = js alert("hi"); # example showing how to use sh # it sends a command to the fifo, whose path is told via a positional param # if fifo_dir is not set, it'll echo to a file named (null) somewhere >:) remember to delete it @@ -147,40 +151,41 @@ set socket_dir = /tmp @bind !reload = sh 'cat $1 > $4' # this script allows you to configure (per domain) values to fill in form fields (eg login information) and to fill in these values automatically -@bind za = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh -@bind ze = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh edit -@bind zn = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh new -@bind zl = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh load +set formfiller = spawn @scripts_dir/formfiller +@bind za = @{formfiller}.sh +@bind ze = @{formfiller}.sh edit +@bind zn = @{formfiller}.sh new +@bind zl = @{formfiller}.sh load -# other - more advanced - implementation using perl: (could not get this to run - Dieter ) -@bind LL = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.pl load -@bind LN = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.pl new -@bind LE = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.pl edit +# Or the more advanced implementation using perl: (could not get this to run - Dieter) +@bind LL = @{formfiller}.pl load +@bind LN = @{formfiller}.pl new +@bind LE = @{formfiller}.pl edit # we ship some javascripts to do keyboard based link hinting/following. (webkit does not have C DOM bindings yet) # this is similar to how it works in vimperator (and konqueror) # TODO: did we resolve: "no click() event for hyperlinks so no referrer set" ? #hit F to toggle the Hints (now in form of link numbering) -@bind F = script $XDG_DATA_HOME/uzbl/scripts/hint.js +@bind F = script @scripts_dir/hint.js # the most stable version: -@bind fl* = script $XDG_DATA_HOME/uzbl/scripts/follow_Numbers.js %s +@bind fl* = script @scripts_dir/follow_Numbers.js %s # using strings, not polished yet: -@bind fL* = script $XDG_DATA_HOME/uzbl/scripts/follow_Numbers_Strings.js %s +@bind fL* = script @scripts_dir/follow_Numbers_Strings.js %s -# Examples using multi-stage-bindings with text prompts +# Examples using multi-stage-bindings with text prompts. @bind o<uri:>_ = uri %s # Prints tab separated "uri title keyword tags" to the bookmarks file. -@bind <Ctrl>b<bookmark keyword:>_<bookmark tags:>_ = sh 'echo -e "$6 $7 %s %s" >> $XDG_DATA_HOME/uzbl/bookmarks' +# TODO: Improve bookmarks script to handle this format & include date in bookmark format. +@bind <Ctrl>b<name:>_<tags:>_ = sh 'echo -e "$6 $7 %s %s" >> $XDG_DATA_HOME/uzbl/bookmarks' +# Multi-stage bindings with blank prompts (similar behaviour to emacs M-c M-s bindings?) @bind <Ctrl>a<:>q = exit @bind <Ctrl>a<:>h = uri http://uzbl.org/ -### Mode config section: - -set default_mode = command +# === Mode configuration ===================================================== # Define some mode specific uzbl configurations. set command = @mode_config command @@ -204,7 +209,9 @@ set stack = @mode_config stack @stack status_background = #202020 @stack mode_indicator = Bnd +set default_mode = command +# Mode bindings: # Changing mode method via set. @bind I = @set_mode insert @@ -214,5 +221,8 @@ set toggle_cmd_ins = @toggle_modes command insert @bind i = @toggle_cmd_ins @bind <Ctrl>i = @toggle_cmd_ins -# "home" page if you will + +# === Post-load misc commands =============================================== + +# Set the "home" page. set uri = uzbl.org |