From 22c3109e1a26c2eb37e03d3f7bb86079c2e0874c Mon Sep 17 00:00:00 2001 From: Paweł Zuzelski Date: Sun, 28 Mar 2010 18:19:14 +0200 Subject: emit FORM_ACTIVE, when form element follow.js'ed Due to Uzbl removal it is no longer possible to emit event from js script. So follow.js does not emit FORM_ACTIVE event, when user selects form element using follow.js. Workaround for that is to run follow.js from shell script, set some global variable and next read this variable from shell script. --- examples/config/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index de01cf3..29e7d16 100644 --- a/examples/config/config +++ b/examples/config/config @@ -324,7 +324,7 @@ 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 ff* = spawn @scripts_dir/follow.sh "%s" # --- Form filler binds --- # This script allows you to configure (per domain) values to fill in form -- cgit v1.2.3 From b6117cce525e60aa41f960fd094f535077f2f83c Mon Sep 17 00:00:00 2001 From: Paweł Zuzelski Date: Sun, 28 Mar 2010 21:54:55 +0200 Subject: reverted fl* keybinding for follow script. ff* was mistake --- examples/config/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 29e7d16..3ab778a 100644 --- a/examples/config/config +++ b/examples/config/config @@ -324,7 +324,7 @@ set follow_hint_keys = 0123456789 #set follow_hint_keys = qwerty #set follow_hint_keys = asdfghjkl; #set follow_hint_keys = thsnd-rcgmvwb/;789aefijkopquxyz234 -@cbind ff* = spawn @scripts_dir/follow.sh "%s" +@cbind fl* = spawn @scripts_dir/follow.sh "%s" # --- Form filler binds --- # This script allows you to configure (per domain) values to fill in form -- cgit v1.2.3 From 7352cd1b1d4ed9f3d98567d21f7bd6f118cc4225 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 18 Apr 2010 17:44:55 -0500 Subject: added userscript in the examples, modified from singpolyma's script --- examples/config/config | 4 ++++ examples/data/scripts/userscript.sh | 40 ++++++++++++++++++++++++++++++++++++ examples/data/scripts/userscripts.sh | 8 ++++++++ 3 files changed, 52 insertions(+) create mode 100755 examples/data/scripts/userscript.sh create mode 100755 examples/data/scripts/userscripts.sh (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index bb5acc6..2fa30a1 100644 --- a/examples/config/config +++ b/examples/config/config @@ -65,6 +65,10 @@ set authentication_handler = sync_spawn @scripts_dir/auth.py # Load commit handlers @on_event LOAD_COMMIT @set_status recv + +@on_event LOAD_COMMIT spawn @scripts_dir/userscripts.sh + + # Load finish handlers @on_event LOAD_FINISH @set_status done @on_event LOAD_FINISH spawn @scripts_dir/history.sh diff --git a/examples/data/scripts/userscript.sh b/examples/data/scripts/userscript.sh new file mode 100755 index 0000000..33a24ae --- /dev/null +++ b/examples/data/scripts/userscript.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +if [ $# = "3" ] +then + fifo="$1" + url="$2" + SCRIPT="$3" +else + fifo="$4" + url="$6" + SCRIPT="$8" +fi + +# Extract metadata chunk +META="`sed -ne '/^\s*\/\/\s*==UserScript==\s*$/,/^\s*\/\/\s*==\/UserScript==\s*$/p' "$SCRIPT"`" +SHOULD_RUN=false # Assume this script will not be included +# Loop over all include rules +for INCLUDE in `echo "$META" | grep "^\s*\/\/\s*@include"`; do + # Munge into grep pattern + INCLUDE="`echo "$INCLUDE" | sed -e 's/^\s*\/\/\s*@include\s*//' -e 's/\./\\\\./g' -e 's/\*/.*/g' -e 's/[\r\n]//g'`" + if echo "$url" | grep -x "$INCLUDE"; then + SHOULD_RUN=true + break + fi +done + +# Loop over all exclude rules +for EXCLUDE in `echo "$META" | grep "^\s*\/\/\s*@exclude"`; do + # Munge into grep pattern + EXCLUDE="`echo "$EXCLUDE" | sed -e 's/^\s*\/\/\s*@exclude\s*//' -e 's/\./\\\\./g' -e 's/\*/.*/g' -e 's/[\r\n]//g'`" + if echo "$url" | grep -x "$EXCLUDE"; then + SHOULD_RUN=false + break + fi +done + +# Run the script +if [ $SHOULD_RUN = true ]; then + echo "script '$SCRIPT'" > "$fifo" +fi diff --git a/examples/data/scripts/userscripts.sh b/examples/data/scripts/userscripts.sh new file mode 100755 index 0000000..8896224 --- /dev/null +++ b/examples/data/scripts/userscripts.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +scripts_dir="$XDG_DATA_HOME/uzbl/userscripts" + +for SCRIPT in $(grep -rlx "\s*//\s*==UserScript==\s*" "$scripts_dir") +do + $XDG_DATA_HOME/uzbl/scripts/userscript.sh "$4" "$6" "$SCRIPT" +done -- cgit v1.2.3 From 733d83d0ada566b0353fd2c305a3838cc2eed131 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 18 Apr 2010 17:50:18 -0500 Subject: commented config line --- examples/config/config | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 2fa30a1..7e1be21 100644 --- a/examples/config/config +++ b/examples/config/config @@ -65,9 +65,8 @@ set authentication_handler = sync_spawn @scripts_dir/auth.py # Load commit handlers @on_event LOAD_COMMIT @set_status recv - -@on_event LOAD_COMMIT spawn @scripts_dir/userscripts.sh - +# 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 done -- cgit v1.2.3 From 3f33558e48612004b70d0b726f7e5651b6f67ea1 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Sun, 16 May 2010 15:11:12 +0200 Subject: Avoid bash specific syntax in helpers Most of our helpers don't really depend on bash, and work just fine with every system shell. Thus, let's avoid "bashisms" in there to accomodate more bare-bone shells (like dash, see https://wiki.ubuntu.com/DashAsBinSh ) Signed-off-by: Luca Bruno --- examples/config/config | 6 +++--- examples/data/scripts/formfiller.sh | 5 +++-- examples/data/scripts/insert_bookmark.sh | 4 ++-- examples/data/scripts/instance-select-wmii.sh | 8 ++++---- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index cff13ad..6c4b0fb 100644 --- a/examples/config/config +++ b/examples/config/config @@ -251,8 +251,8 @@ 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 'printf $6 | xclip' +@cbind yy = sh 'printf $7 | xclip' # Go the page from primary selection @cbind p = sh 'echo "uri `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4' @@ -264,7 +264,7 @@ set ebind = @mode_bind global,-insert @bind = sh 'echo "event INJECT_KEYCMD `xclip -o | sed s/\\\@/%40/g`" > $4' # Bookmark inserting binds -@cbind b_ = sh 'echo -e "$6 %s" >> $XDG_DATA_HOME/uzbl/bookmarks' +@cbind b_ = sh 'echo `printf "$6 %s"` >> $XDG_DATA_HOME/uzbl/bookmarks' # Or use a script to insert a bookmark. @cbind B = spawn @scripts_dir/insert_bookmark.sh diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index 69eca17..deccea2 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -51,6 +51,7 @@ else fi PROMPT="Choose profile" +RAND=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -c 1-5) MODELINE="> vim:ft=formfiller" keydir=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/dforms @@ -159,7 +160,7 @@ then then menu=`cat $keydir/$domain| \ sed -n 's/^!profile=\([^[:blank:]]\+\)/\1/p'` - option=`echo -e -n "$menu"| dmenu ${LINES} -nb "${NB}" -nf "${NF}" -sb "${SB}" -sf "${SF}" -p "${PROMPT}"` + option=`printf "$menu"| dmenu ${LINES} -nb "${NB}" -nf "${NF}" -sb "${SB}" -sf "${SF}" -p "${PROMPT}"` fi # Remove comments @@ -210,7 +211,7 @@ else if [ "$action" = 'new' -o "$action" = 'add' ] then [ "$action" = 'new' ] && echo "$MODELINE" > $keydir/$domain - echo "!profile=NAME_THIS_PROFILE$RANDOM" >> $keydir/$domain + echo "!profile=NAME_THIS_PROFILE$RAND" >> $keydir/$domain # # 2. and 3. line (tr -d and sed) are because, on gmail login for example, # tag is splited into lines diff --git a/examples/data/scripts/insert_bookmark.sh b/examples/data/scripts/insert_bookmark.sh index d0ec84e..2ec5975 100755 --- a/examples/data/scripts/insert_bookmark.sh +++ b/examples/data/scripts/insert_bookmark.sh @@ -3,7 +3,7 @@ [ -d "${XDG_DATA_HOME:-$HOME/.local/share}/uzbl" ] || exit 1 file=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/bookmarks -which zenity &>/dev/null || exit 2 +which zenity 2>&1 >/dev/null || exit 2 url=$6 # replace tabs, they are pointless in titles and we want to use tabs as delimiter. title=$(echo "$7" | sed 's/\t/ /') @@ -14,5 +14,5 @@ url=`echo $entry | awk '{print $1}'` # TODO: check if already exists, if so, and tags are different: ask if you want to replace tags echo "$entry" >/dev/null #for some reason we need this.. don't ask me why -echo -e "$entry" >> $file +printf "$entry\n" >> $file true diff --git a/examples/data/scripts/instance-select-wmii.sh b/examples/data/scripts/instance-select-wmii.sh index fdd27e6..64b859e 100755 --- a/examples/data/scripts/instance-select-wmii.sh +++ b/examples/data/scripts/instance-select-wmii.sh @@ -20,7 +20,7 @@ else DMENU="dmenu -i" fi -if [ "$1" == 'list' ] +if [ "$1" = 'list' ] then list= # get window id's of uzbl clients. we could also get the label in one shot but it's pretty tricky @@ -29,9 +29,9 @@ then label=$(wmiir read /client/$i/label) list="$list$i : $label\n" done - window=$(echo -e "$list" | $DMENU $COLORS | cut -d ' ' -f1) + window=$(printf "$list\n" | $DMENU $COLORS | cut -d ' ' -f1) wmiir xwrite /tag/sel/ctl "select client $window" -elif [ "$1" == 'next' ] +elif [ "$1" = 'next' ] then current=$(wmiir read /client/sel/ctl | head -n 1) # find the next uzbl window and focus it @@ -40,7 +40,7 @@ then then wmiir xwrite /tag/sel/ctl "select client $next" fi -elif [ "$1" == 'prev' ] +elif [ "$1" = 'prev' ] then current=$(wmiir read /client/sel/ctl | head -n 1) prev=$(wmiir read /tag/sel/index | grep -B 10000 " $current " | tac | grep -m 1 uzbl | cut -d ' ' -f2) -- cgit v1.2.3 From f9922ae0f9b05afb3f485a60f57744f61fda8c40 Mon Sep 17 00:00:00 2001 From: Paweł Zuzelski Date: Tue, 8 Jun 2010 16:31:50 +0200 Subject: Resurect go_input script. --- examples/config/config | 1 + examples/data/scripts/go_input.js | 27 +++++++++++++++++++++++++++ examples/data/scripts/go_input.sh | 20 ++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 examples/data/scripts/go_input.js create mode 100755 examples/data/scripts/go_input.sh (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 3ab778a..5617e2e 100644 --- a/examples/config/config +++ b/examples/config/config @@ -325,6 +325,7 @@ set follow_hint_keys = 0123456789 #set follow_hint_keys = asdfghjkl; #set follow_hint_keys = thsnd-rcgmvwb/;789aefijkopquxyz234 @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 diff --git a/examples/data/scripts/go_input.js b/examples/data/scripts/go_input.js new file mode 100644 index 0000000..557671f --- /dev/null +++ b/examples/data/scripts/go_input.js @@ -0,0 +1,27 @@ +var elements = document.querySelectorAll("textarea, input" + [ + ":not([type='button'])", + ":not([type='checkbox'])", + ":not([type='hidden'])", + ":not([type='image'])", + ":not([type='radio'])", + ":not([type='reset'])", + ":not([type='submit'])"].join("")); +function gi() { + if (elements) { + var el, i = 0; + while((el = elements[i++])) { + var style=getComputedStyle(el, null); + if (style.display !== 'none' && style.visibility === 'visible') { + if (el.type === "file") { + el.click(); + } + else { + el.focus(); + } + return "XXXEMIT_FORM_ACTIVEXXX"; + } + } + } +} + +gi(); diff --git a/examples/data/scripts/go_input.sh b/examples/data/scripts/go_input.sh new file mode 100755 index 0000000..c873dd8 --- /dev/null +++ b/examples/data/scripts/go_input.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +config=$1; +shift +pid=$1; +shift +xid=$1; +shift +fifo=$1; +shift +socket=$1; +shift +url=$1; +shift +title=$1; +shift + +case $(echo 'script @scripts_dir/go_input.js' | socat - unix-connect:$socket) in + *XXXEMIT_FORM_ACTIVEXXX*) echo 'event FORM_ACTIVE' | socat - unix-connect:$socket ;; +esac -- cgit v1.2.3 From 32aabff645692e78e2ef2c438d11ce2fafac9b91 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 21 Aug 2010 09:52:44 -0400 Subject: Reorder Bnd style to match others --- examples/config/config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index b6d9fe3..81aa464 100644 --- a/examples/config/config +++ b/examples/config/config @@ -353,13 +353,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 -- cgit v1.2.3 From 7244ebde733e0578d8d617275f1bcaa5947bc935 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 2 Oct 2010 13:30:21 -0400 Subject: Fix the default configuration to support utils --- examples/config/config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 81aa464..847b4af 100644 --- a/examples/config/config +++ b/examples/config/config @@ -34,7 +34,8 @@ 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 = $XDG_DATA_HOME/uzbl:@prefix/share/uzbl/examples/data:scripts +set scripts_util_dir = @scripts_dir/util # === Hardcoded handlers ===================================================== -- cgit v1.2.3 From 4527524da9af9feb9a324061c4f8cb11361da224 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 9 Oct 2010 16:12:44 -0400 Subject: Alias the keypad enter to enter --- examples/config/config | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index b6d9fe3..dd76381 100644 --- a/examples/config/config +++ b/examples/config/config @@ -121,6 +121,7 @@ set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}.@{WEBKIT_MI @modmap @modmap @modmap +@modmap #modkey_addition @modkey_addition -- cgit v1.2.3 From c3fdbba61d8312244078085568478c4e93066ea4 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 9 Oct 2010 16:13:10 -0400 Subject: Ignore multikey When the compose key is used in insert mode, the multi_key is still 'active' when command mode is returned to. Ignore this key. --- examples/config/config | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index dd76381..535e68b 100644 --- a/examples/config/config +++ b/examples/config/config @@ -131,6 +131,7 @@ set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}.@{WEBKIT_MI #ignore_key @ignore_key @ignore_key +@ignore_key # --- Bind aliases ----------------------------------------------------------- -- cgit v1.2.3 From e208b432c1337d5b09650fe2f192fd9d5bf117af Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 9 Oct 2010 16:13:54 -0400 Subject: More scrolling bindings Home/End should work. Ctrl-f/b are commonly used vim bindings. --- examples/config/config | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 535e68b..bbd9f82 100644 --- a/examples/config/config +++ b/examples/config/config @@ -190,8 +190,12 @@ set ebind = @mode_bind global,-insert @cbind l = scroll horizontal 20 @cbind = scroll vertical -100% @cbind = scroll vertical 100% +@cbind f = scroll vertical 100% +@cbind b = scroll vertical -100% @cbind << = scroll vertical begin @cbind >> = scroll vertical end +@cbind = scroll vertical begin +@cbind = scroll vertical end @cbind ^ = scroll horizontal begin @cbind $ = scroll horizontal end @cbind = scroll vertical end -- cgit v1.2.3 From de6c0fba6787c2b05e44244cfe3cdb1c864e0423 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 9 Oct 2010 16:14:42 -0400 Subject: Add the same duality for pasting a url as others It changes gY's meaning, but it better matches with go/gO and friends. --- examples/config/config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index bbd9f82..fe2565c 100644 --- a/examples/config/config +++ b/examples/config/config @@ -305,7 +305,8 @@ set formfiller = spawn @scripts_dir/formfiller.sh @cbind gN = event NEW_TAB_NEXT @cbind go_ = event NEW_TAB %s @cbind gO_ = 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`" > $4' +@cbind gY = sh 'echo "event NEW_TAB_NEXT `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4' # Closing / resting @cbind gC = exit -- cgit v1.2.3 From a43400b5633dcff781e5c4ff5a52608cf3e29793 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 9 Oct 2010 16:15:27 -0400 Subject: Add a keybinding to open a similar window History is lost, but it works as a temporary bookmarking system. --- examples/config/config | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index fe2565c..961d1d9 100644 --- a/examples/config/config +++ b/examples/config/config @@ -261,6 +261,9 @@ set ebind = @mode_bind global,-insert @cbind yu = sh 'echo -n $6 | xclip' @cbind yy = sh 'echo -n $7 | xclip' +# Clone current window +@cbind c = sh 'echo "event NEW_TAB $6" > $4' +#@cbind c = sh 'uzbl-browser -u $6' # Go the page from primary selection @cbind p = sh 'echo "uri `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4' # Go to the page in clipboard -- cgit v1.2.3 From c585a24f67fcd7e796ef25366123db21cfad1322 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 9 Oct 2010 16:25:28 -0400 Subject: Make tabbed versions of the 'clone' binding --- examples/config/config | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 961d1d9..a387019 100644 --- a/examples/config/config +++ b/examples/config/config @@ -262,8 +262,7 @@ set ebind = @mode_bind global,-insert @cbind yy = sh 'echo -n $7 | xclip' # Clone current window -@cbind c = sh 'echo "event NEW_TAB $6" > $4' -#@cbind c = sh 'uzbl-browser -u $6' +@cbind c = sh 'uzbl-browser -u $6' # Go the page from primary selection @cbind p = sh 'echo "uri `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4' # Go to the page in clipboard @@ -311,6 +310,10 @@ set formfiller = spawn @scripts_dir/formfiller.sh @cbind gy = sh 'echo "event NEW_TAB `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4' @cbind gY = sh 'echo "event NEW_TAB_NEXT `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4' +# Clone current tab +@cbind gd = sh 'echo "event NEW_TAB $6" > $4' +@cbind gD = sh 'echo "event NEW_TAB_NEXT $6" > $4' + # Closing / resting @cbind gC = exit @cbind gQ = event CLEAN_TABS -- cgit v1.2.3 From 8da3fc7070bd9a4f6e712d38d9f628f1399b7c57 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 10 Oct 2010 11:46:23 -0400 Subject: Add yU/yY to yank the hovered uri --- examples/config/config | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index a387019..c61ae76 100644 --- a/examples/config/config +++ b/examples/config/config @@ -259,7 +259,9 @@ set ebind = @mode_bind global,-insert # Yanking & pasting binds @cbind yu = sh 'echo -n $6 | xclip' +@cbind yU = sh 'echo -n $8 | xclip' \@SELECTED_URI @cbind yy = sh 'echo -n $7 | xclip' +@cbind yY = sh 'echo -n $8 | xclip' \@SELECTED_URI # Clone current window @cbind c = sh 'uzbl-browser -u $6' -- cgit v1.2.3 From b688f20bcf0393009924699c68e387ad6d0b55a5 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 10 Oct 2010 04:12:44 +0800 Subject: Alias the keypad enter to enter --- examples/config/config | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 622f859..c4a7e0d 100644 --- a/examples/config/config +++ b/examples/config/config @@ -124,6 +124,7 @@ set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}.@{WEBKIT_MI @modmap @modmap @modmap +@modmap #modkey_addition @modkey_addition -- cgit v1.2.3 From 775d3fd5f0cd8bfc26700fd287034a9fb6387fcf Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 10 Oct 2010 04:13:10 +0800 Subject: Ignore multikey When the compose key is used in insert mode, the multi_key is still 'active' when command mode is returned to. Ignore this key. --- examples/config/config | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index c4a7e0d..6af2276 100644 --- a/examples/config/config +++ b/examples/config/config @@ -134,6 +134,7 @@ set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}.@{WEBKIT_MI #ignore_key @ignore_key @ignore_key +@ignore_key # --- Bind aliases ----------------------------------------------------------- -- cgit v1.2.3 From 81711172d004473ce56b153f3aad3d56c395f795 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 10 Oct 2010 04:13:54 +0800 Subject: More scrolling bindings Home/End should work. Ctrl-f/b are commonly used vim bindings. --- examples/config/config | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 6af2276..d927b27 100644 --- a/examples/config/config +++ b/examples/config/config @@ -193,8 +193,12 @@ set ebind = @mode_bind global,-insert @cbind l = scroll horizontal 20 @cbind = scroll vertical -100% @cbind = scroll vertical 100% +@cbind f = scroll vertical 100% +@cbind b = scroll vertical -100% @cbind << = scroll vertical begin @cbind >> = scroll vertical end +@cbind = scroll vertical begin +@cbind = scroll vertical end @cbind ^ = scroll horizontal begin @cbind $ = scroll horizontal end @cbind = scroll vertical end -- cgit v1.2.3 From c98f8cc6e624a8490a535abedca7e72c1df8bb38 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 10 Oct 2010 04:14:42 +0800 Subject: Add the same duality for pasting a url as others It changes gY's meaning, but it better matches with go/gO and friends. --- examples/config/config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index d927b27..925f59b 100644 --- a/examples/config/config +++ b/examples/config/config @@ -309,7 +309,8 @@ set formfiller = spawn @scripts_dir/formfiller.sh @cbind gN = event NEW_TAB_NEXT @cbind go_ = event NEW_TAB %s @cbind gO_ = 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`" > $4' +@cbind gY = sh 'echo "event NEW_TAB_NEXT `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4' # Closing / resting @cbind gC = exit -- cgit v1.2.3 From 87b0c1fde07859f01424eea1abde930ad91b151e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 10 Oct 2010 22:50:53 -0400 Subject: Use SCROLL_VERT event to handle scroll percentage --- examples/config/config | 3 +++ src/uzbl-core.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 622f859..5656664 100644 --- a/examples/config/config +++ b/examples/config/config @@ -79,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 diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 4ced7af..fdfb811 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -2635,8 +2635,8 @@ main (int argc, char* argv[]) { NULL); g_object_connect((GObject*)uzbl.gui.bar_h, - "signal::value-changed", (GCallback)scroll_horiz_cb, NULL, - "signal::changed", (GCallback)scroll_vert_cb, NULL, + "signal::value-changed", (GCallback)scroll_horiz_cb, NULL, + "signal::changed", (GCallback)scroll_horiz_cb, NULL, NULL); if(!uzbl.state.instance_name) -- cgit v1.2.3 From e660b9de3f4331ebf171735b40eb12105218b2d7 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Sun, 21 Nov 2010 23:15:02 -0700 Subject: set UZBL_UTIL_DIR in uzbl-browser, get rid of the scripts_util_dir variable --- examples/config/config | 1 - src/uzbl-browser | 18 +++++++++++++++++- src/uzbl-core.c | 27 --------------------------- src/uzbl-core.h | 3 --- 4 files changed, 17 insertions(+), 32 deletions(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 847b4af..1457c71 100644 --- a/examples/config/config +++ b/examples/config/config @@ -35,7 +35,6 @@ 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_util_dir = @scripts_dir/util # === Hardcoded handlers ===================================================== diff --git a/src/uzbl-browser b/src/uzbl-browser index de4f7af..865447c 100755 --- a/src/uzbl-browser +++ b/src/uzbl-browser @@ -10,6 +10,8 @@ # But this shouldn't cause much problems.. PREFIX=/usr/local +EXAMPLES=$PREFIX/share/uzbl/examples + if [ -z "$XDG_DATA_HOME" ] then export XDG_DATA_HOME=$HOME/.local/share @@ -40,13 +42,27 @@ done # if no config exists yet in the recommended location, put the default (recommended) config there if [ ! -f $XDG_CONFIG_HOME/uzbl/config ] then - if ! cp $PREFIX/share/uzbl/examples/config/config $XDG_CONFIG_HOME/uzbl/config + if ! cp "$EXAMPLES"/config/config $XDG_CONFIG_HOME/uzbl/config then echo "Could not copy default config to $XDG_CONFIG_HOME/uzbl/config" >&2 exit 3 fi fi +# this variable is used by the default helper scripts as a location to +# load shared code from +if [ -z "$UZBL_UTIL_DIR" ] +then + if [ -d "$XDG_DATA_HOME"/uzbl/scripts/util ] + then + UZBL_UTIL_DIR=$XDG_DATA_HOME/uzbl/scripts/util + elif [ -d $EXAMPLES/data/scripts/util ] + then + UZBL_UTIL_DIR=$EXAMPLES/data/scripts/util + fi + export UZBL_UTIL_DIR +fi + # Uncomment this for a slight speedup at the expense of not having # stale cookie daemon sockets cleaned up. #if [ ! -S $XDG_CACHE_HOME/uzbl/cookie_daemon_socket ] diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 13328d0..fd589c0 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -1263,29 +1263,6 @@ sharg_append(GArray *a, const gchar *str) { g_array_append_val(a, s); } -gboolean -uzbl_setup_environ() { - gchar *util_dirs = expand("@scripts_util_dir", 0); - gchar *util_dir = NULL; - gboolean succeed = FALSE; - - if(!util_dirs) { - g_free(util_dirs); - return succeed; - } - - if(!(util_dir = find_existing_file(util_dirs))) { - g_free(util_dirs); - return succeed; - } - - succeed = g_setenv("UZBL_UTIL_DIR", util_dir, TRUE); - - g_free(util_dirs); - g_free(util_dir); - return succeed; -} - // make sure that the args string you pass can properly be interpreted (eg properly escaped against whitespace, quotes etc) gboolean run_command (const gchar *command, const guint npre, const gchar **args, @@ -1297,7 +1274,6 @@ run_command (const gchar *command, const guint npre, const gchar **args, gchar *pid = itos(getpid()); gchar *xwin = itos(uzbl.xwin); guint i; - gboolean environ_set = uzbl_setup_environ(); sharg_append(a, command); for (i = 0; i < npre; i++) /* add n args before the default vars */ @@ -1337,9 +1313,6 @@ run_command (const gchar *command, const guint npre, const gchar **args, printf("Stdout: %s\n", *output_stdout); } } - if (!environ_set) { - g_printerr("failed to set the environment for scripts"); - } if (err) { g_printerr("error on run_command: %s\n", err->message); g_error_free (err); diff --git a/src/uzbl-core.h b/src/uzbl-core.h index 15f7299..5760423 100644 --- a/src/uzbl-core.h +++ b/src/uzbl-core.h @@ -273,9 +273,6 @@ chain (WebKitWebView *page, GArray *argv, GString *result); void close_uzbl (WebKitWebView *page, GArray *argv, GString *result); -gboolean -uzbl_setup_environ(); - gboolean run_command(const gchar *command, const guint npre, const gchar **args, const gboolean sync, char **output_stdout); -- cgit v1.2.3 From 63086b80b7a07ca4fc00e270ca92c1e679edb882 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Mon, 22 Nov 2010 15:56:14 -0700 Subject: remove ancient cookies.sh example white/blacklist --- examples/config/cookies | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 examples/config/cookies (limited to 'examples/config') diff --git a/examples/config/cookies b/examples/config/cookies deleted file mode 100644 index 9b7374a..0000000 --- a/examples/config/cookies +++ /dev/null @@ -1,22 +0,0 @@ -# This file demonstrates how one *could* manage his cookies. this file is used by the example cookie handler script. -# stick to this format. -# trusted -> always store what we get, send what we have (TODO: by default, or when requested?) -# deny -> deny storing + sending - -# if you don't like to edit this file manually, you could even write a script that adds/removes entries using sed, and call the script from uzbl with a keybind... - - -TRUSTED -bbs.archlinux.org -archlinux.org -linux.com - - - - -DENY -www.icanhascheezburger.com - - - -# rest -> ask \ No newline at end of file -- cgit v1.2.3 From 518004933b6d110d2a6d140f86c759dd4e713607 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Wed, 24 Nov 2010 21:56:44 -0700 Subject: add a new keybinding 'w' that opens a new window or tab --- examples/config/config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples/config') diff --git a/examples/config/config b/examples/config/config index 8189479..855f7c2 100644 --- a/examples/config/config +++ b/examples/config/config @@ -47,7 +47,7 @@ set authentication_handler = sync_spawn @scripts_dir/auth.py # === 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 @@ -189,6 +189,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 -- cgit v1.2.3