From 90ebadae7fa7843ed4a43c03e344d0e8cdebc936 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 21 Aug 2010 12:07:34 -0400 Subject: Prefer sockets to fifos --- examples/data/scripts/formfiller.sh | 8 ++++---- examples/data/scripts/load_url_from_history.sh | 4 ++-- examples/data/scripts/session.sh | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'examples/data/scripts') diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index fb1eb02..041c6a6 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -140,10 +140,10 @@ if [ "$action" = 'load' ]; then sed 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):<}%/\\n\1\2):/g') printf '%s\n' "${fields}" | \ sed -n -e "s/\([^(]\+\)(\(password\|text\|search\|textarea\)\+):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\2', '\3', 0);/p" | \ - sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' > $UZBL_FIFO + sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' | socat - unix-connect:$UZBL_SOCKET printf '%s\n' "${fields}" | \ sed -n -e "s/\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\3', '\2', \4);/p" | \ - sed -e 's/@/\\@/g' > $UZBL_FIFO + sed -e 's/@/\\@/g' | socat - unix-connect:$UZBL_SOCKET elif [ "$action" = "once" ]; then tmpfile=$(mktemp) printf 'js %s dump(); \n' "$dumpFunction" | \ @@ -165,10 +165,10 @@ elif [ "$action" = "once" ]; then sed 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):<}%/\\n\1\2):/g') printf '%s\n' "${fields}" | \ sed -n -e "s/\([^(]\+\)(\(password\|text\|search\|textarea\)\+):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\2', '\3', 0);/p" | \ - sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' > $UZBL_FIFO + sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' | socat - unix-connect:$UZBL_SOCKET printf '%s\n' "${fields}" | \ sed -n -e "s/\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\3', '\2', \4);/p" | \ - sed -e 's/@/\\@/g' > $UZBL_FIFO + sed -e 's/@/\\@/g' | socat - unix-connect:$UZBL_SOCKET rm -f $tmpfile else if [ "$action" = 'new' -o "$action" = 'add' ]; then diff --git a/examples/data/scripts/load_url_from_history.sh b/examples/data/scripts/load_url_from_history.sh index ca8959c..80cd3d8 100755 --- a/examples/data/scripts/load_url_from_history.sh +++ b/examples/data/scripts/load_url_from_history.sh @@ -18,5 +18,5 @@ else goto=$(tac $UZBL_HISTORY_FILE | $DMENU | cut -d ' ' -f -3 | awk '{print $NF}') fi -[ -n "$goto" ] && echo "uri $goto" > $UZBL_FIFO -#[ -n "$goto" ] && echo "uri $goto" | socat - unix-connect:$UZBL_SOCKET +#[ -n "$goto" ] && echo "uri $goto" > $UZBL_FIFO +[ -n "$goto" ] && echo "uri $goto" | socat - unix-connect:$UZBL_SOCKET diff --git a/examples/data/scripts/session.sh b/examples/data/scripts/session.sh index 64d8c6b..89eeb7a 100755 --- a/examples/data/scripts/session.sh +++ b/examples/data/scripts/session.sh @@ -19,7 +19,7 @@ UZBL="uzbl-browser -c $UZBL_CONFIG_FILE" # add custom flags and whatever here. act="$1" # Test if we were run alone or from uzbl -if [ -z "$UZBL_FIFO" ]; then +if [ -z "$UZBL_SOCKET" ]; then # Take the old config act="$UZBL_CONFIG" fi @@ -39,24 +39,24 @@ case $act in ;; "endinstance" ) - if [ -z "$UZBL_FIFO" ]; then + if [ -z "$UZBL_SOCKET" ]; then echo "session manager: endinstance must be called from uzbl" exit 1 fi if [ ! "$UZBL_URL" = "(null)" ]; then echo "$UZBL_URL" >> $UZBL_SESSION_FILE fi - echo "exit" > $UZBL_FIFO + echo "exit" | socat - unix-connect:$UZBL_SOCKET ;; "endsession" ) mv "$UZBL_SESSION_FILE" "$UZBL_SESSION_FILE~" - for fifo in $UZBL_FIFO_DIR/uzbl_fifo_*; do - if [ "$fifo" != "$UZBL_FIFO" ]; then - echo "spawn $scriptfile endinstance" > $fifo + for sock in $UZBL_SOCKET_DIR/uzbl_fifo_*; do + if [ "$sock" != "$UZBL_SOCKET" ]; then + echo "spawn $scriptfile endinstance" | socat - unix-connect:$socket fi done - echo "spawn $scriptfile endinstance" > $UZBL_FIFO + echo "spawn $scriptfile endinstance" | socat - unix-connect:$UZBL_SOCKET ;; * ) -- cgit v1.2.3