diff options
-rw-r--r-- | examples/config/config | 6 | ||||
-rwxr-xr-x | examples/data/scripts/formfiller.sh | 5 | ||||
-rwxr-xr-x | examples/data/scripts/insert_bookmark.sh | 4 | ||||
-rwxr-xr-x | examples/data/scripts/instance-select-wmii.sh | 8 | ||||
-rwxr-xr-x | examples/data/scripts/load_url_from_bookmarks.sh | 2 |
5 files changed, 13 insertions, 12 deletions
diff --git a/examples/config/config b/examples/config/config index 51f68d9..cad9f92 100644 --- a/examples/config/config +++ b/examples/config/config @@ -255,8 +255,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' @@ -268,7 +268,7 @@ set ebind = @mode_bind global,-insert @bind <Shift-Insert> = sh 'echo "event INJECT_KEYCMD `xclip -o | sed s/\\\@/%40/g`" > $4' # Bookmark inserting binds -@cbind <Ctrl>b<tags:>_ = sh 'echo -e "$6 %s" >> $XDG_DATA_HOME/uzbl/bookmarks' +@cbind <Ctrl>b<tags:>_ = 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, # <input > 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) diff --git a/examples/data/scripts/load_url_from_bookmarks.sh b/examples/data/scripts/load_url_from_bookmarks.sh index 1e9f9e7..cb13420 100755 --- a/examples/data/scripts/load_url_from_bookmarks.sh +++ b/examples/data/scripts/load_url_from_bookmarks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh #NOTE: it's the job of the script that inserts bookmarks to make sure there are no dupes. |