aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/config/config
diff options
context:
space:
mode:
Diffstat (limited to 'examples/config/config')
-rw-r--r--examples/config/config81
1 files changed, 54 insertions, 27 deletions
diff --git a/examples/config/config b/examples/config/config
index b6d9fe3..48aacfc 100644
--- a/examples/config/config
+++ b/examples/config/config
@@ -3,8 +3,10 @@
# === Core settings ==========================================================
-# Install location prefix.
-set prefix = /usr/local
+# common directory locations
+set prefix = @(echo $PREFIX)@
+set data_home = @(echo $XDG_DATA_HOME)@
+set cache_home = @(echo $XDG_CACHE_HOME)@
# Interface paths.
set fifo_dir = /tmp
@@ -34,28 +36,26 @@ set set_mode = set mode =
set set_status = set status_message =
# Spawn path shortcuts. In spawn the first dir+path match is used in "dir1:dir2:dir3:executable"
-set scripts_dir = $XDG_DATA_HOME/uzbl:@prefix/share/uzbl/examples/data:scripts
+set scripts_dir = @data_home/uzbl:@prefix/share/uzbl/examples/data:scripts
# === Hardcoded handlers =====================================================
# These handlers can't be moved to the new event system yet as we don't
# support events that can wait for a response from a script.
-set cookie_handler = talk_to_socket $XDG_CACHE_HOME/uzbl/cookie_daemon_socket
+set cookie_handler = talk_to_socket @cache_home/uzbl/cookie_daemon_socket
set scheme_handler = sync_spawn @scripts_dir/scheme.py
set authentication_handler = sync_spawn @scripts_dir/auth.py
+set download_handler = sync_spawn @scripts_dir/download.sh
# === Dynamic event handlers =================================================
# Open link in new window
-@on_event NEW_WINDOW sh 'uzbl-browser -u "$8"' %r
+@on_event NEW_WINDOW sh 'uzbl-browser ${8:+-u "$8"}' %r
# Open in current window
#@on_event NEW_WINDOW uri %s
# Open in new tab
#@on_event NEW_WINDOW event NEW_TAB %s
-# Download handler
-@on_event DOWNLOAD_REQUEST spawn @scripts_dir/download.sh %s \@proxy_url
-
# Load start handler
@on_event LOAD_START @set_status <span foreground="khaki">wait</span>
# Reset the keycmd on navigation
@@ -64,6 +64,9 @@ set authentication_handler = sync_spawn @scripts_dir/auth.py
# Load commit handlers
@on_event LOAD_COMMIT @set_status <span foreground="green">recv</span>
+# Userscript support. Add all scripts to $XDG_DATA_HOME/uzbl/userscripts
+#@on_event LOAD_COMMIT spawn @scripts_dir/userscripts.sh
+
# Load finish handlers
@on_event LOAD_FINISH @set_status <span foreground="gold">done</span>
@on_event LOAD_FINISH spawn @scripts_dir/history.sh
@@ -76,6 +79,9 @@ set authentication_handler = sync_spawn @scripts_dir/auth.py
# Example CONFIG_CHANGED event handler
#@on_event CONFIG_CHANGED print Config changed: %1 = %2
+# Scroll percentage calculation
+@on_event SCROLL_VERT set scroll_message = \@<(function(){var a='%1'.split(' ');var p='--';if(a[2]!=a[1]){p=(a[0]/(a[2]-a[3]));p=Math.round(10000*p)/100;};return p+'%';})()>\@
+
# === Behaviour and appearance ===============================================
set show_status = 1
@@ -98,7 +104,9 @@ set name_section = <span foreground="khaki">\@[\@NAME]\@</span>
set status_section = <span foreground="orange">\@status_message</span>
set selected_section = <span foreground="#606060">\@[\@SELECTED_URI]\@</span>
-set status_format = <span font_family="monospace">@mode_section @keycmd_section @progress_section @uri_section @name_section @status_section @scroll_section @selected_section</span>
+set download_section = <span foreground="white">\@downloads</span>
+
+set status_format = <span font_family="monospace">@mode_section @keycmd_section @progress_section @uri_section @name_section @status_section @scroll_section @selected_section @download_section</span>
set title_format_long = \@keycmd_prompt \@raw_modcmd \@raw_keycmd \@TITLE - Uzbl browser <\@NAME> \@SELECTED_URI
@@ -121,6 +129,7 @@ set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}.@{WEBKIT_MI
@modmap <Control> <Ctrl>
@modmap <ISO_Left_Tab> <Shift-Tab>
@modmap <space> <Space>
+@modmap <KP_Enter> <Enter>
#modkey_addition <Key1> <Key2> <Result>
@modkey_addition <Shift> <Ctrl> <Meta>
@@ -130,6 +139,7 @@ set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}.@{WEBKIT_MI
#ignore_key <glob>
@ignore_key <ISO_*>
@ignore_key <Shift>
+@ignore_key <Multi_key>
# --- Bind aliases -----------------------------------------------------------
@@ -173,7 +183,7 @@ set ebind = @mode_bind global,-insert
# --- Mouse bindings ---------------------------------------------------------
# Middle click open in new window
-@bind <Button2> = sh 'if [ "$8" ]; then uzbl-browser -u "$8"; else echo "uri $(xclip -o | sed s/\\\@/%40/g)" > $4; fi' \@SELECTED_URI
+@bind <Button2> = sh 'if [ "$8" ]; then uzbl-browser -u "$8"; else echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"; fi' \@SELECTED_URI
# --- Keyboard bindings ------------------------------------------------------
@@ -181,6 +191,9 @@ set ebind = @mode_bind global,-insert
# a colon.
@cbind :_ = %s
+# open a new window or a new tab (see the on_event NEW_WINDOW settings above)
+@cbind w = event NEW_WINDOW
+
# Page movement binds
@cbind j = scroll vertical 20
@cbind k = scroll vertical -20
@@ -188,8 +201,12 @@ set ebind = @mode_bind global,-insert
@cbind l = scroll horizontal 20
@cbind <Page_Up> = scroll vertical -100%
@cbind <Page_Down> = scroll vertical 100%
+@cbind <Ctrl>f = scroll vertical 100%
+@cbind <Ctrl>b = scroll vertical -100%
@cbind << = scroll vertical begin
@cbind >> = scroll vertical end
+@cbind <Home> = scroll vertical begin
+@cbind <End> = scroll vertical end
@cbind ^ = scroll horizontal begin
@cbind $ = scroll horizontal end
@cbind <Space> = scroll vertical end
@@ -230,14 +247,14 @@ set ebind = @mode_bind global,-insert
# Exit binding
@cbind ZZ = exit
# Dump config to stdout
-@cbind !dump = sh "echo dump_config > $4"
+@cbind !dump = sh 'echo dump_config > "$UZBL_FIFO"'
# Reload all variables in the config
-@cbind !reload = sh "sed '/^# === Post-load misc commands/,$d' $1 | grep '^set ' > $4"
+@cbind !reload = sh "sed '/^# === Post-load misc commands/,$d' \"$UZBL_CONFIG\" | grep '^set ' > \"$UZBL_FIFO\""
# Use socat to directly inject commands into uzbl-core and view events
# raised by uzbl-core:
-@cbind <Ctrl><Alt>t = sh 'xterm -e "socat unix-connect:$5 -"'
-#@cbind <Ctrl><Alt>t = sh 'urxvt -e socat unix-connect:$5 -'
+@cbind <Ctrl><Alt>t = sh "xterm -e 'socat unix-connect:\"$UZBL_SOCKET\" -'"
+#@cbind <Ctrl><Alt>t = sh "urxvt -e 'socat unix-connect:\"$UZBL_SOCKET\" -'"
# Uri opening prompts
@cbind o<uri:>_ = uri %s
@@ -252,20 +269,24 @@ set ebind = @mode_bind global,-insert
@cbind gh = uri http://www.uzbl.org
# Yanking & pasting binds
-@cbind yu = sh 'echo -n $6 | xclip'
-@cbind yy = sh 'echo -n $7 | xclip'
+@cbind yu = sh 'echo -n "$UZBL_URI" | xclip'
+@cbind yU = sh 'echo -n $8 | xclip' \@SELECTED_URI
+@cbind yy = sh 'echo -n "$UZBL_TITLE" | xclip'
+@cbind yY = sh 'echo -n $8 | xclip' \@SELECTED_URI
+# Clone current window
+@cbind c = sh 'uzbl-browser -u "$UZBL_URI"'
# Go the page from primary selection
-@cbind p = sh 'echo "uri `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4'
+@cbind p = sh 'echo "uri `xclip -selection primary -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"'
# Go to the page in clipboard
-@cbind P = sh 'echo "uri `xclip -selection clipboard -o | sed s/\\\@/%40/g`" > $4'
+@cbind P = sh 'echo "uri `xclip -selection clipboard -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"'
# Start a new uzbl instance from the page in primary selection
-@cbind 'p = sh 'exec uzbl-browser --uri $(xclip -o)'
+@cbind 'p = sh 'exec uzbl-browser --uri "$(xclip -o)"'
# paste primary selection into keycmd at the cursor position
-@bind <Shift-Insert> = sh 'echo "event INJECT_KEYCMD `xclip -o | sed s/\\\@/%40/g`" > $4'
+@bind <Shift-Insert> = sh 'echo "event INJECT_KEYCMD `xclip -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"'
# Bookmark inserting binds
-@cbind <Ctrl>b<tags:>_ = sh 'echo -e "$6 %s" >> $XDG_DATA_HOME/uzbl/bookmarks'
+@cbind <Ctrl>b<tags:>_ = sh 'echo `printf "$UZBL_URI %s"` >> "$XDG_DATA_HOME"/uzbl/bookmarks'
# Or use a script to insert a bookmark.
@cbind B = spawn @scripts_dir/insert_bookmark.sh
@@ -279,7 +300,8 @@ set follow_hint_keys = 0123456789
#set follow_hint_keys = qwerty
#set follow_hint_keys = asdfghjkl;
#set follow_hint_keys = thsnd-rcgmvwb/;789aefijkopquxyz234
-@cbind fl* = script @scripts_dir/follow.js '@follow_hint_keys %s'
+@cbind fl* = spawn @scripts_dir/follow.sh "%s"
+@cbind gi = spawn @scripts_dir/go_input.sh
# Form filler binds
# This script allows you to configure (per domain) values to fill in form
@@ -299,7 +321,12 @@ set formfiller = spawn @scripts_dir/formfiller.sh
@cbind gN = event NEW_TAB_NEXT
@cbind go<uri:>_ = event NEW_TAB %s
@cbind gO<uri:>_ = event NEW_TAB_NEXT %s
-@cbind gY = sh 'echo "event NEW_TAB `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4'
+@cbind gy = sh 'echo "event NEW_TAB `xclip -selection primary -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"'
+@cbind gY = sh 'echo "event NEW_TAB_NEXT `xclip -selection primary -o | sed s/\\\@/%40/g`" > "$UZBL_FIFO"'
+
+# Clone current tab
+@cbind gd = sh 'echo "event NEW_TAB $UZBL_URI" > "$UZBL_FIFO"'
+@cbind gD = sh 'echo "event NEW_TAB_NEXT $UZBL_URI" > "$UZBL_FIFO"'
# Closing / resting
@cbind gC = exit
@@ -353,13 +380,13 @@ set stack = @mode_config stack
@insert modcmd_updates = 0
# Multi-stage-binding mode config.
-@stack keycmd_events = 1
-@stack modcmd_updates = 1
-@stack forward_keys = 0
@stack keycmd_style = foreground="red"
-@stack prompt_style = foreground="#888" weight="light"
@stack status_background = #202020
@stack mode_indicator = Bnd
+@stack prompt_style = foreground="#888" weight="light"
+@stack keycmd_events = 1
+@stack modcmd_updates = 1
+@stack forward_keys = 0
set default_mode = command